<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Piece of Unix Hints &#187; SpamAssassin</title>
	<atom:link href="http://hints.jeb.be/tag/spamassassin/feed/" rel="self" type="application/rss+xml" />
	<link>http://hints.jeb.be</link>
	<description>hints.jeb.be</description>
	<lastBuildDate>Fri, 04 Dec 2009 20:35:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Per virtual user sa-learn training</title>
		<link>http://hints.jeb.be/2008/12/17/per-virtual-user-sa-learn-training/</link>
		<comments>http://hints.jeb.be/2008/12/17/per-virtual-user-sa-learn-training/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 01:53:14 +0000</pubDate>
		<dc:creator>Jeb</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[SpamAssassin]]></category>

		<guid isPermaLink="false">http://hints.jeb.be/?p=42</guid>
		<description><![CDATA[Context I use a LDA that use Virtual User, and store email in /some/path/mail/&#60;domaine.tld&#62;/&#60;user&#62;/, this is a quite standard way to do. I also use spamassassin but wanted to have a per user bayes database and configuration. It&#8217;s still simple with spamc/spamd by running spamd -c --virtual-config-dir=/some/path/to/spamassassin/%d/%l ... and invoking spamc from you MTA with [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Context</strong></p>
<p>I use a LDA that use Virtual User, and store email in /some/path/mail/&lt;domaine.tld&gt;/&lt;user&gt;/, this is a quite standard way to do.<br />
I also use spamassassin but wanted to have a per user bayes database and configuration. It&#8217;s still simple with spamc/spamd by running <code>spamd -c --virtual-config-dir=/some/path/to/spamassassin/%d/%l ...</code> and invoking spamc from you MTA with <code>spamc -u ${recipient} -f -e /path/to/your/LDA</code> so that i have user preference in <code>/some/path/saconf/&lt;domaine.tld&gt;/&lt;user&gt;/</code>.<br />
Now I would like to provide 2 imap folder to users, LearnSpam and LearnHam so that they could train their bayes database.<br />
Here the problem start, especially if you are not using one of the latest spamassassin version.<br />
<strong></strong></p>
<p><strong>The bad way<br />
</strong><br />
What sa-learn command will you run to take care of LearnSpam and LearnHam folders ? sa-lean has an &#8211;username option, you may want to use that but this is not intended to be use in this case, it&#8217;s to be used when bayes database are stored in an SQL database instead of file (this is correctly documented in latest SA version). So don&#8217;t try <code>sa-learn --username=&lt;user&gt;@&lt;domaine.tld&gt; --spam /some/path/mail/&lt;domaine.tld&gt;/&lt;user&gt;/.INBOX.LearnSpam/cur/*</code> it will not work. Imagine how this can work ? it can&#8217;t, how sa-learn could convert &lt;user&gt;@&lt;domaine.tld&gt; to /some/path/saconf/&lt;domaine.tld&gt;/&lt;user&gt;/ ?</p>
<p><strong>The good way<br />
</strong><br />
So the right command to use is <code>sa-learn -p /some/path/saconf/&lt;domaine.tld&gt;/&lt;user&gt;/user_prefs --spam /some/path/mail/&lt;domaine.tld&gt;/&lt;user&gt;/.INBOX.LearnSpam/cur/*</code> Using the -D (debug) option could be very helpfull to check if it&#8217;s work correctly, you must see <code>dbg: bayes: tie-ing to DB file R/O /some/path/saconf/&lt;domaine.tld&gt;/&lt;user&gt;/bayes_toks</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hints.jeb.be/2008/12/17/per-virtual-user-sa-learn-training/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
