On 15 Oct 2016, at 14:50, Petr Bena wrote:
I was looking to accomplish something similar, but seems that SA can't do that and there are probably no open source plugins or postfix hooks that allow this (so far).
This class of problem is one reason to pick MIMEDefang as your tool for integrating Postfix and SpamAssassin. Like Amavis, it loads the SpamAssassin modules itself rather than using a spamc/spamd interaction but unlike Amavis its main config file is a Perl script with implementations of a filter_* subroutine for each milter phase that it is enabled to use. If you want to write code in the filter() implementation that parses the message to find the From header and use it and the client IP in Mail::SPF::* calls, you are free to do so. Probably about 15 lines of Perl, if you write loose Perl.