Re: Per-User required_score
Theo Van Dinter wrote: Well, the problem is that if you run at MTA time, you can't really do per-user configs. spamc -u will work, if there's only 1 user. it won't work with multiple users, such as when there are several recipients for a single message, unless you can get the MTA to split the message up into multiple messages, but that is problematic/has pros+cons assuming the MTA will even let you do it. In postfix you just need to set _destination_recipient_limit for the transport you're using for spamassassin. /Per Jessen, Zürich
Re: Per-User required_score
On Wed, 09 Jan 2008 09:20:26 +0100 Per Jessen [EMAIL PROTECTED] wrote: Theo Van Dinter wrote: Well, the problem is that if you run at MTA time, you can't really do per-user configs. spamc -u will work, if there's only 1 user. it won't work with multiple users, such as when there are several recipients for a single message, unless you can get the MTA to split the message up into multiple messages, but that is problematic/has pros+cons assuming the MTA will even let you do it. In postfix you just need to set _destination_recipient_limit for the transport you're using for spamassassin. Yes. One needs to set: _destination_recipient_limit = 1 However, I have not been able to make it work without altering the spamd daemon. In particular, spamd looks for a physical account on the server it is running: sub handle_user_setuid_basic { ... my ($name, $pwd, $uid, $gid, $quota, $comment, $gcos, $dir, $etc) = getpwnam($userid); if (!defined $uid) { my $errmsg = spamd: handle_user unable to find user: '$userid'\n; #die $errmsg if $spamtest-{'paranoid'}; # if we are given a username, but can't look it up, maybe name # services are down? let's break out here to allow them to get # 'defaults' when we are not running paranoid info($errmsg); return 0; } ... } On our server there is a spamd user account. Therefore, I changed the 'if' section above to: if (!defined $uid) { ($name, $pwd, $uid, $gid, $quota, $comment, $gcos, $dir, $etc) = getpwnam(spamd); } At this point spamd is able to find a local account and spamc is correctly ran with the user it is suppose to, i.e.: spamass unix - n n - 32 pipe user=spamd argv=/usr/local/bin/spamc -u ${recipient} -e /usr/local/sbin/sendmail -oi -f ${sender} ${recipient} --- _|_ (_| |
Re: Per-User required_score
Within postfix/master.cf I have the following lines : smtp inet n - - - - smtpd -o content_filter=spamassassin This pushes mail through the following lines : spamassassin unix - n n - - pipe user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} Hope this is what you were after... Thanks, - David mouss-2 wrote: David.Sharpe wrote: Hi, I want to give users control of the required_score variable. I am using Postfix // SpamAssassin // amavis. I have read the document http://wiki.apache.org/spamassassin/UsingSQL and have the tests working OKAY. /executing SQL: SELECT preference, value FROM userpref WHERE username = '[EMAIL PROTECTED]' OR username = '$GLOBAL' OR username = CONCAT('%','testdomain.com') ORDER BY username ASC /I am however unsure as to how to get Postfix to pass SpamAssassin the username. Below is an exert of the spamd log which shows the problem : /executing SQL: SELECT preference, value FROM userpref WHERE username = 'nobody' OR username = '$GLOBAL' OR username = CONCAT('%',NULL) ORDER BY username ASC / how do you run spamassassin? -- View this message in context: http://www.nabble.com/Per-User-required_score-tp14664875p14668113.html Sent from the SpamAssassin - Users mailing list archive at Nabble.com.
Re: Per-User required_score
David.Sharpe wrote: Hi, I want to give users control of the required_score variable. I am using Postfix // SpamAssassin // amavis. I have read the document http://wiki.apache.org/spamassassin/UsingSQL and have the tests working OKAY. /executing SQL: SELECT preference, value FROM userpref WHERE username = '[EMAIL PROTECTED]' OR username = '$GLOBAL' OR username = CONCAT('%','testdomain.com') ORDER BY username ASC /I am however unsure as to how to get Postfix to pass SpamAssassin the username. Below is an exert of the spamd log which shows the problem : /executing SQL: SELECT preference, value FROM userpref WHERE username = 'nobody' OR username = '$GLOBAL' OR username = CONCAT('%',NULL) ORDER BY username ASC / how do you run spamassassin?
Re: Per-User required_score
David.Sharpe wrote: Within postfix/master.cf I have the following lines : smtp inet n - - - - smtpd -o content_filter=spamassassin This pushes mail through the following lines : spamassassin unix - n n - - pipe user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} Hope this is what you were after... so you need to pass the user to spamc (-u ${user} for example).
Re: Per-User required_score
Well, the problem is that if you run at MTA time, you can't really do per-user configs. spamc -u will work, if there's only 1 user. it won't work with multiple users, such as when there are several recipients for a single message, unless you can get the MTA to split the message up into multiple messages, but that is problematic/has pros+cons assuming the MTA will even let you do it. So in short, if you want per-user configs, switch to running SA at the MDA (procmail, maildrop, etc.) On Mon, Jan 07, 2008 at 10:29:43PM +0100, mouss wrote: David.Sharpe wrote: Within postfix/master.cf I have the following lines : smtp inet n - - - - smtpd -o content_filter=spamassassin This pushes mail through the following lines : spamassassin unix - n n - - pipe user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} Hope this is what you were after... so you need to pass the user to spamc (-u ${user} for example). -- Randomly Selected Tagline: It's more about the opportunity to make an impact and the challenge to be successful than it is about the title. - Paul M. Moriarty in [EMAIL PROTECTED] pgpIxZPNn8ZV0.pgp Description: PGP signature
Re: Per-User required_score
On Mon, 7 Jan 2008, Theo Van Dinter wrote: Well, the problem is that if you run at MTA time, you can't really do per-user configs. spamc -u will work, if there's only 1 user. it won't work with multiple users, such as when there are several recipients for a single message, unless you can get the MTA to split the message up into multiple messages, but that is problematic/has pros+cons assuming the MTA will even let you do it. So in short, if you want per-user configs, switch to running SA at the MDA (procmail, maildrop, etc.) If you -only- need Per-User required_score you may be able to achieve that via a two stage process. Run SA at your MTA level but have it -only- add a specific header with the score value. Then in your delivery process have some kind of customized delivery agent that would look up the Per-User required_score, combine that with the SA header score and take the specific user desired action. (change subject header, route to 'Junk' folder, etc). This would have the disadvantage of defeating the one main reason for running SA at the MTA level (the ability to SMTP-REJECT spam). -- Dave Funk University of Iowa dbfunk (at) engineering.uiowa.eduCollege of Engineering 319/335-5751 FAX: 319/384-0549 1256 Seamans Center Sys_admin/Postmaster/cell_adminIowa City, IA 52242-1527 #include std_disclaimer.h Better is not better, 'standard' is better. B{
Re: Per-User required_score
David, I want to give users control of the required_score variable. I am using Postfix // SpamAssassin // amavis. ... spamassassin unix - n n - - pipe user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} If your concern is to have per-user SQL-based spam scores, but want to keep SpamAssassin at the MTA level, and since you are already using amavisd-new - why not let amavisd call SA directly, and provide its SQL (or LDAP) lookups functionality. This allows SpamAssassin to only be invoked once per message, yet still offer individual per-recipient spam levels, individual pass/block settings, ..., even for multi-recipient messages. Mark