I have a problem with the sendmail DNS timeout period when trying to sent to a email address which has a DNS issue.
Let's say the problematic email address is firstname.lastname@example.org (not real one)
I can see there is a DNS issue with this domain using:
>host -t mx problemdomain.com ;; connection timed out; no servers could be reached
I can test and time the sendmail call to the problematic email address using:
> time echo "This is a test message" | /usr/lib/sendmail -email@example.com firstname.lastname@example.org real 2m36.252s user 0m0.004s sys 0m0.005s
Currently, it takes 2m36s for sendmail to timeout! This causes our PHP webpages that try to send to this email address to hang and eventually return an error to the browser.
My question is... How do I reduce this timeout?
I have seen a few sendmail related timeout configurations:
> grep resolver /etc/mail/sendmail.cf Timeout.resolver.retrans=5s Timeout.resolver.retry=4
Sendmail seems to be set to retry 4 times, with a 5s delay each re-transmission.
But I haven't found the actual DNS timeout period?
For reference: This is occurring on Red Hat Enterprise Linux Server release 5.2, sendmail 8.13.8, Linux Kernel: 2.6.18, Apache version: 2.2.3, PHP version: 5.3.0. Note: This question is a follow up from http://serverfault.com/questions/92545/sendmail-delays-on-some-email-addresses