logoalt Hacker News

direwolf20yesterday at 12:06 PM2 repliesview on HN

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.


Replies

Joker_vDtoday at 1:05 AM

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.

fluoridationyesterday at 1:26 PM

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

show 4 replies