Re: problem with Return-Path: <>

Marco Paganini <[email protected]>
Newsgroups gmane.mail.spam.active-spam-killer.general
Message-ID <[email protected]>
Hi Marc,

On Mon, Feb 09, 2004 at 03:23:28PM +0100, Marc Herbert wrote:
> 
> 1) It seems a few mailer-daemons set: Return-Path: <>

The Return-Path field represents what was passed as the "From" envelope.
This is the address that MTAs use to send bounces. So, you should see it in
any "MAILER-DAEMON" messages, as the MTA clearly does not care about bounces
to bounces.

> 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:

?!? It's not up to sendmail to refuse such messages. If it does, then
you won't see legitimate bounces to your messages. 

I'm confused...

> 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!

I'll check your patch.

Regards,
Paga

> 
> 
> 
> -- 
> "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
> --- 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


-- 
Marco Paganini          | UNIX / Linux / Networking
[email protected]   | PGP: http://www.paganini.net/pgp/
http://www.paganini.net | Magnus Frater te spectat...


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.