Thank You Henry a lot!

This really helps. It seems that boath ways are ok (according to man page)
with whitelist_from, but I am still not shure wheather this also applies to
all other prefferences. My guess is that it should, at least to those that
can logically have several entries.

Raimonds

-----Original Message-----
From: Henry F. Camacho Jr [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 12, 2006 9:28 PM
To: Raimonds Aronietis
Cc: users@spamassassin.apache.org
Subject: Re: MySQL userprefs


Raimonds:

I am not sure ether, although I've looked at the source code for the SQL
loader. Here is what it looks like:

$sql = "select $f_preference, $f_value from $f_table where ".
"$f_username = ".$dbh->quote($username).
" or $f_username = '[EMAIL PROTECTED]' order by $f_username asc";
}
dbg("Conf::SQL: executing SQL: $sql");
my $sth = $dbh->prepare($sql);
if($sth) {
my $rv = $sth->execute();
if($rv) {
dbg("retrieving prefs for $username from SQL server");
my @row;
my $text = '';
while(@row = $sth->fetchrow_array()) {
$text .= "$row[0]\t$row[1]\n";
}

It appears that the this code creates a scalar $text that is broken by
"\n" line by line, then passed to the spamassassin as a userpref. It
appears this matches the same format as if it was loaded from a on disk
userprefs file.

Reading the man page I see the following:

----------------------------

whitelist_from [EMAIL PROTECTED]
Used to specify addresses which send mail that is often tagged
(incorrectly) as spam; it also helps if they are addresses of big
companies with lots of lawyers. This way, if spammers impersonate them,
they’ll get into big trouble, so it doesn’t provide a
shortcut around SpamAssassin. If you want to whitelist your own domain,
be aware that spammers will often impersonate the domain of
the recipient. The recommended solution is to instead use
"whitelist_from_rcvd" as explained below.

Whitelist and blacklist addresses are now file-glob-style patterns, so
"[EMAIL PROTECTED]", "[EMAIL PROTECTED]", or "*.domain.net" will
all work. Specifically, "*" and "?" are allowed, but all other
metacharacters are not. Regular expressions are not used for secu-
rity reasons.

Multiple addresses per line, separated by spaces, is OK. Multiple
"whitelist_from" lines is also OK.

The headers checked for whitelist addresses are as follows: if
"Resent-From" is set, use that; otherwise check all addresses taken

---------------------------

Reading the above leads me to the conclusion that either format will
work. Although the normal width of the value column in the userperfs
table structure is 100. I would make sense to list each whitelist_from
in a sperate row.

Hope this helps..

HFC


Raimonds Aronietis wrote:

>Hi,
>
>I am trying to make a sql-based per user setup of preferences and want to
>ask if anyone knows how the entries in mysql table should be made
correctly.
>I have not been able to find corresponding documentation. :(
>
>There are two possible ways and I am in doubt which is correct:
>
>1.
>user   pref            value
>aaa    whitelist_from  [EMAIL PROTECTED]
>aaa    whitelist_from  [EMAIL PROTECTED]
>aaa    ok_locales      en
>aaa    ok_locales      de
>aaa    ok_locales      ru
>
>or
>2.
>user   pref            value
>aaa    whitelist_from  [EMAIL PROTECTED] [EMAIL PROTECTED]
>aaa    ok_locales      en de ru
>
>Should boath work for all prefferences or there is only one correct way of
>creating the entries in the table?
>
>By the way there are also size limitations for number of symbols per
>database cell.
>
>I hope that somone has encountered this problem already and can help!
>
>Best reguards,
>
>Raimonds Aronietis
>
>

Reply via email to