Virtual mailuser with their own bayes db?
Julian Field
MailScanner at ecs.soton.ac.uk
Sat Jun 10 16:54:13 IST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Christian Pedaschus wrote:
> Thanks for the answer, Jules.
> I'll have a look at said solutions without bayes, because i don't like
> the idea of having 1 big bayes db for users across different domains
> (perhaps some users like a given sort of spam and learn it as ham while
> others learn it as spam, sounds like a bad idea)
>
>
> Just one more question:
> Could you please explain what this means, i'm curious :)
>
> # N.B. SpamAssassin will use home dir defined in ENV{HOME}
> # 'if $ENV{HOME} =~ /\//'
>
This will always be true if $ENV{HOME} is set at all.
> # So, set ENV{HOME} to desired directory, or undef it to force it to get
> home
> # using getpwnam of $> (EUID)
>
> In bin/Mailscanner env(home) get unset, that's why this comment
> irritates me.
>
I think I can remember why I delete $ENV{HOME}. It is set before the UID
and EUID are changed to the "Run As User", so will always be that of
root. By unsetting it, it forces SpamAssassin to use the home directory
of the effective userid (i.e. the "Run As User") for its .spamassassin
directory.
If it were left defined, it would use the home directory of root as the
location of the .spamassassin directory, which it can't actually write
to once it has changed to be the "Run As User". I need to force it to
use the home directory of the "Run As User" as that is the only place it
can write to. So I undefine it to force it to reset it to that of the
"Run As User".
If I didn't do that, when running as "postfix" it would try to write to
"/root/.spamassassin" which it wouldn't be able to access. By undefining
it, I force it to use "/var/spool/postfix/.spamassassin" which it can
access.
I hope that explains why I did it this way.
It is very necessary.
> Julian Field wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> MailScanner does not use spamd/spamc at all, it talks directly to
>> SpamAssassin's Perl library for speed and efficiency reasons.
>>
>> However, this does mean that you are stuck to 1 bayes db for the whole
>> system, sorry. People such as Matt Kettler (Matt--correct me if I'm
>> wrong) have constructed very reliable spam detection without using bayes
>> at all, so this isn't actually a big problem. Most people run with
>> bayes, with one bayes db shared between all their customers/users and
>> have no problems with it at all.
>>
>> So that bad news is that you can't do it. The good news is that it
>> doesn't actually matter anyway.
>>
>> Regards,
>> Jules.
>>
>> Christian Pedaschus wrote:
>>
>>
>>
>>> Hi everybody,
>>>
>>> i'm using mailscanner-4.54.6, latest qmail-ldap and courier-imap-3.0.8
>>> and try to get spamassassin to use a separate bayes db for every virtual
>>> mailuser instead of a global one, but can't get it to work nor did i
>>> find anything in the wiki/documentation about it (perhaps i'm blind, pls
>>> excuse if so, was a long day).
>>>
>>> i found a howto to patch spamd to get the vuser home-dir from courier,
>>> but it's not of much help because i'm no perl-developer and can't
>>> convert the needed steps to spamassassin. i looked around in
>>> Mailscanner/lib/Mailscanner/SA.pm and line 89-92 look promising, but i
>>> don't fully understand them. the sa-howto patches the getpwnam call to
>>> return the data from courier, i guess that's what i need to do here, i
>>> just don't know how or where exactly.
>>>
>>> can someone give me a hint on how to get this running?
>>>
>>>
>>> Greets, Chris
>>>
>>> ps. the mentioned spamd-patch howto:
>>> http://da.andaka.org/Doku/courier-spamassassin.html
>>>
>>>
>>>
>>>
>> - --
>> Julian Field
>> www.MailScanner.info
>> Buy the MailScanner book at www.MailScanner.info/store
>> Professional Support Services at www.MailScanner.biz
>> MailScanner thanks transtec Computers for their support
>>
>> PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
>>
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: PGP Desktop 9.0.6 (Build 6060)
>>
>> iQA/AwUBRIrQghH2WUcUFbZUEQIhIwCgpPwNnLtw7mfE62KWjXR5yM9rc2AAn0sa
>> vNrWZJB+j+Hg6mGtxWotPPxG
>> =3tVA
>> -----END PGP SIGNATURE-----
>>
>>
>>
>>
- --
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.6 (Build 6060)
iQA/AwUBRIrrKxH2WUcUFbZUEQIAzgCgxtIUGFCPiJUqWG5oQQ7xFKkm4ukAoJg7
nyL/yWzdDZI40y/HSyOFi8fU
=u9CJ
-----END PGP SIGNATURE-----
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
More information about the MailScanner
mailing list