# HG changeset patch # User Sandro Knauß # Date 1258931884 -3600 # Node ID fcf8489f1c2f18c0270f1327fb9d485c893b917a # Parent f0d31c70744d669f43c0201704c6903d349f1341 iro kann nun mit mails umgehen diff -r f0d31c70744d -r fcf8489f1c2f iro/.eric4project/iro.e4q --- a/iro/.eric4project/iro.e4q Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/.eric4project/iro.e4q Mon Nov 23 00:18:04 2009 +0100 @@ -1,7 +1,7 @@ - + \ No newline at end of file diff -r f0d31c70744d -r fcf8489f1c2f iro/.eric4project/iro.e4t --- a/iro/.eric4project/iro.e4t Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/.eric4project/iro.e4t Mon Nov 23 00:18:04 2009 +0100 @@ -1,6 +1,6 @@ - + \ No newline at end of file diff -r f0d31c70744d -r fcf8489f1c2f iro/anbieter/content.py --- a/iro/anbieter/content.py Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/anbieter/content.py Mon Nov 23 00:18:04 2009 +0100 @@ -12,6 +12,7 @@ #along with this program; if not, see . from email.mime.text import MIMEText +from email.header import Header class content: def __init__(self,content): @@ -38,8 +39,9 @@ class Mail(content): def __init__(self, subject, body): - con=MIMEText(body) - con['Subject']=subject + con=MIMEText(body.encode("utf-8"), _charset='utf-8') + sub=Header(subject.encode('utf-8'), 'utf-8') + con['Subject']=sub content.__init__(self, con) def sendto(self,anbieter,recipients): diff -r f0d31c70744d -r fcf8489f1c2f iro/anbieter/smstrade.py --- a/iro/anbieter/smstrade.py Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/anbieter/smstrade.py Mon Nov 23 00:18:04 2009 +0100 @@ -132,7 +132,6 @@ parameters["senddate"] = unicode(timestamp) parameters["concat_sms"] = "1" if len(message) > 160 else "0" - params = "&".join( ["%s=%s" % (urllib.quote(k),urllib.quote(v.encode("utf-8"))) for (k, v) in parameters.items()]) headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"} diff -r f0d31c70744d -r fcf8489f1c2f iro/anbieter/smtp.py --- a/iro/anbieter/smtp.py Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/anbieter/smtp.py Mon Nov 23 00:18:04 2009 +0100 @@ -25,6 +25,7 @@ self.bTLS=False self.bSSL=False self.max_recipients=1 + def read_basic_config(self,config_filename=None): """Read basic options from the config file""" @@ -50,7 +51,6 @@ except ValueError: self.bSSL=False - def prepareSMTP(self): if self.bSSL: self.smtp = smtplib.SMTP_SSL(self.host,self.port) @@ -70,14 +70,14 @@ self.prepareSMTP() mail.content['From']=self.send_from + while len(recipients) > 0: tmp_recipients=recipients[:self.max_recipients] - print tmp_recipients self.smtp.sendmail(self.send_from, tmp_recipients, mail.as_string()) self.updateStatus( arranged=tmp_recipients) recipients = recipients[self.max_recipients:] - self.smtp.shutdownSMTP() + self.shutdownSMTP() def updateStatus(self, arranged=None, failed=None): diff -r f0d31c70744d -r fcf8489f1c2f iro/iro.e4p --- a/iro/iro.e4p Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/iro.e4p Mon Nov 23 00:18:04 2009 +0100 @@ -1,7 +1,7 @@ - + @@ -18,21 +18,23 @@ xmlrpc/__init__.py xmlrpc/SecureAuthentificateXMLRPCServer.py xmlrpc/AuthentificateXMLRPCServer.py - anbieter/smtp.py - anbieter/geonet.py - anbieter/__init__.py - anbieter/FAX_de.py - anbieter/sipgate.py - anbieter/anbieter.py xmlrpc/SecureUserdbXMLRPCServer.py worker.py user.py - anbieter/telnumber.py - anbieter/test.py test.py providerlist.py joblist.py job.py + anbieter/smtp.py + anbieter/geonet.py + anbieter/content.py + anbieter/__init__.py + anbieter/telnumber.py + anbieter/test.py + anbieter/FAX_de.py + anbieter/sipgate.py + anbieter/gsm0338.py + anbieter/anbieter.py anbieter/smstrade.py diff -r f0d31c70744d -r fcf8489f1c2f iro/iro.py --- a/iro/iro.py Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/iro.py Mon Nov 23 00:18:04 2009 +0100 @@ -89,7 +89,7 @@ MyManager.register('SMSJob', SMSJob) MyManager.register('FAXob', FAXJob) - MyManager.register('MailJob',FAXJob) + MyManager.register('MailJob',MailJob) MyManager.register('Providerlist',Providerlist) manager = MyManager() manager.start() diff -r f0d31c70744d -r fcf8489f1c2f iro/job.py --- a/iro/job.py Sun Nov 22 22:14:07 2009 +0100 +++ b/iro/job.py Mon Nov 23 00:18:04 2009 +0100 @@ -64,8 +64,6 @@ def stop(self): pass - - def start(self): Job.start(self) self.getProvider().setJob(self)