smtplib does not send to all recipients

Peter Hansen peter at engcorp.com
Thu Apr 14 13:35:39 EDT 2005


dccarson at gmail.com wrote:
> OK, I've discovered the lost messages, but I'm still slightly confused
> as to why they ended up there.  The messages were being delivered to
> the local machine, box1.domain.com, even though I was addressing them
> to <user>@domain.com.

The address is irrelevant with SMTP.  What matters is
what server you connect to, and how it is configured
to handle the envelope you give it.

Mail forwarders ought to query a DNS for the "MX"
record (on Linux, "dig domain.com mx" for that info)
and forward the mail to one of the specified mail
exchangers for that domain, regardless of what
server you actually connected to for the initial
delivery.

Not sure this is relevant in your case, but it seems
a likely candidate, since smtplib.py does not (and
should not) be looking up MX records for you, as far
as I know, while the "mail" utility might.

-Peter



More information about the Python-list mailing list