Bug wrote: > Dear users ! > > I`m using exim + spamd + user_prefs in mysql. All works fine. > > But I found a bug, when I`m using whitelist, and header rcpt to: have > address with character description, whitelist failed to catch it in > database. For example: > > 1st message: > spamd: clean message (-91.7/10.0) for t...@localdomain.com:501 in 8.2 > seconds, 13522829 bytes. > > 2nd message: > spamd: identified spam (9.2/5.0) for some text <t...@localdomain.com>:501 in > 8.3 seconds, 14874071 bytes. > > > > Where "some text" for example User Name in address book of senders > mail agent. > > > Mysql userpref struct: > username | preference | value | > prefid > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > test | whitelist_from | sen...@hidden.com | 1 > > > Mysql database query in sql.cf: > user_scores_sql_custom_query SELECT preference, value FROM _TABLE_ WHERE > username IN (_USERNAME_, '$GLOBAL', CONCAT(_MAILBOX_, '@' , > _DOMAIN_),SUBSTRING_INDEX(_USERNAME_, '@', 1)) ORDER BY username ASC > > > All works fine, when address of recipient in incoming letter is canonical > like t...@localdomain.com > How can I fix this ? > Stop passing extra garbage in the -u parameter to spamc?
The "some text" part can't legally occur in a RCPT TO: command (which is not a header). Did you mean are you extracting the entire contents of the To: header? spamc isn't designed to parse all that extra data off, username or usern...@domain only. I'd try to find a way to get the RCPT TO not the To: anyway. The To: header might not contain the actual recipient and isn't a useful header for selecting user prefs. (i.e.: posts sent to mailing lists are RCPT TO: you, but they are To: the list) This is precisely why SA doesn't try to parse the To: header and use that for selecting prefs.. It is often misleading.