Skip to content

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

Closed
wants to merge 8 commits into from

Conversation

sstur
Copy link

@sstur sstur commented Jan 23, 2012

Added is_private_addr to ./utils.js and updated ./outbound.js to filter array returned by dns.resolve()

@@ -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;
Copy link
Collaborator

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);
Copy link
Collaborator

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.

Copy link
Author

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..

@baudehlo
Copy link
Collaborator

Any update on this?

@baudehlo baudehlo mentioned this pull request May 12, 2014
@msimerson
Copy link
Member

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.

@msimerson msimerson closed this Oct 28, 2014
@sstur
Copy link
Author

sstur commented Oct 28, 2014

I won't be revisiting this since the project I was using this for is long over. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants