Comment by direwolf20

Comment by direwolf20 15 hours ago

20 replies

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.

Joker_vD 2 hours ago

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.

fluoridation 14 hours ago

Hey, POP3 still makes sense. Having a local copy of your emails is useful.

  • direwolf20 14 hours ago

    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?

    • fluoridation 13 hours ago

      I just read it mainly in one place and through the web interface when I have to.

      • dylan604 12 hours ago

        If your "in one place" reader is still open and downloading messages then there will be no messages to view in the web interface when you have to.

  • Jaxan 9 hours ago

    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.

    • direwolf20 7 hours ago

      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.

    • fluoridation 9 hours ago

      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.

      • mmooss 8 hours ago

        Also, IMAP syncs the other way. If you locally tag a message locally or move it to another folder, it also happens on the server.

    • ars 3 hours ago

      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.

    • gsich 5 hours ago

      Depending on what you configured. It can also keep the mail on the server.

  • ahoka 11 hours ago

    But it's more akin to consuming a message queue. You have fetched it, it's gone.

    • foresto 7 hours ago

      This is incorrect. POP3 does not require fetched messages to be deleted from the server.

  • encom 9 hours ago

    Nothing stops you from locally archiving your email with IMAP.

    • mmooss 8 hours ago

      How do you do that, by default? Can you tell an IMAP client to work like POP3 and download everything?