On 7 July 2017 at 12:18, David Hofstee <opentext.dhofs...@gmail.com> wrote:
> PowerMTA:
> 550 5.2.1 The email account that you tried to reach is disabled. Learn more
> at https://support.google.com/mail/?p=DisabledUser abc.def - gsmtp
>
> Momentum logfile, single line:
> 550-5.1.1 The email account that you tried to reach does not exist. Please
> try\r\n550-5.1.1 double-checking the recipient's email address for typos
> or\r\n550-5.1.1 unnecessary spaces. Learn more at\r\n550 5.1.1
> https://support.google.com/mail/?p=NoSuchUser abc.def - gsmtp
>
> Momentum JSON entry (mind you: A '\r\n' is a real newline in JSON. See
> http://json.org ):
> "452-4.2.2 The email account that you tried to reach is over quota. Please
> direct\r\n452-4.2.2 the recipient to\r\n452 4.2.2
> https://support.google.com/mail/?p=OverQuotaTemp abc.def - gsmtp"
>
> I hate this inconsistency before the weekend ;-).

To know if they are escaping special chars or simply replacing \r\n
you could have them log a message that already include a "\" char or
the literal "\r\n" sequence in their error message.
You can't start a restful weekend without answering this, first ;-)

In our MTA I ended up doing a simple replace of CRLF with the literal
"\r\n" because I don't like logs to span to multiple lines: we don't
do a proper escaping of "non-printable ascii characters" that would
probably be the best thing to do. I would also evaluate replacing the
"\r\nXXX[- ](Y.Y.Y)?" sequence to "\r\n" before escaping as it doesn't
help repeating the status code (end the optional status notification)
for each line. Does it worth it? It didn't in my case.

IMHO "multilines" are not mandated by the RFC as the message could
easily be in a single 998 char line (512 for rfc821), so if they
decided to use multiline is because the message itself was intended to
be multiline, so I wouldn't remove the CRLF.

Stefano

> On 7 July 2017 at 12:00, Michelle Sullivan <miche...@sorbs.net> wrote:
>>
>> David Hofstee wrote:
>>>
>>> Hi,
>>>
>>> I've an interesting RFC question. In an SMTP reply, one can have single
>>> line or multiline replies. E.g.
>>>
>>> 521 single line reply
>>>
>>> or
>>>
>>> 521-Line one
>>> 521-Line two
>>> 521 Line three
>>
>>
>> Correct.
>>>
>>>
>>> See also https://tools.ietf.org/html/rfc821#page-50 .
>>>
>>> My question is: The reply is an answer that is, necessarily, formatted
>>> for SMTP. But how should the multiline answer be interpreted? What is its
>>> 'value'.
>>>
>>
>> The 'value' to the computer is '521'
>>
>> If there is an extended code it should be on the first line.
>>
>> The rest is just the verbose message for the non computer... so should not
>> be tampered with.. ie
>>>
>>>
>>> /or option 5: Keep everything. Eg. /
>>> 521-Line one
>>> 521-Line two
>>> 521 Line three
>>>
>>> The RFC does not really state that. So I am not quite sure how that
>>> should be logged correctly. Where the formatting starts and what 'value' it
>>> is supposed to represent. When I look at other standards (e.g.
>>> http://json.org), the formatting and what it is to represent, is more clear.
>>
>>
>> Now if you're talking about what goes to syslog... undefined, however I've
>> seen the message get sent in full as in '521-Line one\n521-Line two\n521
>> Line three' (quite literally quoting the \n your option 4, except \n instead
>> of \r\n)... I've also seen the code stripped version, ie '521 Line one Line
>> two Line three' sorta like your option 1, but the end of line terminator is
>> replaced with a white space as '521- Line two' i believe (IIRC) is not
>> valid.
>>
>>>
>>> This came up when I saw 3 different outputs in different MTA's (1,4 and
>>> 5). Not sure if I have to file a bugreport to my favorite MTA supplier.
>>
>>
>> When you say you have seen the different outputs what are you referring
>> to?  Syslog'ing of the error message?
>>
>>>
>>> Can anyone say something smart about how the reply should be seen?
>>>
>>
>> Personally - and this is a personal thing - I would like to see any bounce
>> message with entire message as seen (ie unaltered) and I would like to see
>> syslog'd messages as one of 2 types...  either each line logged separately
>> in order or converted to: "521 Line one Line two Line three" before logging.
>>
>> Regards,
>>
>>
>> --
>> Michelle Sullivan
>> http://www.mhix.org/
>>
>
>
>
> --
> --
> My opinion is mine.
>
>
>
> --
> --
> My opinion is mine.
>
> _______________________________________________
> mailop mailing list
> mailop@mailop.org
> https://chilli.nosignal.org/cgi-bin/mailman/listinfo/mailop
>

_______________________________________________
mailop mailing list
mailop@mailop.org
https://chilli.nosignal.org/cgi-bin/mailman/listinfo/mailop

Reply via email to