[RFCI-Discuss] multi-MAIL commands appearing in the
same mail-transaction?
mouss
mouss at netoyen.net
Sun Aug 27 17:26:32 EDT 2006
Derek J. Balling wrote:
>
> On Jun 6, 2006, at 11:23 AM, Alex van den Bogaerdt wrote:
>> Interesting question. Should it go ahead and make a guess about what
>> the sending server ment, or should it refuse to talk to this server
>> until it implements protocols as designed...
>
> Well, 2821 says that sending a MAIL command "resets the state", so I
> would say that a second MAIL command arguably voids any prior MAIL
> command, and that the server should, as the spec says, reset the state
> and continue onward.
Well, 2821 also says:
The MAIL command (or the obsolete SEND, SOML, or SAML commands)
begins a mail transaction. Once started, a mail transaction consists
of a transaction beginning command, one or more RCPT commands, and a
DATA command, in that order. A mail transaction may be aborted by
the RSET (or a new EHLO) command. There may be zero or more
transactions in a session. MAIL (or SEND, SOML, or SAML) MUST NOT be
sent if a mail transaction is already open, i.e., it should be sent
only if no mail transaction had been started in the session, or it
the previous one successfully concluded with a successful DATA
command, or if the previous one was aborted with a RSET.
if "MAIL MUST NOT be sent...", then it is an error to do so, and the
server should return an error.
Unfortunately, the rfc doesn't say what code to return...
but just ignoring a previous MAIL command is risky. Imagine a bogus
client trying to do two transactions simultaneously (a thread
programming bug):
MAIL FROM: <sender1>
250 OK
MAIL FROM: <sender2>
250 OK
RCPT TO:<rcpt1>
250 OK
RCPT TO:<rcpt2>
250 OK
DATA
354 blah blah
...
.
250 OK
DATA
503 Error: need RCPT command
if you ignore the first MAIL command, then a message will be sent from
sender2 to rcpt1 and rcpt2, containing a message intended from sender2
to rcpt1
If an error is sent, chances are that the client will QUIT.
More information about the RFCI-Discuss
mailing list