LMTP: ENHANCEDSERVICECODES - RFC2034
Supporting ENHANCEDSERVICECODES (RFC2034) in the LMTP server would provide better diagnosis to clients when a message is rejected.
ENHANCEDSERVICECODES puts the enhanced status fo RFC 1893 at the front of the text in reply messages with status code 2xx, 4xx and 5xx. (Not 3xx, and not any greeting or LHLO response).
This can be easily phased in - although all responses must contain the enhanced service code when ENHANCEDSERVICECODES is supported, they can initially be sent as x.0.0 (where x is the 1st digit of the basic status code), and the detail added as time is available/folks are in the code that raises the errors.
There are about 80 codes enumerated in the registry (https://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml), which provide a lot more detail for debugging rejected mail than the basic status codes.
The 553
line below is a (trivial) SMTP example of an enhanced status code in a response:
220 castaway.example.net ESMTP Sendmail 8.13.7/8.13.7; Thu, 29 Jun 2017 21:18:11 -0400
ehlo foo
250-castaway.example.net Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
MAIL FROM:<foo@@nil>
553 5.1.3 <foo@@nil>... Invalid route address