equal
deleted
inserted
replaced
14 class anbieter: |
14 class anbieter: |
15 default_conf = '' # override this |
15 default_conf = '' # override this |
16 import smtplib |
16 import smtplib |
17 import ConfigParser |
17 import ConfigParser |
18 import logging |
18 import logging |
|
19 import copy |
|
20 |
19 logger=logging.getLogger("SMTP") |
21 logger=logging.getLogger("SMTP") |
20 |
22 |
21 class SMTP(): |
23 class SMTP(): |
22 def __init__(self,config_filenames=None,section="smtp"): |
24 def __init__(self,config_filenames=None,section="smtp"): |
23 self.config_filenames=config_filenames |
25 self.config_filenames=config_filenames |
75 |
77 |
76 if mail.getFrom(): |
78 if mail.getFrom(): |
77 frm = mail.getFrom() |
79 frm = mail.getFrom() |
78 |
80 |
79 mail.content['From'] = frm |
81 mail.content['From'] = frm |
80 |
82 |
|
83 |
81 while len(recipients) > 0: |
84 while len(recipients) > 0: |
82 tmp_recipients=recipients[:self.max_recipients] |
85 tmp_recipients=recipients[:self.max_recipients] |
83 mail.content['To']=", ".join(tmp_recipients) |
86 tmpmail=copy.deepcopy(mail) |
84 logger.debug('self.smtp.sendmail(%s,%s,%s)'%(frm, str(tmp_recipients), mail.as_string())) |
87 tmpmail.content['To']=", ".join(tmp_recipients) |
85 self.smtp.sendmail(frm, tmp_recipients, mail.as_string()) |
88 logger.debug('self.smtp.sendmail(%s,%s,%s)'%(frm, str(tmp_recipients), tmpmail.as_string())) |
|
89 self.smtp.sendmail(frm, tmp_recipients, tmpmail.as_string()) |
86 self.updateStatus( arranged=tmp_recipients) |
90 self.updateStatus( arranged=tmp_recipients) |
87 recipients = recipients[self.max_recipients:] |
91 recipients = recipients[self.max_recipients:] |
88 |
92 |
89 self.shutdownSMTP() |
93 self.shutdownSMTP() |
90 |
94 |