cmail icon indicating copy to clipboard operation
cmail copied to clipboard

LMTP support in cmail-smtpd

Open cbdevnet opened this issue 8 years ago • 0 comments

The LMTP protocol (RFC 2033) differs from ESMTP in only a few ways

  • Port used
  • EHLO command replaced with LHLO
  • One delivery response per recipient

Implementing this protocol would allow cooperation with a wide range of other software.

This could be done in cmail-smtpd by

  • Allowing the LHLO command in the state machine and setting the proper protocol in client_data->current_mail.protocol -> https://github.com/cmail-mta/cmail/blob/master/cmail-smtpd/smtpstatemachine.c#L5
  • Responding with one recipient state for each handled recipient (this might require modifications of core handling) -> https://github.com/cmail-mta/cmail/blob/master/cmail-smtpd/smtpstatemachine.c#L557 and call tree
  • Optionally, if allowing LMTP on all ports (as the current implementation handles SMTP/ESMTP) is not desirable
    • Extending the listener structure with a field indicating supported protocols -> https://github.com/cmail-mta/cmail/blob/master/cmail-smtpd/smtpd.h#L83
    • Extending the configuration parser to force a port to specific protocols -> https://github.com/cmail-mta/cmail/blob/master/cmail-smtpd/config.c#L33
    • Enforcing that choice in the state machine (by rejecting commands not allowed for the forced protocol) -> https://github.com/cmail-mta/cmail/blob/master/cmail-smtpd/smtpd.h#L97

cbdevnet avatar Sep 14 '17 16:09 cbdevnet