go-gomail / gomail

The best way to send emails in Go.
MIT License
4.3k stars 570 forks source link

A hack but a bit dangerous solution to unencrypted connection #125

Open cgyim opened 5 years ago

cgyim commented 5 years ago

I use gomail to test my routine work, but also encounter the 'unencrypted' problem, so I check both the gomail and golang SMTP source code and found a hack solution. The SMTP.Auth has only one implementation, that is, the plainAuth, so I reimplement the interface as a new type 'FakeEncryptedAuth', but the start() method in new implementation does not check the server'TLS, so it bypasses the check(and the check panic if server'TLS is false, that's why panic when I want to send email via plaintext transport). And in new implementation, We can choose if we bypass the check my implementation : https://github.com/cgyim1992/gomail.

pedromorgan commented 5 years ago

see #104 and #108