guileen / node-sendmail

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

sort mx records by priority (lowest first) #57

Closed seasick closed 5 years ago

seasick commented 5 years ago

Taken from https://en.wikipedia.org/wiki/MX_record#Priority

Mail is delivered to the mail exchange server with the lowest preference number (highest priority), so the MX record you use for mail routing should have the lowest preference number, typically 0.

Description

Currently the mail is sent by using the MX record with the highest priority. This PR changes it to use the record with the lowest priority first.

Types of changes

Checklist:

GreenPioneer commented 5 years ago

@seasick thank you for the pr - anything else you see that needs work?

I will push within the next couple of days

seasick commented 5 years ago

@GreenPioneer, you are welcome. Noticed it, though it is an easy fix. Even without that fix, it works like a charm :)

luisesn commented 5 years ago

No news from this?

benbucksch commented 5 years ago

9 months ago:

I will push within the next couple of days

@GreenPioneer : This PR is really important. As-is, you will always send to the wrong SMTP server, if there are backup fallback servers.

GreenPioneer commented 5 years ago

@seasick thanks again and my bad on it taking so dang long to get it in

I don't know how I wasn't notified by @luisesn message but I was with @benbucksch message

Will be publishing to NPM momentarily

GreenPioneer commented 5 years ago

https://www.npmjs.com/package/sendmail/v/1.5.0

benbucksch commented 5 years ago

@GreenPioneer : Thanks!

luisesn commented 5 years ago

Thanks!