To avoid patching and recompiling qmail I was trying to put qmail-spp spf plugin working on my FC2 - Plesk 7.5.4 server as it seems default psa qmail is compiled with qmail-spp and even comes with a plugin (chkrcptto), I thought it would be easy, however I'm having some throuble... I have installed libspf and libspf-devel (needed to compile spf.c plugin) packages from: http://libspf.org/files/rpm/libspf-1.0.0.RC4-1.fc2.i386.rpm http://libspf.org/files/rpm/libspf-devel-1.0.0.RC4-1.fc2.i386.rpm tested with spfquery, and all seems ok. then got spf plugin from: http://qmail-spp.sourceforge.net/downloads/spf.c As I don't knew where to set SPF env. var. to enable it, before compiling spf.c I have done a small change to it to behave like if SPF env. var. was set to 1, changed: if (getenv("RELAYCLIENT") || /* known user */ !(spf_env = getenv("SPF"))) return 0; /* plugin disabled */ to if (getenv("RELAYCLIENT")) return 0; /* known user - plugin disabled */ and spf = atoi(spf_env); to spf = 1; compiled it with: gcc -o spf ./spf.c -lspf then moved the compiled binary to /var/qmail/plugins/ and edited /var/qmail/control/smtpplugins to look like: [rcpt] plugins/chkrcptto [mail] plugins/spf (added last 2 lines) sent a few mails for testing... results: it seems to be working well, for eg. sending from another email service to my server... all ok, except one thing... it is even blocking me and other users of my server from using smtp to send emails, it refuses it as it see that the mails come from different ip's (our home internet connection ip's) that do not match spf record... and we are using SMTP authentication... I think the purpose of if (getenv("RELAYCLIENT")) return 0; /* known user - plugin disabled */ is exactly to avoid this, but then it is not working... I even tried to change it to: if (getenv("RELAYCLIENT") || getenv("SMTPAUTHMETHOD") || getenv("SMTPAUTHUSER")) return 0; /* known user - plugin disabled */ expecting it would "abort" the plugin when there was an authenticated user but no luck... Any ideas?