-
-
Notifications
You must be signed in to change notification settings - Fork 671
Check host against private IP range before sending mail #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -13,6 +13,7 @@ var constants = require('./constants'); | |||
var trans = require('./transaction'); | |||
var plugins = require('./plugins'); | |||
var date_to_str = require('./utils').date_to_str; | |||
var is_private_addr = require('./utils').is_private_addr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See net_utils.js - this function is already implemented there as net_utlis.is_rfc1918
@@ -667,6 +668,9 @@ HMailItem.prototype.try_deliver = function () { | |||
delivery_concurrency--; | |||
return self.try_deliver(); // try next MX | |||
} | |||
addresses = addresses.filter(function(host) { | |||
return !is_rfc1918(host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a bug here is that this check should only be done for addresses not returned by a get_mx hook. This allows get_mx to be used for testing, or for delivering to a local outbound relay host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. I'll refactor accordingly..
Any update on this? |
I'm thinking this PR should be closed. Parts of it are merged, most of the elements of the patch are no longer relevant, and what remains was never refactored. It can be resurrected as a new PR if/when @sstur revisits it. |
I won't be revisiting this since the project I was using this for is long over. Thanks. |
Added is_private_addr to ./utils.js and updated ./outbound.js to filter array returned by dns.resolve()