problem with Return-Path: <>
Marc Herbert <[email protected]>
| Newsgroups | gmane.mail.spam.active-spam-killer.general |
|---|---|
| Message-ID | <Pine.LNX.4.58.0402091519230.2865@fcat> |
1) It seems a few mailer-daemons set: Return-Path: <>
2) it seems a few sendmails refuse such return-paths
ASK may try to transfer from (1) to (2), and then fail on a broken
pipe like this:
Traceback (most recent call last):
File "/usr/bin/ask.py", line 71, in ?
rc = ask.filter(sys.stdin)
File "/usr/lib/ask/askmain.py", line 150, in filter
self.msg.deliver_mail("Message from Mailer-Daemon")
File "/usr/lib/ask/askmessage.py", line 474, in deliver_mail
self.mail.deliver_mail(self.config.rc_mymailbox, self.tmpfile,
custom_header)
File "/usr/lib/ask/askmail.py", line 170, in deliver_mail
fh_mbox.write(buf)
IOError: [Errno 32] Broken pipe
I wrote the small patch attached as a workaround. Any comments
welcome!
--
"Je n'ai fait cette lettre-ci plus longue que parce que je n'ai pas eu
le loisir de la faire plus courte." -- Blaise Pascal
noemptyreturnpath_askmail.py.patch
(text/plain, 441 B)
--- askmail.py 2004/02/09 13:46:34 1.1
+++ askmail.py 2004/02/09 13:57:11
@@ -156,8 +156,14 @@
in_headers = 1;
+ returnpat = re.compile("^return-path:.*<>")
+
while 1:
buf = fh_mailfile.readline();
+
+ ## nullmailer does not want an empty return-path
+ if (in_headers and returnpat.match(buf.lower())):
+ buf = "Return-Path: <" + self.config.rc_mymails[0] + ">\n"
if (buf == ''):
break