Hi Wietse, Thanks for your reply:
>> I am not sure whether this is specified in an RFC, but I understand >> that for every part of the remote MTA's response which starts with >> "544-" there should be a new line in the message to the sender. > > Error reports are standardized in 346[1-4]. I invite you to point > out the requirement that ASCII art shall be preserved. I understand that the requirements for the section of the error message I am concerned with is the "Diagnostic code field": http://tools.ietf.org/html/rfc3464#section-2.3.6 = = = = . . . diagnostic-code-field = "Diagnostic-Code" ":" diagnostic-type ";" *text . . . Since the Status code will sometimes be less precise than the actual transport diagnostic code, the Diagnostic-Code field is provided to retain the latter information. Such information may be useful in a trouble ticket sent to the administrator of the Reporting MTA, or when tunneling foreign non-delivery reports through DSNs. . . . In addition to the Diagnostic-Code itself, additional textual description of the diagnostic, MAY appear in a comment enclosed in parentheses. This field is optional, because some mail systems supply no additional information beyond that which is returned in the 'action' and 'status' fields. However, this field SHOULD be included if transport-specific diagnostic information is available. = = = = = My understanding is that the MTA returns multiple lines, each starting with the required diagnostic code. Neither qmail or Postfix follows the RFC in terms of using brackets to enclose any text following the diagnostic code. Including such text is optional anyway (MAY). I agree there is no requirement about preserving formatting. It seems there is no requirement to handle multiple diagnostic codes following a CR/LF. It is reasonable to assume that these diagnostic codes and any text which follows them is the MTA supplying information which is intended to help a human. I find qmail's approach of not altering the formatting of the MTA's output to be more helpful than Postfix's approach of arbitrarily reformatting this text, by ignoring newlines, by adding newlines according to an 80 column wrapping limit and by inserting four blank spaces at the start of every such reformatted line. What benefits could there be to Postfix's reformatting of the diagnostic information? - Robin