Yes. There are two other options you can use. 1) Just check that the server 
answer on the port and not run the protocol (smtp) test or 2) use send/expect 
which allow you to send whatever you want to the server 
(http://mmonit.com/monit/documentation/monit.html#connection_testing) I.e.

    if failed host 192.168.1.100 port 25
       expect "^220.*\r\n"
       send "ELO localhost.localdomain\r\n"
       expect "^250.*\r\n"
       send "QUIT\r\n"
       expect "^221.*\r\n" 
    then alert


On Jan 5, 2012, at 5:46 PM, Christian Bianchi wrote:

> Yes, in the meantime i took a look at the soruces and understood it's
> hardcoded :/
> 
> thanks anyway for your response
> 
> Date: Thu, 5 Jan 2012 17:26:13 +0100From: Jan-Henrik Haukeland
> <[email protected]>To: This is the general mailing list for monit
>    <[email protected]>Subject: Re: Monitoring external SMTP
> serviceMessage-ID:
> <[email protected]>Content-Type:
> text/plain; charset=us-ascii
> Hmm, seems I misunderstood the problem. I didn't read the whole
> thread, and someone informed me that the problem was in the SMTP test,
> not in sending mail from Monit. In the SMTP test (if failed host
> 192.168.1.100 port 25 protocol smtp then..) localhost is in fact
> hardcoded in EHLO. So no luck.
> On Jan 5, 2012, at 5:08 PM, Jan-Henrik Haukeland wrote:
>>> On Jan 5, 2012, at 3:02 PM, Christian Bianchi wrote:>>> the host(s) are ok 
>>> (but i removed the unneded one).>> i made a scan with tcpdump and found 
>>> that monit puts "EHLO localhost">> and my smtp server responds with: 
>>> "Response: 551 sorry, your domain is>> not correct">> is there a way to 
>>> specify the domain instead of "localhost"?>> Yes, from the manual: 
>>> http://mmonit.com/monit/documentation/monit.html#setting_a_mail_server_for_alert_messages>>
>>>                Monit, by default, use the local host name in SMTP HELO/EHLO 
>>> and in the>               Message-ID header. Some mail servers check this 
>>> information against DNS for>               spam protection and can reject 
>>> the email if the DNS and the hostname used in>               the 
>>> transaction does not match. If this is the case, you can override the>      
>>>          default local host name by using the HOSTNAME option:>>            
>>>    set mailserver mail.tildeslash.com using hostname "myhost.example.org"
> -- 
> Christian Bianchi
> eNBilab srl.
> via Castellana 45/a int. 4, 33100 Udine
> www.enbilab.com
> tel +39 0432 906545


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to