Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
archlinux
archversion
Commits
26e82fcc
Commit
26e82fcc
authored
Mar 16, 2016
by
Seblu
Browse files
Use configured mail from
parent
922612f0
Changes
1
Show whitespace changes
Inline
Side-by-side
src/bin/archversion
View file @
26e82fcc
...
@@ -173,7 +173,8 @@ def command_sendmail(args, vctrl):
...
@@ -173,7 +173,8 @@ def command_sendmail(args, vctrl):
# check args
# check args
try
:
try
:
to
=
config
[
"mail"
][
"to"
]
to
=
config
[
"mail"
][
"to"
]
subject
=
config
[
"mail"
][
"subject"
]
from_
=
config
[
"mail"
].
get
(
"from"
,
"Archversion <noreply@archlinux.org>"
)
subject
=
config
[
"mail"
].
get
(
"subject"
,
"Archversion Report"
)
smtp
=
config
[
"smtp"
][
"host"
]
smtp
=
config
[
"smtp"
][
"host"
]
except
KeyError
as
exp
:
except
KeyError
as
exp
:
logging
.
error
(
"Invalid sendmail config: %s"
%
exp
)
logging
.
error
(
"Invalid sendmail config: %s"
%
exp
)
...
@@ -190,7 +191,7 @@ def command_sendmail(args, vctrl):
...
@@ -190,7 +191,7 @@ def command_sendmail(args, vctrl):
# format the mail
# format the mail
msg
=
MIMEText
(
stdout
.
getvalue
())
msg
=
MIMEText
(
stdout
.
getvalue
())
msg
[
"Subject"
]
=
subject
msg
[
"Subject"
]
=
subject
msg
[
"From"
]
=
"Archversion <version@archlinux.org>"
msg
[
"From"
]
=
from_
msg
[
"To"
]
=
to
msg
[
"To"
]
=
to
msg
[
"Date"
]
=
formatdate
(
localtime
=
True
)
msg
[
"Date"
]
=
formatdate
(
localtime
=
True
)
# send the mail
# send the mail
...
...
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