Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add LMTP support #196

Closed
Elemecca opened this issue Nov 23, 2019 · 3 comments
Closed

add LMTP support #196

Elemecca opened this issue Nov 23, 2019 · 3 comments

Comments

@Elemecca
Copy link

LMTP support in the server would be useful for people implementing any kind of mail-handling service that sits behind a standard MTA. LMTP (RFC 2033) is a protocol derived from ESMTP used in local mail delivery applications (e.g. from an MTA like Postfix to a mailbox server like Dovecot). There are only a few differences from ESMTP, so it shouldn't be too difficult to implement within the existing framework.

First, to ensure everyone agrees which protocol they're speaking, LMTP disallows the HELO and EHLO commands and replaces them with LHLO, which has the same semantics as EHLO. I think this could be done by just factoring out the implementation of EHLO and adding some configuration-based guards/conditions to the handle_request matches for HELO, EHLO, and LHLO.

Second, while an (E)SMTP server returns a single reply after the final . of the DATA command, an LMTP server returns one reply per recipient address. This is the real point of LMTP: it makes it possible to make a mail delivery server which does not implement a durable queue and full DSN semantics. Since gen_smtp is responsible for generating the protocol response to the completed DATA command this would require changes, but perhaps just to use a list in the result tuple when in LMTP mode.

Implementing LMTP in the client would have similar requirements: send LHLO instead of EHLO and handle the multiple responses to DATA and pass them back to the caller. I don't think LMTP client support is as useful as LMTP server support since people are more likely to be implementing some sort of mail-handler that sits behind an MTA than they are to want to write a proper queuing MTA that delivers to LMTP services, but it wouldn't hurt anything either.

I'm not very confident in Erlang (I'm using gen_smtp from Elixir), but I may take a crack at adding LMTP support to the server once I get to that point in my project. If someone else wants to implement it please go ahead.

@Shemeikka
Copy link
Contributor

Hi,

I'm interested in LMTP client support. Use case is to receive emails over proprietary protocol and save them to Dovecot using LMTP.

Are maintainers interested in this?

What changes are required to implement LMTP client support? It seems that it could be simple to implement just like @Elemecca wrote. At least Python does it in a pretty simple way

@abravalheri
Copy link
Contributor

Hi guys, I gave it a try on #255, but I am not very experienced with the protocol. So if you are willing to have a look, any feedback would be appreciated.

@seriyps
Copy link
Collaborator

seriyps commented Apr 22, 2021

So, this is solved by #255.

@seriyps seriyps closed this as completed Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants