1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
--- Mailman/Handlers/SMTPDirect.py.orig 2012-06-13 15:35:54.000000000 +0200
+++ Mailman/Handlers/SMTPDirect.py 2013-08-22 14:26:22.000000000 +0200
@@ -64,11 +64,11 @@
self.__conn.connect(mm_cfg.SMTPHOST, mm_cfg.SMTPPORT)
self.__numsessions = mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION
- def sendmail(self, envsender, recips, msgtext):
+ def sendmail(self, envsender, recips, msgtext, mailopts=[]):
if self.__conn is None:
self.__connect()
try:
- results = self.__conn.sendmail(envsender, recips, msgtext)
+ results = self.__conn.sendmail(envsender, recips, msgtext, mailopts)
except smtplib.SMTPException:
# For safety, close this connection. The next send attempt will
# automatically re-open it. Pass the exception on up.
@@ -114,7 +114,7 @@
# recipients they'll swallow in a single transaction.
deliveryfunc = None
if (not msgdata.has_key('personalize') or msgdata['personalize']) and (
- msgdata.get('verp') or mlist.personalize):
+ (msgdata.get('verp') and mm_cfg.VERP_STYLE == 'Manual') or mlist.personalize):
chunks = [[recip] for recip in recips]
msgdata['personalize'] = 1
deliveryfunc = verpdeliver
@@ -376,6 +376,9 @@
if mlist.include_sender_header:
del msg['sender']
msg['Sender'] = '"%s" <%s>' % (mlist.real_name, envsender)
+ mailopts=[]
+ if msgdata.get('verp') and mm_cfg.VERP_STYLE == 'Postfix':
+ mailopts.append('XVERP=' + mm_cfg.POSTFIX_XVERP_OPTS)
# Get the plain, flattened text of the message, sans unixfrom
# using our as_string() method to not mangle From_ and not fold
# sub-part headers possibly breaking signatures.
@@ -385,7 +388,7 @@
msgid = msg['message-id']
try:
# Send the message
- refused = conn.sendmail(envsender, recips, msgtext)
+ refused = conn.sendmail(envsender, recips, msgtext, mailopts)
except smtplib.SMTPRecipientsRefused, e:
syslog('smtp-failure', 'All recipients refused: %s, msgid: %s',
e, msgid)
|