davemcgi has asked for the wisdom of the Perl Monks concerning the following question:

We are currently using sendmail on our only server (let's call it our "live server"), along with Apache, Perl and MySQL and POP.

In order to move the sendmail service and take all the load *out* of the current live server (some 15,000 messages are received and some 20,000 sent every day), how to configure our perl scripts on the live server to use another machine's sendmail services?

We know that it's possible to use the sendmail directive SMART_HOST to specify an external relay server, but in this case we have already seen that some maillog entries are anyway written on the live server, therefore we are forced to maintain a sendmail service on the live AND a sendmail service on the "mail server".

What's the advantage of it, if not simply avoiding only DNS lookups and sending retries? We are still forced to "transmit" a mail message "somewhere else" anyway... is there a way to be able to (essentially) being able to remove/disable the sendmail service from the live server completely using *only* an external mail server?

i.e. communicate the message to the remote server, have it accepted immediately into his mail queue, and let him worry about DNS resolving, whether the address actually exists, queuing retys etc ...

Replies are listed 'Best First'.
Re: sendmail dependency
by tirwhan (Abbot) on Feb 09, 2006 at 15:29 UTC

    This depends on how your scripts are delivering the messages to the local server. If you're connecting to it over TCP/IP and transmitting the message that way you shouldn't have a problem, just change the delivery host in your scripts/configuration to the external server (and make sure you've configured that server to only relay mails from your own machines!).

    If your scripts pass messages to the mail server on the command line this won't work, they will still require a local SMTP-capable mailer. This doesn't have to be a full-fledged sendmail installation though, you could write a script which receives mail on the command line and delivers it to the smarthost, or use one of the minimalistic sendmail replacements that exist (e.g. femail or mini-sendmail, search freshmeat for more).


    All dogma is stupid.
Re: sendmail dependency
by beachbum (Beadle) on Feb 09, 2006 at 18:12 UTC

    You can also leave sendmail running on your live server and specify that ALL mail gets relayed to the new server. (Maybe you described this already?) Coming from a hosting background with over 2 million messages per day, moving DNS lookups off to another box is a huge benefit.

    You may also consider running a DNS service on that box, and have sendmail use the localhost to do lookups. The DNS service will be able to cache entries based on the TTL, and prevent over-the-internet lookups for domains that you have already delivered to.