SMTP protocol basics from scratch in Go: receiving email from Gmail
One of my back burner projects was to write a mail forwarder which did not store messages. When someone opens an SMTP connection to it, it opens an SMTP connection to the destination and passes through the message, while holding the input connection open. When the message has been delivered, then the sender gets a completion status back. No need to return bounce messages. Any problem at any stage results in an immediate reject to the sender. You don't invisibly lose messages in transit.<p>Outbound ISP SMTP servers should work that way. This makes email behave much like instant messaging.<p>Messages with many recipients may need to take a store and forward path. They can be redirected to a slow bulk mail server.<p>Historically, mail servers are store and forward because the destination might be offline, or on some store and forward UUCP system or something. Today, that's very rare. We don't have to emulate Sendmail forever.