December 03, 2003
spamassassin and mysql

Really, it's always the most obvious, easy thing that's wrong but takes the longest to figure out.

I use postfix and have multiple domains setup in mysql.. the beauty of this setup (as if I need to explain) is that my users are not local users but rather live happily in my database and I don't have to worry about all kinds of security issues. Not to mention adding new users and domains consists of inserting sql statements.. how's that for sexy?

Considering that my users are not local, you can see why I would want my spamassassin settings to live on per-user basis in the db. It's easy to set that up.. there's a nice helpful document here that explains it all including a sample table. Lovely!

Of course I was having problems getting this to work.. running spamd in debug mode.. and it's not even connecting to the db! Looking at mysql logs.. sure enough.. no connection attempt.. google search.. yes, looks like a lot of people are having the same problem but nobody has a solution.

Finally.. (what I should have done first).. "man spamd"

-q, -sql-config
Turn on SQL lookups even when per-user config files have been disabled with -x. this is useful for spamd hosts which don’t have user’s home directories but do want to load user preferences from an SQL database.

Ah.. there it is.. -q -x and works like a charm.

Trivia: how many people know that Jeremy added this spamassassin feature? Small world, huh?

Posted December 03, 2003 08:51 PM in Geek Stuff
TrackBack URL for this entry: http://www.unix-girl.com/mt/mt-tb.cgi/1032
Comments
On December 3, 2003 10:53 PM David added:

Very small world indeed. Jeremy made Slashdot.

http://developers.slashdot.org/article.pl?sid=03/12/02/2314233

I'll take the SA + MySQL combo and set it up (thanks for the reminder). It totally skipped my mind when I was setting up postfix to play around on my home box. So many things to do, so little time...

#
On December 4, 2003 01:57 AM Jeremy Zawodny added:

It's good to know that at least two of us in the world use that feature. :-)

#
On December 4, 2003 12:28 PM Justin added:

It works? good to know! ;)

#
On December 5, 2003 11:55 AM Max Clark added:

I'm currently using amavisd-new as my spam/virus filter for my postfix installations. I'm curious... are you calling spamc via a shell script filter, or are you using a daemonized filter?

Thanks for the info!

#
On December 5, 2003 12:32 PM kasia added:

I'm calling spamc via shell script filter.. it's easiest..

Of course I've this whole elaborate setup.. using header_checks to put all spam-identified e-mail into a hold queue which is then daily processed and a summary sent out to every user with their list of held email which can be released via a web-page.. if not released it's deleted within 72 hours.

Yah.. all this for a couple people.. but I like experimenting with this stuff :)

I keep meaning to publish my scripts.. need to clean them up first.. well that and my perl is a little embarassing.. i'm after all, a Java programmer.

#
Trackbacks