News for hackers. Stuff that matters.
Re:SMTP protocol basics from scratch in Go: receiving email ... by Animats on Sunday April 10, 2022 @03:21AM (#30975076)
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.

Outbound ISP SMTP servers should work that way. This makes email behave much like instant messaging.

Messages with many recipients may need to take a store and forward path. They can be redirected to a slow bulk mail server.

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.

Re:SMTP protocol basics from scratch in Go: receiving email ... by Jaruzel on Sunday April 10, 2022 @04:38AM (#30975367)
> One of my back burner projects was to write a mail forwarder which did not store messages.

I wrote one of these years ago, as a front-end to my Exchange server. At the time Exchange had this thing where it ALWAYS accepted messages as long as the domain part was an accepted domain, and then it would do a fuzzy match on the mailbox names and dump the mail anywhere it felt matched.

So I had to have this SMTP front-end forwarder to weed out mis-addressed mail... which I eventually added SpamAssassin to as well. It ran for over 10 years without issue.

What I never solved/wrote was the TLS stuff, as it always seemed to complicated to code from scratch.

Re:SMTP protocol basics from scratch in Go: receiving email ... by Animats on Sunday April 10, 2022 @07:27AM (#30976151)
Right, that's the sort of thing I had in mind. Web site has addresses such as "[email protected]", and they forward to some mail server that actually knows if "employeename" is valid. Bogus names result in a status code, not an outgoing bounce message.
Re:SMTP protocol basics from scratch in Go: receiving email ... by stevekemp on Sunday April 10, 2022 @10:17AM (#30977091)
I used a proxy like this for a few years, though in my case it was to handle spam. I based my work on this extensible / plugin-based perl daemon:

http://smtpd.github.io/qpsmtpd/

I'd reject spam at SMTP time, but also capture the rejected messages, so that users could view them in an online quarantine. Worked pretty well, though I think these days the original perl-based project has been reworked into a nodejs thing:

https://haraka.github.io/about/

Re:SMTP protocol basics from scratch in Go: receiving email ... by Geezus-42 on Sunday April 10, 2022 @08:34AM (#30976452)
Without traditional NDRs, how do you tell which sever had a problem accepting the mail?
Re:SMTP protocol basics from scratch in Go: receiving email ... by cm2187 on Sunday April 10, 2022 @04:20AM (#30975305)
How is that different from some sort of load balancer/reverse proxy?