Sending bulk email from a Python script

William Park opengeometry at yahoo.ca
Tue Mar 9 11:45:58 EST 2004


Simon Willison <cs1spw at bath.ac.uk> wrote:
> On 2004-03-08 18:57:29 -0600, claird at lairds.com (Cameron Laird) said:
> 
> > In article <2004030818081575249%cs1spw at bathacuk>, Simon Willison
> > <cs1spw at bath.ac.uk> wrote:
> > >On 2004-03-08 16:42:57 -0600, Steve Lamb <grey at despair.dmiyu.org>
> > >said:
> > >>     Install Mailman and make the list postable only by you.  :P
> > >
> > >We've already looked at mailman and a number of other packages.
> > >None of them fit our requirements as we need to be able to tie the
> > >list administration in to our existing user authentication / admin
> > >control panel, plus we want to tie the email lists to our
> > >membership databases.  We've got most of the other infrastructure
> > >already, we just need an efficient way of sending out bulk emails
> > >to a large list of addresses.  .  Give us a notion of scope.  Does
> > >"large list" mean to you a thousand?  Hundred thousand?  Ten
> > >million?  How often are you sending out e-mail?
> 
> Our largest list at the moment is 4,000 addresses. The business we are
> in (local online newspaper) means we are very unlikely to ever have
> more than 10,000. The answer certainly relates to sendmail, but I'm
> interested in any experience other people may have with this kind of
> task. At the moment I'm looking at using smtplib and just cycling
> through calling smtp.send() once for every address but I'm not
> confident that that this is a particularly efficient method. If
> there's a better option I'd love to hear about it.

No, no!  As Cameron Laird said, this is more of Sendmail (MTA) issue
than Python.  You could loop for each address, but no self-respecting
Linux guy (much less a Slacker) would do that.  Standard way to send to
list of recipients is

    - edit /etc/aliases,
	abc: :include:/etc/list.abc

    - edit /etc/list.abc,
	user1 at xxx.com
	user2 at yyy.com
	viagra at microsoft.com
	jailbait at martha.com
	...

    - restart sendmail,
	newaliases

Then, send email to 'abc' account like other user account.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
Linux solution for data processing and document management.



More information about the Python-list mailing list