Search code examples
smtpimappop3mail-servermta

Who is responsible for storing emails to the filesystem IMAP or SMTP?


I was studying about MTA and came through SMTP & IMAP, and read that SMTP is responsible for delivering email across the servers, and client uses IMAP/POP3 to read the emails from server.

So IMAP/SMTP these are just protocot, Postfix is known as SMTP Server, and DoveCot is known as IMAP Server ( there are many more).

So which program (PostFix/DoveCot) is responsible for storing emails in file-system?


Solution

  • There is also a third protocol, LMTP, which is very very similar to SMTP but is slightly changed to better suit the hop from an SMTP server to the storage system. Dovecot implements LMTP as a server, so a message is quite likely written by Dovecot acting as either as an LMTP server or as an IMAP server.

    But it doesn't have to be. An SMTP server can store the mail in any way it wants to, including by forking procmail, and Dovecot (and many other servers) are capable of accessing email stored by procmail.

    This duality is because this happens on the boundaries of the internet. The IETF generally publishes standards for internet communication; how an SMTP server stores its mail locally is arguably off-limits for IETF standards.