[hobbit] custom smtp test

Henrik Stoerner henrik at hswn.dk
Mon Sep 12 22:53:25 CEST 2005


On Mon, Sep 12, 2005 at 04:13:24PM -0400, Matti Klock wrote:
> I'd like to test sending a message to a null address via SMTP. I tried
> to do by adding the following test to bb-services and bb-hosts:
> 
> [send]
>   send "ehlo\r\nmail from: <hobbit at foo.com>\r\nrcpt to:
> <null at bar.com>\r\ndata\r\n.\r\nquit\r\n"
>   expect "250 Accepted message"
>   options banner
>   port 25
> 
> Lo, a send column appeared. It's acting funny, though. The messages are
> definitely getting sent, but the status stays yellow, and the only
> output it captures is "220 bar.com ESMTP".
> 
> Is this a silly way to do such a test? Does Hobbit time out too rapidly
> to see the rest of the output?

When Hobbit sees that the connection is established to the smtp port,
it sends all of the data listed in the "send" section. Then it waits for
any data to be returned.

Since the smtp server at the other end speaks proper SMTP protocol,
it will send the traditional "220" greeting first. This is what Hobbit
picks up, and compares with the "expect" string. It doesn't matter that
there might be a "250 Accepted" further into the data - Hobbit might not
pick up that data at all, since it just grabs the first packet of data
sent by the server.

> I looked through the code for bbtest-net,
> but I'm not good enough at select loops to figure out what it's doing.

:-) It is slightly complex, I agree.

It would be nice if Hobbit could engage in real protocol with different
types of services, but that would require some major re-working of the
network test code. It's possible, but definitely not at the top of my
to-do list.


Regards,
Henrik




More information about the Xymon mailing list