Bookmarks

LMTP — Local Mail Transfer Protocol

A variant of SMTP for the last step of delivery: the mail server hands a message to the mailbox store and gets a separate reply for each recipient.

Also: LMTP, local mail delivery protocol

checked 9 Nov

All terms

LMTP is a variant of SMTP for the final step: handing a message from the MTA to the program that places it in mailboxes, for example from Postfix to Dovecot. The MTA handles queuing and retries; the receiving side only reports what happened for each recipient.

How it differs from SMTP

The commands are the same, with two differences. Instead of EHLO, the client says LHLO, so an SMTP client cannot be connected to an LMTP server by mistake. And after the end of the data, the server replies separately for each recipient accepted with RCPT TO.

FeatureSMTPLMTP
greetingEHLOLHLO
reply after the dataone for the whole messageone per recipient
queue on the receiving siderequirednot required
where it runsbetween servers over the networkinside a server, usually over a socket

This matters when a message has several recipients: one mailbox accepts it, another is full. SMTP could give only one reply, and the receiving side would have to keep its own queue. With LMTP, the first recipient gets 250 and the second a temporary 4xx rejection, and the MTA retries delivery to the second only.

Postfix and Dovecot

Dovecot listens for LMTP on a socket inside Postfix’s queue directory, and Postfix passes it messages for virtual mailboxes.

inimain.cf: delivery to Dovecot over a socket
virtual_transport = lmtp:unix:private/dovecot-lmtp

The protocol is described in RFC 2033 (1996, by J. Myers), an informational document.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

In depth in the references

where the topic is covered in detail