[thelist] Perl: when to close sendmail

Katherine Spice k.spice at acu.ac.uk
Tue Aug 14 05:11:22 CDT 2001


Hi Tony,

>         open MAIL, "|/usr/lib/sendmail -t -i"

If you add the flag -odq it will insert the message into the queue rather than attempt to deliver it immediately. This is important when you are sending lots of msgs as it will either:

a) stop the machine being swamped with "sending" processes or
b) stop your program waiting for each mail to be sent before sending the next one,

depending on whether you spawn a new process for each message, or just open one, and send all mail through it. You probably don't want this for testing, but you can include it, and then flush the
sendmail queue with /usr/lib/sendmail -q from the command line.

With regards to which is better - it depends on your machine, your sendmail config, and the ulimit (# process, memory consumption etc) of the user you're running the script as.

HTH,
Katherine




More information about the thelist mailing list