On 9/8/2015 2:14 PM, Homer Wilson Smith wrote: > > Dear Gentle Folk, > > I am using smtp-source to query whether machines are properly > up by > relaying mail through them to a buddy server that beeps me if 3 relays > in a row fail. > > When a target machine fails, the machine running smtp-source hangs > at the perl/shell call to smtp-source, causing all other machines to > look like they are down too. > > I ping each target machine first, and if it doesn't ping it > doesn't > get tested with smtp-source, so the smtp-source tests other failures > other than being totally down. > > How do I put a time out on smtp-source so it only tries for a few > seconds before giving up, hopefully with an appropriate failure code. > > Thanks in advance, > > Postfix rocks! > > Homer W. Smith > CEO Lightlink Internet >
Seems to me smtp-source isn't really the right tool for that job. Maybe try a command line SMTP tool such as mini_sendmail. http://acme.com/software/mini_sendmail/ and you could tcping the host to see if port 25 is open before performing the SMTP test. -- Noel Jones