[EMAIL PROTECTED] wrote:
> Quoting Bowie Bailey <[EMAIL PROTECTED]>:
> 
> > Tommy Braun wrote:
> > > 
> > > sorry, I am not uptodate and need to check out, if this
> > > 
> > > http://da.andaka.org/Doku/courier-spamassassin.html
> > > 
> > > document is still the state of the art regarding courier,
> > > spamassassin and user prefs for virtual users?
> > 
> > I looked at that at one point, but never attempted it.  I don't know
> > if it will work with the current SA version or not.
> > 
> > > Unfortunately there is still not one single line of documentation
> > > on the integration of courier and spamassassin on the
> > > spamassassin site - why? if anybody has a good working virtual
> > > users with individual spamassassin prefs - would you mind posting
> > > that to the spamassassin wiki? THANKS!
> > 
> > If I have some free time, I might post something.
> > 
> > > Any other hints and things-you-should-know are very welcome!
> > > 
> > > Please don“t hesitate to send me links to the most basic things.
> > > 
> > > Thank you very much for your attention!
> 
> Thanks very much, Bowie.  I've been wanting to do this for some time.
> My quick attempt yesterday wasn't successful because I probably missed
> something so I'm going back through it and would like to ask a couple
> of questions, if you don't mind.

No problem.

> > What I do is simply work with the built-in options of spamc and
> > spamd. 
> > 
> > My virtual users have home directories like this:
> > 
> >    /virtualhome/domain/user
> > 
> > With a "Maildir" folder for mail delivery.
> > 
> > I run spamd like this:
> > 
> >    /usr/bin/spamd -d -u mailacctuser -x
> > --virtual-config-dir='/virtualhome/%d/%l/spamassassin'
> > 
> > Where "mailacctuser" is the user who owns all of the virtual user's
> > home directories.
> 
> In my case the unix www user is the owner of all virtual mail folders
> so I assume that this would be -u mailacctuser.  I'm assuming that the
> %d and %l are parsed from the /usr/bin/spamc -u $USER line below.
> (Just to be sure as there are two -u options ;)  I also changed the
> spamassassin to .spamassassin that already exists.

If the owner of the virtual mail folders is "www", then just replace
"mailacctuser" with "www" in my example.

The "%l" and "%d" will be replaced by the local and domain parts of
the delivery email address passed in to spamc via the -u option.  See
the spamd man page for more info.

Exactly what you use for the virtual-config-dir really doesn't matter
as long as you remember what it is when you are working with the
user_prefs files and sa-learn.

> > And then, I call spamc from maildrop like this:
> > 
> >    import USER
> >    exception {
> >        xfilter "/usr/bin/spamc -u $USER"
> >    }
> 
> I ran this from etc/maildroprc globally.  Should it be run from a
> local .mailfilter?

You can do it either way.  I run it from /etc/courier/maildroprc.

It may be useful to put it in the local .mailfilter so that it only
runs for one user during testing.

> > Spamd will parse the email address provided by the -u option into
> > its local and domain parts and use that to find the configuration
> > directory.  It will create the spamassassin directory if it
> > doesn't already exist.  All Bayes and AWL files will be created
> > within this directory.  You can also put the user_prefs file here
> > for per-user configuration. 
> 
> The above is the reason I changed spamassassin to .spamassassin
> because all my users already have it.
> 
> I'm going to give it another try while I'm fresh and have had a couple
> of ristretos.  I'm sure I missed something yesterday.
> 
> Thanks again for sharing,

No problem.  Good luck!

Something else to keep in mind using this method is that you will need
to be careful to set the right options when running sa-learn.  I have
a script that does the learning for some of the accounts.

For each user, it does this:

---------------------------------------------------------
HOMEDIR=/virtualhome/domain.com/user
SADIR=$HOMEDIR/spamassassin
CHANGED=no
if [[ `find $HOMEDIR/Maildir/.Ham-checked/cur -type f` != '' ]]
then
    CHANGED=yes
    echo "Learning Ham"
    sa-learn --no-sync --ham --dbpath $SADIR/bayes
--prefs-file=$SADIR/user_prefs --dir $HOMEDIR/Maildir/.Ham-checked/cur
--showdots
    rm $HOMEDIR/Maildir/.Ham-checked/cur/* 2> /dev/null
fi
if [[ `find $HOMEDIR/Maildir/.Spam-checked/cur -type f` != '' ]]
then
    CHANGED=yes
    echo "Learning Spam"
    sa-learn --no-sync --spam --dbpath $SADIR/bayes
--prefs-file=$SADIR/user_prefs --dir $HOMEDIR/Maildir/.Spam-checked/cur
--showdots
    rm $HOMEDIR/Maildir/.Spam-checked/cur/* 2> /dev/null
fi
if [[ $CHANGED == "yes" ]]
then
    sa-learn --sync --dbpath $SADIR/bayes --prefs-file=$SADIR/user_prefs
--showdots
fi
---------------------------------------------------------
(watch for wrapping on those sa-learn lines)

I'm not sure if the --prefs-file setting is required.  I put it there
simply because there was an option for it.

-- 
Bowie


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to