Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
dc8d91ea
Commit
dc8d91ea
authored
Feb 15, 2021
by
medmunds
Committed by
Alexander Kulumbeg
Mar 21, 2021
Browse files
Use PROJECT_NAME and VER for X-Mailer header
Also add X-Mailer header to Python version
parent
ae5a6d33
Changes
1
Hide whitespace changes
Inline
Side-by-side
notify/smtp.sh
View file @
dc8d91ea
...
@@ -112,6 +112,7 @@ smtp_send() {
...
@@ -112,6 +112,7 @@ smtp_send() {
_SMTP_USERNAME
=
"
$SMTP_USERNAME
"
_SMTP_USERNAME
=
"
$SMTP_USERNAME
"
_SMTP_PASSWORD
=
"
$SMTP_PASSWORD
"
_SMTP_PASSWORD
=
"
$SMTP_PASSWORD
"
_SMTP_TIMEOUT
=
"
${
SMTP_TIMEOUT
:-
30
}
"
_SMTP_TIMEOUT
=
"
${
SMTP_TIMEOUT
:-
30
}
"
_SMTP_X_MAILER
=
"
${
PROJECT_NAME
}
${
VER
}
--notify-hook smtp"
# Run with --debug 2 (or above) to echo the transcript of the SMTP session.
# Run with --debug 2 (or above) to echo the transcript of the SMTP session.
# Careful: this may include SMTP_PASSWORD in plaintext!
# Careful: this may include SMTP_PASSWORD in plaintext!
...
@@ -232,7 +233,7 @@ _smtp_raw_message() {
...
@@ -232,7 +233,7 @@ _smtp_raw_message() {
echo
"Date:
$(
date
+
'%a, %-d %b %Y %H:%M:%S %z'
)
"
echo
"Date:
$(
date
+
'%a, %-d %b %Y %H:%M:%S %z'
)
"
fi
fi
echo
"Content-Type: text/plain; charset=utf-8"
echo
"Content-Type: text/plain; charset=utf-8"
echo
"X-Mailer:
acme.sh --notify-hook smtp
"
echo
"X-Mailer:
$_SMTP_X_MAILER
"
echo
echo
echo
"
$_SMTP_CONTENT
"
echo
"
$_SMTP_CONTENT
"
}
}
...
@@ -286,6 +287,7 @@ smtp_secure = """$_SMTP_SECURE"""
...
@@ -286,6 +287,7 @@ smtp_secure = """$_SMTP_SECURE"""
username = """
$_SMTP_USERNAME
"""
username = """
$_SMTP_USERNAME
"""
password = """
$_SMTP_PASSWORD
"""
password = """
$_SMTP_PASSWORD
"""
timeout=int("""
$_SMTP_TIMEOUT
""") # seconds
timeout=int("""
$_SMTP_TIMEOUT
""") # seconds
x_mailer="""
$_SMTP_X_MAILER
"""
from_email="""
$_SMTP_FROM
"""
from_email="""
$_SMTP_FROM
"""
to_emails="""
$_SMTP_TO
""" # can be comma-separated
to_emails="""
$_SMTP_TO
""" # can be comma-separated
...
@@ -301,6 +303,7 @@ except (AttributeError, TypeError):
...
@@ -301,6 +303,7 @@ except (AttributeError, TypeError):
msg["Subject"] = subject
msg["Subject"] = subject
msg["From"] = from_email
msg["From"] = from_email
msg["To"] = to_emails
msg["To"] = to_emails
msg["X-Mailer"] = x_mailer
smtp = None
smtp = None
try:
try:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment