On 8/17/2012 11:28 AM, John Hardin wrote: > On Fri, 17 Aug 2012, Ben Johnson wrote: > >> On 8/16/2012 2:00 PM, Ben Johnson wrote: >> Basically, I need to do something about the spam inundation, as soon as >> possible. >> >> Is there any reason that I should NOT be performing the sa-learn >> training under the "amavis" user account? > > In general, all training should be done as the user that SA (in your > case, SA via Amavis) is running as.
I have tried to do this, but to no avail: --------------- # su amavis -c 'sa-learn --spam /var/vmail/example.com/trainer/Maildir/.INBOX.Spam' archive-iterator: no access to /var/vmail/example.com/trainer/Maildir/.INBOX.Spam: 13 at /usr/share/perl5/Mail/SpamAssassin/ArchiveIterator.pm line 539. archive-iterator: no access to /var/vmail/example.com/trainer/Maildir/.INBOX.Spam: 13 at /usr/share/perl5/Mail/SpamAssassin/ArchiveIterator.pm line 771. archive-iterator: unable to open /var/vmail/example.com/trainer/Maildir/.INBOX.Spam: 13 --------------- This seems to occur because the virtual mail directory permissions do not provide the "amavis" user with the required access level. The "vmail" user is the only user with any type of access to /var/vmail/example.com/user/Maildir. I suspect that there is a good reason for this and that the ownership/permissions should not be changed. I've done some research on this issue and there isn't much to be found. This archived thread ( http://marc.info/?l=amavis-user&m=116457786312019 ) discusses overriding the Bayes user with "bayes_sql_override_username amavis", but that doesn't solve the problem (obviously). I still see the same permission errors, although the need to use the 'su' wrapper does go away. Is there a conventional means by which to deal with this issue? > If you have your system configured for per-user Bayes databases, then > you'd need to train as the user whose database you want to affect. The system in question leverages ISPConfig 3, which implements virtual users/mailboxes, although, I don't know if ISPConfig configures Amavis to utilize individual Bayes databases or if there's an individual database for the "amavis" user. I can check with the developers. > What is your bayes_path config? I don't see this directive anywhere on the system in question; perhaps a default value is being used. The only instance of that string exists in a source file: /usr/share/perl5/Mail/SpamAssassin/Conf.pm:=item bayes_path /path/filename (default: ~/.spamassassin/bayes) So, presumably, "bayes_path" is equating to "~/.spamassassin/bayes", or in my case, "/var/lib/amavis/.spamassassin". >> Would doing so preclude me from creating training folders for >> individual IMAP users in the future? > > They're not related. Per-user ham and spam training folders doesn't > preclude using those messages for training a global Bayes database. Understood. > You actually may want to implement a hybrid folder model: per-user ham > training folders and a global spam training folder. Misclassified ham > could potentially be private messages that the recipient doesn't want > other users to see, but for misclassified spam who cares? Right, that makes sense. >> Or can I train under the "amavis" user for now and then "layer-on" >> training for individual IMAP users in the future without undesirable >> consequences? > > As stated above, if you're not enabling per-user Bayes *databases*, the > question is meaningless. Are you going to configure per-user Bayes > databases? Or (as I suspect is more likely) perform global database > training from individual users whose judgement you trust? > I suppose that I need to determine whether or not ISPConfig implements per-user Bayes database already. I'll report-back for those who may be curious. Thanks again, -Ben