guileen / node-sendmail

send mail without setting up a SMTP server
http://guileen.github.com/node-sendmail
MIT License
560 stars 108 forks source link

TLS Certificates #80

Open markgrin opened 4 years ago

markgrin commented 4 years ago

Adding option to pass key and certificates to tls connection.

Description

Adding tls certificate solved this issue for me: https://github.com/guileen/node-sendmail/issues/76

Motivation and Context

https://github.com/guileen/node-sendmail/issues/76 - I had this problem

How Has This Been Tested?

Sent emails to gmail

Types of changes

Checklist:

CCAtAlvis commented 3 years ago

https://github.com/guileen/node-sendmail/blob/b76e5b26f967bb74f08a74281e8d0a7aaa8894ab/sendmail.js#L297-L303 Check these lines, a line is processed only if the code follows a <space> character

So if the server send 250-STARTTLS that won't be sent to response() and processed

Even I was trying to implement STARTTLS support but that would require quite some changes. Maybe we can pass another argument to the response() which would tell us whether its a \<space> or dash and process line depending on that.

CCAtAlvis commented 3 years ago

Or maybe create an array with all SMTP Service Extensions available with server? This can help further if someone wants to implement/handle some other extension. 🤔

markgrin commented 3 years ago

@CCAtAlvis , thank you for feedback. I tested this PR with google email account on gmail. It had no "unencrypted" tags on emails I sent, so I guess this is more or less a working solution. If you think you can improve this PR, you are welcome to. This looks like a dead repo (last updated in 2019). I think a greater issue is finding a new maintainer for this repo.

CCAtAlvis commented 3 years ago

@markgrin Ahh yes, I overlooked the code, works perfectly fine. I am rewriting the code base for my learning, might as well open source it!

Laurenz1606 commented 2 years ago

@markgrin would it be okay for you if I fork this repo, merge your PR and publish it to npm as something like sendmail-tls?