All mails from cron script are now passed through the GPG-Mailgate so they are encrypted if possible.

This commit is contained in:
fkrone 2015-06-04 20:13:04 +02:00
parent 24cfe01d95
commit 9cfbd24bdc
3 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
Your PGP key has been imported successfully. Don't be worried if this mail is not encrypted. The following mails will be encrypted.
Your PGP key has been imported successfully.

View File

@ -48,8 +48,8 @@ def send_msg( mailsubject, messagefile, recipients = None ):
msg.attach(MIMEText(mailbody, 'plain'))
msg.attach(MIMEText(markdown.markdown(mailbody), 'html'))
if 'relay' in cfg and 'host' in cfg['relay'] and 'port' in cfg['relay']:
relay = (cfg['relay']['host'], int(cfg['relay']['port']))
if 'relay' in cfg and 'host' in cfg['relay'] and 'enc_port' in cfg['relay']:
relay = (cfg['relay']['host'], int(cfg['relay']['enc_port']))
smtp = smtplib.SMTP(relay[0], relay[1])
smtp.sendmail( cfg['cron']['notification_email'], recipients, msg.as_string() )
else:

View File

@ -76,6 +76,9 @@ verbose = yes
# unless you alter the default Postfix configuration, you won't have to modify this
host = 127.0.0.1
port = 10028
# This is the default port of postfix. It is used to send some
# mails through the GPG-Mailgate so they are encrypted
enc_port = 25
[database]
# uncomment the settings below if you want