5.6 More Notes on Mass Mailing

When using a message injector, this procedure can carefully track the success and failure of each message being sent, and can regenerate a given message if a catastrophe occurs. In this case, and probably only in this case, it wouldn't be unreasonable to turn the SuperSafe option off, so fsync()s won't occur and I/O would be sped up considerably. If SuperSafe is set to False, one must be able to detect and be willing to reconstruct incomplete message deliveries at the time of a server crash; in most cases, then, it's easier to keep SuperSafe on or set to interactive. This is especially true if the relay server runs 8.12 in interactive delivery mode, where most of those writes won't occur anyway.

It's obvious that several injector processes running on an email server and passing their email to sendmail via a pipe can operate at the same time, using a format such as injector filename | sendmail -t. It should also be apparent that if several sendmail processes are invoked from the command line, they don't all have to use the same queue:

 injector filename1 | sendmail -t -oi -oQ/var/spool/mqueue-a  injector filename2 | sendmail -t -oi -oQ/var/spool/mqueue-b  injector filename3 | sendmail -t -oi -oQ/var/spool/mqueue-c 

These queues can be different directories on the same disk, or they may reside on different filesystems on their own disks. One should attempt to increase parallelism and reduce contention in shared file areas wherever possible on email servers. Many creative ways exist to achieve this goal, and these solutions are worth seeking out. However, it would be impossible to state generally what the optimal parameters are without a detailed understanding of a specific situation. A potential fix must be tried and iterated to realize as much parallelism as possible from multiple processes without thrashing the disk.

In the injector command line, the -oi flag tells sendmail that a "." on a line by itself in the message does not constitute an end of transmission. Instead, that line is "dot stuffed" to make sure it isn't interpreted that way. Of course, this occurrence is unlikely, but it can't hurt to be careful. Also, this example assumes sendmail 8.12 syntax. On earlier versions, it was appropriate to add the -U flag to the command line to indicate that this message was an initial submission. However, no other email program that I'm aware of actually did so.

The -t flag tells sendmail to get its recipient list from the To: line in the message header. By default, the message will be sent as the user that invokes the sendmail process. This choice can be overridden on the command line by using the -f user@example.com syntax.

One final thing to remember: When sendmail is invoked from the command line in this way, any errors it encounters will be printed to STDERR. This outcome can be altered by using the -oex command-line flags, where x is the ErrorMode. One especially useful variation under these circumstances is the -oem option, which generates an email message to return the error to the sender. All allowed values for these options are well documented in Section 5.6 of the Sendmail Installation and Operation Guide included with the version 8.12 distribution.



sendmail Performance Tuning
sendmail Performance Tuning
ISBN: 0321115708
EAN: 2147483647
Year: 2005
Pages: 67

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net