mjl- / mox

modern full-featured open source secure mail server for low-maintenance self-hosted email
https://www.xmox.nl
MIT License
3.38k stars 89 forks source link

Implement NOTIFY parameter of the ESMTP RCPT command #100

Open Fell opened 7 months ago

Fell commented 7 months ago

As far as I can tell, the NOTIFY parameter is ignored by Mox. If I enable Options → Delivery Status Notification in Thunderbird, it should send the message with NOTIFY=SUCCESS which should cause the SMTP server to send a Delivery Status Notification (DSN) even if the message was successfully delivered.

As Mox is still in development, this can be helpful making sure a message was actually delivered.

Relevant RFCs: https://datatracker.ietf.org/doc/html/rfc3461 https://datatracker.ietf.org/doc/html/rfc3464

mjl- commented 7 months ago

Hi Fell, thanks for the report.

Indeed mox does not implement the SMTP DSN extension. That means Thunderbird will not use the NOTIFY=SUCCESS parameter and you indeed will not receive a "success" DSN.

I didn't implement it yet because it requires careful thought to prevent backscatter form junk messages that would use this feature (although we could implement it only for submission at first). I skimmed through the RFC again, and it seems the NOTIFY will be dropped if the next SMTP server doesn't implement DSN. So there seems to be no guarantee that you will receive success DSNs from remote servers. For messages delivered by mox you could check the queue (if you are the operator). Mox already sends delayed/failure DSNs (but only after a while).

I do have other plans to give insight into outgoing mail: A special mailbox, perhaps called "Queue", where messages from the queue are visible (over IMAP, webmail, etc). The message would be removed (or moved to Sent) when the message is delivered to the next mail server (may not be final destination of course). But like the DSN extension, this isn't implemented yet, so doesn't help you at the moment...

I think a good first step would be implementing the DSN extension only for outgoing messages over authenticated smtp/submission, not for incoming messages on port 25. I'm planning to do some SMTP work in about a month, I've added this to that list. Or if you're interested in working on this, I can provide some hints.

Fell commented 7 months ago

Thank you for taking the time to consider my request. I only use this feature very occasionally when I want to be very sure an email was delivered. Sometimes, I do it to have some confirmation for legal reasons, like when lodging a complaint that must be dealt with within a certain time limit.

I reported it mostly for completeness sake, I'm sure there are more important issues. For me personally, it would certainly be sufficient to only implement it for authenticated users.

Working on it could be an interesting project, but I don't have much time at the moment. This could change next year, though.