diff --git a/config.py.example b/config.py.example index 4fc6783c9b66e613272ee273690971686eb88ce7..e4bd79bf06f3b7d4a52ac3599b57e92cb1d9ebd9 100644 --- a/config.py.example +++ b/config.py.example @@ -33,6 +33,7 @@ FSMPI_IP_RANGES = ['137.226.35.192/29', '137.226.75.0/27', '137.226.127.32/27', DISABLE_SCHEDULER = False #MAIL_SERVER = 'mail.fsmpi.rwth-aachen.de' MAIL_FROM = 'Video AG-Website <videoag-it@lists.fsmpi.rwth-aachen.de>' +#MAIL_ADDRESS_OVERWRITE = 'videoag-it@lists.fsmpi.rwth-aachen.de' MAIL_SUFFIX = 'fsmpi.rwth-aachen.de' MAIL_DEFAULT = 'Video AG <videoag@fsmpi.rwth-aachen.de>' MAIL_ADMINS = 'videoag-it@lists.fsmpi.rwth-aachen.de' diff --git a/mail.py b/mail.py index 7b461f9577f4333fd2153d4a90daaf177625ad89..262db54ac1950338a01329a36d6a12c71a00c2c1 100644 --- a/mail.py +++ b/mail.py @@ -17,7 +17,10 @@ def send_message(msgtype, recipients, **kwargs): if 'MAIL_SERVER' not in config: return s = smtplib.SMTP(config['MAIL_SERVER']) - s.send_message(msg) + if config.get('MAIL_ADDRESS_OVERWRITE'): + s.send_message(msg, to_addrs=[config['MAIL_ADDRESS_OVERWRITE']]) + else: + s.send_message(msg) s.quit() except: traceback.print_exc()