go-pkgz / email

Email library to send simple messages
https://go-pkgz.umputun.dev/email/
MIT License
21 stars 6 forks source link

add starttls support #9

Closed s0x90 closed 2 years ago

s0x90 commented 2 years ago

Support StartTLS #2

s0x90 commented 2 years ago

@umputun review pls

umputun commented 2 years ago

looks fine to me. have you tried to send with StartTLS for real?

s0x90 commented 2 years ago

I have tried with https://github.com/rnwood/smtp4dev and self signed cert (I had to set InsecureSkipVerify: true in tls config). Unfortunately Yandex rejects connections to non secure ports so I didn't test with production smtp server.

smtp4dev log bellow:

TLS mode: StartTls
Generated new self-signed certificate with subject name 'eb08f0b7164a and expiry date 04/20/2032 00:00:00
Ensure that the hostname you enter into clients and 'eb08f0b7164a' from ServerOptions:HostName configuration match exactly and trust the issuer certificate at /smtp4dev/selfsigned-certificate.cer in your client/OS to avoid certificate validation errors.
Hosting environment: Production
Message received. Client address 172.17.0.1, From me@example.com, To to@example.com, SecureConnection: True.
Processing received message DONE