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