smtplib --> receiving emails two times

Martin Franklin martin.franklin at westerngeco.com
Fri Jan 26 08:09:56 EST 2001


Having just tested my words I now must eat them.;-)
do not remove the To: 


Thanks,
Martin.


Grant Edwards wrote:
> 
> In article <mailman.980432430.15190.python-list at python.org>, Martin Franklin wrote:
> 
> >You have the To: line in the message body.  This gets  used by the smtp
> >server to send the mail twice
> >
> >so change the following.
> >
> >msg = ("From: %s\r\nTo: %s\r\nSubject: topic\r\n\r\n"
> >%(fromaddress,toaddress))
> >
> >
> >to
> >
> >msg = ("From: %s\r\nSubject: topic\r\n\r\n" %(fromaddress))
> 
> Eh?  The SMTP server should ignore that To: header -- it's just
> "message data".  It should only send the mail to the addresses
> specified in the RCPT command.  RFC-788 is pretty explicit
> about this.
> 
> I'd advise leaving a To: header in the message. Some MUAs don't
> like messages without a To: line in the header. Personally,
> I've got procmail configured to dump messages with no To:
> header into the garbage.
> 
> --
> Grant Edwards                   grante             Yow!  .. Everything
>                                   at               is....FLIPPING AROUND!!
>                                visi.com
> --
> http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list