Comment by direwolf20
16 hours ago
SMTP is a line–based protocol, including the part that transfers the message body
The server needs to parse the message headers, so it can't be an opaque blob. If the client uses IMAP, the server needs to fully parse the message. The only alternative is POP3, where the client downloads all messages as blobs and you can only read your email from one location, which made sense in the year 2000 but not now when everyone has several devices.
But everything after headers can (almost) be a blob. Just copy buffers while taking care to track CRLF and look if what follows is a space. In fact, you have to do it anyhow, because line-folding is allowed in headers as well! And this "chunking long lines" technique has been around since the 70s, when people started writing parsers on top of hand-crafted buffered I/O.
Hey, POP3 still makes sense. Having a local copy of your emails is useful.
If you want it to be the only copy and not sync with anything
POP3 is line–based too, anyway. Maybe you can rsync your maildir?
Any decade now and we'll be ready for JMAP.
I just read it mainly in one place and through the web interface when I have to.
3 replies →
Isn’t the only difference between pop and imap that pop removes the mail from the server? I only use imap, and all my email is available offline.
POP is a simple mail transfer protocol (hehe...). It supports three things: get number of mails, download mail by number, delete mail by number. This is what you need to move mails in bulk from one point to another. POP3 mail clients are local maildir clients that use POP3 to get new mail from the server. It's like SMTP if it were based on polling.
IMAP is an interactive protocol that is closer to the interaction between Gmail frontend and backend. It does many things. The client implements a local view of a central source of truth.
No, the difference is that IMAP doesn't store anything other than headers on the client (at least, not until the user tries to read a message), while POP3 eagerly downloads messages whenever they're available. A POP3 client can be configured with various remote retention policies, or even to never delete downloaded messages.
I don't have an IMAP account available to check, but AFAIK, you should not have locally the content of any message you've never read before. The whole point of IMAP is that it doesn't download messages, but instead acts like a window into the server.
1 reply →
Not at all. IMAP can do a lot of complex operations on the email while leaving it on the server, for example you can have the server search the email, flag it (mark it important, or read, or unread).
POP can download the email, and that's about it.
Depending on what you configured. It can also keep the mail on the server.
But it's more akin to consuming a message queue. You have fetched it, it's gone.
This is incorrect. POP3 does not require fetched messages to be deleted from the server.
Nothing stops you from locally archiving your email with IMAP.
How do you do that, by default? Can you tell an IMAP client to work like POP3 and download everything?
2 replies →