Commit f2413941 authored by Ralf's avatar Ralf
Browse files

make more email stuff configurable

parent 6c382b98
import logging, logging.handlers, os, time, queue, threading, subprocess
import traceback, smtplib
import email.mime.text, email.utils
from config import mailAddress, mailSender, mailServer
# Logging configuration
syslogLevel = logging.INFO
mailLevel = logging.CRITICAL # must be "larger" than syslog level!
from config import mailAddress
printLevel = logging.DEBUG
# Mail logging handler
def sendeMail(subject, text, receivers, sender='sphinx@hacksaar.de', replyTo=None):
def sendeMail(subject, text, receivers, sender=mailSender, replyTo=None):
assert isinstance(receivers, list)
if not len(receivers): return # nothing to do
# construct content
......@@ -21,7 +22,7 @@ def sendeMail(subject, text, receivers, sender='sphinx@hacksaar.de', replyTo=Non
if replyTo is not None:
msg['Reply-To'] = replyTo
# put into envelope and send
s = smtplib.SMTP('localhost')
s = smtplib.SMTP(mailServer)
s.sendmail(sender, receivers, msg.as_string())
s.quit()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment