Discussion:
Patch for smtpd.c - nicer message, if command wasn't the correct one
Denny Schierz
2012-05-12 12:03:11 UTC
Permalink
hi,

I've attached a patch for smtpd.c (lates source) for change the line:

"221 2.7.0 Error: I can break rules, too. Goodbye."

with:

"221 2.7.0 Error: Sorry, your input wasn't RFC5321 valid. Closing connection."

The background is, that in most cases only a tester sees this messaged and it is much more nicer, to say him or her, that the command wasn't the correct one (for example, wrong order). In most cases, it happens, if you just want to test, if everything works as expected, using telnet etc.

I hope, the patch is ok.
Wietse Venema
2012-05-12 13:28:42 UTC
Permalink
Post by Denny Schierz
hi,
"221 2.7.0 Error: I can break rules, too. Goodbye."
"221 2.7.0 Error: Sorry, your input wasn't RFC5321 valid. Closing connection."
The background is, that in most cases only a tester sees this
messaged and it is much more nicer, to say him or her, that the
command wasn't the correct one (for example, wrong order). In most
cases, it happens, if you just want to test, if everything works
as expected, using telnet etc.
I hope, the patch is ok.
This reply is not for humans. It targets ratware that that sends
forbidden commands such as CONNECT or POST, or that sends message
headers before Postfix has accepted a DATA command. People who
test SMTP by hand must know what is correct SMTP and what is not,
otherwise their test is invalid.

The reply itself violates the protocol in multiple ways. First, 221
is not a valid error response. Second, hanging up spontaneously
requires sending 421, not 221. Therefore the text of the reply must
not be changed.

Wietse
Denny Schierz
2012-05-12 16:20:34 UTC
Permalink
hi,
Post by Wietse Venema
This reply is not for humans. It targets ratware that that sends
first, thanks for the reply :-)

second, I don't understand, why the target of this message isn't a human. I would more expect only the error code, without any message, but not a message like this :-) I think, it doesn't hurt, if the message is more friendly to the admin, who works in the darkness ;-)

cu denny

ps. many thanks to you for Postfix. My one and only mailer since 2001.
Loading...