On 25 Jul 2010, at 18:50, Alban Hertroys wrote:
> I posted a couple of days back about this issue already, but didn't get any replies - may have been because I wasn't subscribed yet.
> In the meantime I switched to training via the Dovecot plugin (which requires the signature to be in the header). I'm using DSPAM 3.9.0 from ports (FreeBSD 7.3).
> I'm seeing this in my logs:
> Jul 25 18:36:52 solfertje dspam: Signature retrieval for '3,4c4c60f8286211026045283' failed
> Jul 25 18:36:53 solfertje dspam: Unable to find a valid signature. Aborting.
> Jul 25 18:36:53 solfertje dspam: process_message returned error -5. dropping message.
> So it successfully extracts the signature from the mail, but can't find it in the database.
> While the database (PostgreSQL 8.3) says:
> dspam=> select uid, signature from dspam_signature_data where signature = '3,4c4
> uid | signature
> 3 | 3,4c4c60f8286211026045283
> (1 row)
> So the signature is there! What's happening?!?
I researched this some more by turning on more verbose query logging on my dspam database, and it turns out the signature lookup is failing to get results from a query in _pgsql_drv_getpwnam(), namely:
SELECT uid FROM dspam_virtual_uids WHERE username='user'
For some reason dspam is looking up a user as 'user', while the dspam_virtual_uids(username) column contains usernames á la 'user@...'.
My dspam.conf contains:
(Not all of these options are documented BTW, I had to look up the possible options in the source!)
So it should be using my system username ('user') all the way, shouldn't it? Instead it seems that it uses 'user@...' when invoked from Postfix, while it uses 'user' when invoked from Dovecot (or, probably, when I forward mail to 'spam@...').
Any idea what's causing this discrepancy and what I can do about it?
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.