Browse files

Support delivering to an IP (assuming it came from get_mx)

  • Loading branch information...
1 parent dd94b3a commit ef9a2335dd8e4be2a1caee7704a3c13066c4d717 @baudehlo committed Apr 24, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −1 config/loglevel
  2. +1 −1 config/smtp.ini
  3. +6 −0 outbound.js
View
2 config/loglevel
@@ -1 +1 @@
-LOGDEBUG
+LOGPROTOCOL
View
2 config/smtp.ini
@@ -1,5 +1,5 @@
; port to listen on
-port=25
+port=2525
; address to listen on (default: all addresses)
;listen_host=0.0.0.0
View
6 outbound.js
@@ -2,6 +2,7 @@
var fs = require('fs');
var path = require('path');
var dns = require('dns');
+var net = require('net');
var util = require("util");
var events = require("events");
var utils = require('./utils');
@@ -680,6 +681,11 @@ HMailItem.prototype.try_deliver = function () {
this.loginfo("Looking up A records for: " + host);
+ if (net.isIP(host)) {
+ self.hostlist = [ host ];
+ return self.try_deliver_host(mx);
+ }
+
// now we have a host, we have to lookup the addresses for that host
// and try each one in order they appear
dns.resolve(host, function (err, addresses) {

0 comments on commit ef9a233

Please sign in to comment.