psarna / edgemail

MIT License
271 stars 18 forks source link

Sending emails? #3

Closed Lioncat2002 closed 1 year ago

Lioncat2002 commented 1 year ago

Hello! I read your article on medium. It's really awesome and in great detail. Especially when you consider that documentation of SMTP is a bit lacking. I have been trying to make something similar for quite a few months now. Following your article, I succeeded in making one which receives emails.

However I also want to add the feature of sending mails from my email server. It would be great if you can give some pointers that might help.

Again thanks a lot for writing that article!

psarna commented 1 year ago

Thanks, glad to be of help! Sending emails is tricky, because:

  1. Practically all ISPs block outbount traffic from SMTP ports in order to fight spambots -- you can verify that by running a server (e.g. edgemail) on some public machine on port 25, and then trying to contact the server directly. Usually it doesn't work, because sending to port 25 is often blocked by default unless you are a verified entity.
  2. Even if you manage to get a machine with outbound port 25 that actually works, all popular email providers have lots of whitelists and filters that block emails coming from unknown sources, which means that majority of people would never manage to receive an email sent from your server.

Since both 1 and 2 are hard to overcome, I absolutely ignored the sending part of the SMTP protocol, because it's really hard to even test, not to mention make work in production.

Lioncat2002 commented 1 year ago

Ahh I see That makes sense actually

Anyways Thank you so much for your time!