This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Address = require('address-rfc2821').Address; | |
exports.hook_rcpt = function (next, conn, rcpt) { | |
const txn = conn.transaction; | |
const cfg = this.config.get('forwarder.ini'); | |
conn.loginfo(this, JSON.stringify(cfg)); | |
if (rcpt && rcpt[0] && rcpt[0].host) { | |
var domain = rcpt[0].host.toLowerCase(); | |
if (cfg.main[domain]) { | |
conn.loginfo(this, 'Found domain ' + domain + ' forwarding to ' + cfg.main[domain]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.hook_rcpt = function (next, connection) { | |
var txn = connection.transaction; | |
if (txn.rcpt_to.length > 1) { | |
return next(DENY, 'Multiple recipients not allowed'); | |
} | |
return next(); | |
} |
OlderNewer