summaryrefslogtreecommitdiff
path: root/Mailman/Utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/Utils.py')
-rw-r--r--Mailman/Utils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index ed351d9d3..a2c8c2630 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -184,7 +184,15 @@ def TrySMTPDelivery(recipient, sender, text, queue_entry):
try:
conn = smtplib.SMTP(mm_cfg.SMTPHOST)
- conn.sendmail(sender, recipient, text)
+ # Do the EHLO/HELO manually so we can check for DSN support
+ if conn.ehlo() >= 400:
+ conn.helo()
+ # receipt opts, empty unless DSN is supported, in which case we only
+ # want notification on failures
+ ropts = []
+ if conn.has_extn('dsn'):
+ ropts.append('NOTIFY=failure')
+ conn.sendmail(sender, recipient, text, rcpt_options=ropts)
conn.quit()
defer = 0
failure = None