You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Elias Arends <El...@setar.aw> on 2004/11/16 16:35:15 UTC

Postfix+spamc/spamd+MySQL

Platform: Solaris 8
MTA: Postfix 2.1.5
Software: SpamAssassin 2.64
SQL: MySQL 4.0.21

I have the above setup working with no problems. Incoming mail is being
scanned and tagged properly and delivered to the mailboxes. Now I want to
implement Per User Preferences using a MySQL database. I already have the
database up and running with some user settings. I have also edited the
local.cf file to query the MySQL database, which seems to be happening.
However in the log file I see this message: "retrieving prefs for nobody
from SQL server" and it seems spamc/spamd is not reading the user settings
properly. How can I solve this problem? Do I need to use any additional
software? I have included the local.cf for SA and master.cf for Postfix.
Thanks.

Local.cf:
# SpamAssassin config file for version 2.5x
# generated by http://www.yrex.com/spam/spamconfig.php (version 1.01)

allow_user_rules        1

# How many hits before a message is considered spam.
required_hits          5

# Whether to change the subject of suspected spam
rewrite_subject         1

# Text to prepend to subject if rewrite_subject is used
subject_tag             *****SPAM*****

# Encapsulate spam in an attachment
report_safe             1

# Use terse version of the spam report
use_terse_report        0

# Enable the Bayes system
use_bayes               1

# Enable Bayes auto-learning
auto_learn              1

# Enable or disable network checks
skip_rbl_checks         0
use_razor2              1
use_dcc                 1
use_pyzor               1

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages            all

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales              all

# Configuration for SQL Lookup
user_scores_dsn         DBI:mysql:spamassassin:localhost
user_scores_sql_username        spamd
user_scores_sql_password        spaminator


Master.cf:
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd -o
content_filter=spamassassin -v
spamassassin unix -     n       n       -       -       pipe
 user=nobody argv=/usr/local/bin/spamc -f -e /usr/lib/sendmail -oi -f
${sender} ${recipient}



Re: Postfix+spamc/spamd+MySQL

Posted by Michael Parker <pa...@pobox.com>.
On Tue, Nov 16, 2004 at 11:35:15AM -0400, Elias Arends wrote:
> 
> I have the above setup working with no problems. Incoming mail is being
> scanned and tagged properly and delivered to the mailboxes. Now I want to
> implement Per User Preferences using a MySQL database. I already have the
> database up and running with some user settings. I have also edited the
> local.cf file to query the MySQL database, which seems to be happening.
> However in the log file I see this message: "retrieving prefs for nobody
> from SQL server" and it seems spamc/spamd is not reading the user settings
> properly. How can I solve this problem? Do I need to use any additional
> software? I have included the local.cf for SA and master.cf for Postfix.
> Thanks.
> 
...
> Master.cf:
> # ==========================================================================
> # service type  private unpriv  chroot  wakeup  maxproc command + args
> #               (yes)   (yes)   (yes)   (never) (100)
> # ==========================================================================
> smtp      inet  n       -       n       -       -       smtpd -o
> content_filter=spamassassin -v
> spamassassin unix -     n       n       -       -       pipe
>  user=nobody argv=/usr/local/bin/spamc -f -e /usr/lib/sendmail -oi -f
> ${sender} ${recipient}
> 

You need to send the username using the -u param for spamc.  Once you
start passing in the username you should see it start fetching prefs
for that user (assuming you've got spamd starting with the right
options).

Michael

-- 
ApacheCon November 13-17 2004 http://www.apachecon.com/
See three SpamAssassin sessions & more
Birds of a Feather Session: November 16th, 9-10pm