Question about smtplib, and mail servers in general.

Mike Meyer mwm at mired.org
Tue Sep 20 15:43:15 EDT 2005


Peter Hansen <peter at engcorp.com> writes:
> Daniel Dittmar wrote:
>> Chris Dewin wrote:
>>> Hi. I've been thinking about using smtplib to run a mailing list
>>> from my website.
>>>
>>> s = smtplib.SMTP("server")
>>> s.sendmail(fromaddress, toaddresess, msg)
>>>
>>> I know that in this instance, the toaddresses variable can be a variable
>>> of type list.
>>>
>>> Suppose the list contains well over 100 emails. Would that create some
>>> sort of drain on the mail server? Would I be better off doing it in some
>>> other way?
>> Not really an answer to your question, but it's probably considered
>> bad style to publish the email addresses of the recipients via the
>> address list. Use a neutral To-address (best: the mailing list
>> address) and add the recipients via bcc: headers.
>
> Not only not an answer, but also not a valid point in this case.  The
> list of recipients used in the sendmail() call (which become RCPT TO:
> commands in SMTP) do *not* show up in the received emails.

Not quite. The email address each letter is actually delivered to
generally shows up in one or more Received: headers in the received
email. Some MTAs will add a header (qmail adds Delivered-To:, for
instance) with that same address in it when they deliver the mail
locally. Most MUAs don't display those, but they are there.  There may
be an MTA that will pass a single message along to multiple recipients
after adding all of them to one or more headers. I don't know that
such exist - but I wouldn't trust that they don't.

Since you shouldn't trust email to be secure in any case, this isn't a
big deal. Note that using Bcc: doesn't help with this issue - the
addresses a message is delivered to *have* to be in the envelope. Bcc
puts them there and not in the headers.

          <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list