Re: Sending many e-mails



On 09/28/07 11:50, Jerr wrote:
Uh, I just read a little about MailMan... It seems like its personalization is not what I am looking for. It has a very rough persoanlization, where you can substitute tokens with the user name / e-mail or something of that sort.

Ok, what you are wanting to do is a fair bit out side of the scope of normal mailing list management software. Most mailing list management software takes in a single message and distributes it to all subscribed users. No personalization means that the message is just sent to one address and blind carbon copied to all the other addresses. Full personalization means that the message is sent to each individual subscribed address one at a time by the mailing list management software.

I actually need to be able to send a completely different e-mail to a specific user at a very specific time, and there might be a lot of users who need to get a (different) e-mail at the same time.

Now it sounds like you will be needing some other sort of software that will generate the individual messages and send them out.

What do you really mean by "... at the same time."? If you want all the messages to go out at the same second, you will more than likely need to initiate multiple parallel SMTP transactions all at the same time. I think that it is very unlikely that this is really what you mean. I'm betting that you mean that when you say "Go" you want your software to start processing the messages with all of them eventually leaving your system over the next few minutes to hours depending on how many messages need to be sent.

That's what I am worried about - the load of the server if I spawned a process of sendmail for each mail sent, but I don't see any way to avoid that method when using sendmail.

If you try to send multiple email messages vis SMTP in parallel at the same time to very many recipients at the same time, you will load the server down no matter what. Be it memory, CPU, disk, or network bandwidth, you will run out of resources if the list is very large at all, say 50 - 100, or possibly even 25 concurrent SMTP connections. You will be far better off streaming the messages from your program that generates the individual messages in to Sendmail (or what ever else) and have it queue the messages and let its queue scheduling empty the queue for you.

You can even deliver messages to Sendmail in queued delivery mode. Thus telling Sendmail to queue the messages and let the queue runners deliver the messages out of the queue as it sees fit.

A program that could queue e-mails according to time to be sent and send them exactly at that time *efficiently*, without spawning a process of sendmail, is what I really need.

Ok, now you are talking about something that will pause delivery until a specified time with either pre-generated messages or messages generated at that point in time.

I still think you are going to run in to a resource problem on your system no matter what program you use to send the messages if you are trying to send more than a small number of messages at the same time. Sure you could write a program that would open multiple SMTP transactions in parallel and process one command in each before going to a subsequent command starting at the top of the list. I mean this can theoretically be done, but man, that is a lot of concurrent streams to keep track of and will use a fair bit of memory. If your list grows too big, you could very well end up with things timing out on you before you got back to the front of the line. There is also the fact that the streams would receive commands in a fairly linear order. Well I suppose you could write it so that all streams would send their commands at the same time, but you would be looking at a load burst on the system again.

Alternatively, I would settle for a way to send an e-mail immediately when it is asked to be sent, and I will do the time handling...

Sending a message to a single recipient on demand is not that difficult. I have written SMTP state engines in Perl and PHP with little trouble. I'm sure it would be trivial to implement one in just about any language that can initiate network connections.

Chew on this and let me know what you think.



Grant. . . .

.



Relevant Pages

  • MTU PPP
    ... I would like to set the MTU of my ppp0 above 1500. ... sendmail ... Smart relay host in sendmail ... # checkpoint queue runs after every N successful deliveries ...
    (RedHat)
  • Re: connection timeout variable name?
    ... force a limit to how long sendmail waits when processing ... long time trying to send messages on the outbound queue, ... because of waiting for this eventual timeout. ... I've not changed the DNS setup recently. ...
    (comp.mail.sendmail)
  • Re: best ways for mass mailing
    ... Mailing has two phases: queueing and delivering. ... MTA queue and tell it to deliver it later on the next queue run. ... call the sendmail program directly to do the same thing without TCP ...
    (comp.lang.php)
  • Re: Another Queue Question
    ... days with their Linux Sendmail server. ... The server is used for inbound email only and its directed to either ... The version of Sendmail is 3.0.6, this was a corporate image so I'm ... If queue is processed without porblems than start a few more ...
    (comp.mail.sendmail)