Sendmail Bcc

Is there any practical or policy limit on the number of addresses that can be included in a Bcc: header in a call to sendmail?

I have a mailing list of ~1300 addresses in a MySQL database that I want to e-mail from a PHP script. I have figured out how to invoke sendmail from the script.

I don’t want to loop 1300 times through the call to sendmail, because the PHP interpreter could time out. It seems like a logical notion to put all the addresses in the Bcc header.

Will this work? Is it a problem for any reason?

–David B.

As far as I know there’s no limit. I asked Will and he didn’t think so either.

You definitely, definitely want to BCC as opposed to loop through with sendmail. It’ll save us headaches and you headaches!

I’m pretty sure our announcement list system just globs all the addresses in BCC.


Actually, I think our announcement system sends to each address individually (not very efficient at all).

If it were smarter, it would do direct SMTP delivery and batch messages by the receiving host address (sort of the way Mailman does). Not sure about with PHP, but with Perl there are pretty definitely some smarter ways to do this.

Calling sendmail with Bcc should work OK. Of course, some people ignore messages not sent to them directly, which is one reason you might want to put the recipient’s address in the message itself.

Note that (while it is probably technically possible) you should not do direct SMTP transactions from our servers - this bypasses our logs, and will also probably have the effect of pissing me off :> (and / or blocking outgoing traffic on port 25).

With quite small mailing lists, I’ve got away with just piping batched emails to the mta. However, recently on my test server here I’ve been playing around with Mail::Bulkmail. It looks like a really neat module, but I’m not sure as to what results I get with it so far.

  • wil

Thanks for the guidance!

I will try it with Bcc (in a few weeks) and report the results here.

–David B.