haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.09k stars 661 forks source link

Skip SPF check for outbound mail when context is not 'myself' #1762

Closed gramakri closed 7 years ago

gramakri commented 7 years ago

The SPF plugin attaches SPF headers for outbound mail when context='sender'. For this, it uses connection.remote.ip. This is bound to fail when the remote IP is internal. In general, I am not aware why it is useful to attach SPF headers for outbound mail when context is not 'myself'.

gramakri commented 7 years ago

I am using Haraka for inbound and outbound with SPF plugin enabled. Haraka runs with a private IP. Haraka attaches SPF headers for outbound mails because it is evaluating with context='sender' for an internal IP.