On Thu, Jul 20, 2023 at 04:14:05PM -0700, Grant Keller wrote: > Could be me doing something wrong, but I can't get Welcome/unwelcome > lists to work the way I expect them to. We are running Spamassassin > 4.0.0 on Centos 7.9 and have the user configs stored via mysql. Custom > scores, Welcomelist, Blocklist, all seem to be working correctly. But if > I have the following config entries: > > | gvk | unwhitelist_from | grant.kel...@sonic.com | 7421538 | > | gvk | whitelist_from | grant.kel...@sonic.com | 7526210 | > > Still, a message from that address to the gvk user results in the > following rules being hit: > > tests=ALL_TRUSTED,SCC_BODY_SINGLE_WORD,SONIC_BX_A2,SONIC_FRIEND,SPF_HELO_NONE, > T_SCC_BODY_TEXT_LINE,USER_IN_WELCOMELIST > > > I'm out of ideas to try on my side. Is there a way to have spamassasin > or spamc print the config, or perhaps debugging I can enable to try to > track down this problem?
This is the default query: select username, value from userpref where username = _USERNAME_ or username = '@GLOBAL' order by username asc; As you see the only sort is done with username and otherwise MySQL makes _no_ guarantees about returned order. If whitelist_from is returned last, it works exactly the same as a physical .cf file would have it last. Why do you have an obviously redundant whitelist_from in the table messing up things?