• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

qmail-spp and spf plugin

N

nars

Guest
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?
 
After looking at psa_smtp file in xinetd.d folder I think maybe psa qmail isn't using default auth method... and using some special auth method using a DB... and maybe why RELAYCLIENT is not set... but still no idea how to fix it :(
 
Another thing I have found is that when one of my clients using dynamic ip's from their isp's get an ip that is listed in a MAPS list they cannot use server to send emails :( since they are authenticated to smtp I think this is also not correct... :rolleyes: any idea how to fix it?
 
Back
Top