smtplib --> receiving emails two times

Grant Edwards grante at visi.com
Thu Jan 25 15:56:27 EST 2001


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            



More information about the Python-list mailing list