Skip to content

Commit 749efdb

Browse files
committed
Skip SPF check for outbound mail when context is not 'myself'
Fixes haraka#1762
1 parent f6013b9 commit 749efdb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/spf.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ exports.hook_helo = exports.hook_ehlo = function (next, connection, helo) {
114114
exports.hook_mail = function (next, connection, params) {
115115
var plugin = this;
116116

117-
// For inbound message from a private IP, skip MAIL FROM check
118-
if (!connection.relaying && connection.remote.is_private) {
119-
return next();
117+
// For messages from private IP space...
118+
if (connection.remote.is_private) {
119+
if (!connection.relaying) return next();
120+
if (connection.relaying && plugin.cfg.relay.context !== 'myself') return next();
120121
}
121122

122123
var txn = connection.transaction;

0 commit comments

Comments
 (0)