LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   sendmail smarthost (http://www.linuxquestions.org/questions/linux-networking-3/sendmail-smarthost-533390/)

klaxyn 02-28-2007 04:46 PM

sendmail smarthost
 
I have my web/mail server configured to route outbound mail through a smart host. My problem is if the smarthost is unavailable sendmail produces an error 'no route to host' and queues the mail for later delivery. It does not attempt to send the mail directly bypassing the smart host. My understanding is that by default sendmail would first try to send mail to the destination mail server and then try the smarthost if sending directly fails. What am I missing? My whole reason for having a 2nd smtp server is for redundancy, but this solves nothing.

Thanks!
klambert@earthmatrixhosting.net

gilead 02-28-2007 05:14 PM

I haven't seen that definition before. As far as I know, smart_host is for relaying all mail. The only exception to this I've seen is at http://www.sendmail.org/m4/README.txt, where they talk about sending directly to hosts found via a local DNS server (that can't resolve external hosts) and using the smart_host for other hosts:
Code:

If you are running a local DNS inside your domain which is
not otherwise connected to the outside world, you probably want to
use:

        define(`SMART_HOST', `smtp:fire.wall.com')
        LOCAL_NET_CONFIG
        R$* < @ $* . > $*        $#smtp $@ $2. $: $1 < @ $2. > $3

That is, send directly only to things you found in your DNS lookup;
anything else goes through SMART_HOST.


klaxyn 03-12-2007 07:17 PM

Quote:

Originally Posted by gilead
I haven't seen that definition before. As far as I know, smart_host is for relaying all mail. The only exception to this I've seen is at http://www.sendmail.org/m4/README.txt, where they talk about sending directly to hosts found via a local DNS server (that can't resolve external hosts) and using the smart_host for other hosts:
Code:

If you are running a local DNS inside your domain which is
not otherwise connected to the outside world, you probably want to
use:

        define(`SMART_HOST', `smtp:fire.wall.com')
        LOCAL_NET_CONFIG
        R$* < @ $* . > $*        $#smtp $@ $2. $: $1 < @ $2. > $3

That is, send directly only to things you found in your DNS lookup;
anything else goes through SMART_HOST.



But if the smarthost goes down everything else will fail to deliver. How do you handle a situation where a smarthost is configured but the smarthost is unavailable. Can it fall back to send out directly to the recipients mail server?

gilead 03-12-2007 10:00 PM

Quote:

Originally Posted by klaxyn
But if the smarthost goes down everything else will fail to deliver. How do you handle a situation where a smarthost is configured but the smarthost is unavailable. Can it fall back to send out directly to the recipients mail server?

There's not normally a need for a fallback, or to send directly. Sendmail will queue the mail and re-try periodically. The user should get a notification that contains something like "Warning, could not send message for past 4 hours" and if the mail is not delivered before the queue times out, they will get a failure message.

The timeout parameters are configurable. Have a look in your sendmail.cf file for options that start with Timeout. Uncomment and modify the ones you need. Here is the default list for sendmail 8.14:
Code:

#O Timeout.initial=5m
O Timeout.connect=1m
#O Timeout.aconnect=0s
#O Timeout.iconnect=5m
#O Timeout.helo=5m
#O Timeout.mail=10m
#O Timeout.rcpt=1h
#O Timeout.datainit=5m
#O Timeout.datablock=1h
#O Timeout.datafinal=1h
#O Timeout.rset=5m
#O Timeout.quit=2m
#O Timeout.misc=2m
#O Timeout.command=1h
O Timeout.ident=0
#O Timeout.fileopen=60s
#O Timeout.control=2m
O Timeout.queuereturn=5d
#O Timeout.queuereturn.normal=5d
#O Timeout.queuereturn.urgent=2d
#O Timeout.queuereturn.non-urgent=7d
#O Timeout.queuereturn.dsn=5d
O Timeout.queuewarn=4h
#O Timeout.queuewarn.normal=4h
#O Timeout.queuewarn.urgent=1h
#O Timeout.queuewarn.non-urgent=12h
#O Timeout.queuewarn.dsn=4h
#O Timeout.hoststatus=30m
#O Timeout.resolver.retrans=5s
#O Timeout.resolver.retrans.first=5s
#O Timeout.resolver.retrans.normal=5s
#O Timeout.resolver.retry=4
#O Timeout.resolver.retry.first=4
#O Timeout.resolver.retry.normal=4
#O Timeout.lhlo=2m
#O Timeout.auth=10m
#O Timeout.starttls=1h



All times are GMT -5. The time now is 07:47 PM.