[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: monit/protocols smtp.c
From: |
Martin Pala |
Subject: |
Re: monit/protocols smtp.c |
Date: |
Mon, 26 Sep 2005 21:15:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.11) Gecko/20050914 Debian/1.7.11-1 |
Yes, it is defined by RFC2821 (4.2.1):
--8<--
The format for multiline replies requires that every line, except the
last, begin with the reply code, followed immediately by a hyphen,
"-" (also known as minus), followed by text. The last line will
begin with the reply code, followed immediately by <SP>, optionally
some text, and <CRLF>. As noted above, servers SHOULD send the <SP>
if subsequent text is not sent, but clients MUST be prepared for it
to be omitted.
For example:
123-First line
123-Second line
123-234 text beginning with numbers
123 The last line
In many cases the SMTP client then simply needs to search for a line
beginning with the reply code followed by <SP> or <CRLF> and ignore
all preceding lines. In a few cases, there is important data for the
client in the reply "text". The client will be able to identify
these cases from the current context.
--8<--
This way it is also implemented, for example multiline greeting postfix
extension:
http://postfix.wl0.org/en/smtpd-multiline-banner/
The loop condition based on socket_readln() == NULL works as well,
however it freezes the testing for 5s each cycle (default socket timeout
on read)
Martin
Jan-Henrik Haukeland wrote:
Just a control question. Will separator always be '-' isn't it possible
for the admin to configure a banner with other chars? If uncertain it
may be better to check for status code 220 only and use that as the
loop condition when reading possible banners? Anything the server sends
first with status code 220, before we send anything, can be ignored.
I'm not sure, just asking :)
On 26. sep. 2005, at 17.55, Martin Pala wrote:
CVSROOT: /cvsroot/monit
Module name: monit
Branch:
Changes by: Martin Pala <address@hidden> 05/09/26
15:55:06
Modified files:
protocols : smtp.c
Log message:
improve the smtp multiline greeting support
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/monit/monit/protocols/
smtp.c.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev
--
Jan-Henrik Haukeland
Mobil +47 97141255
_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev