On 8/20/2012 2:02 PM, Ben Johnson wrote: > > > On 8/20/2012 12:56 PM, Bowie Bailey wrote: >> On 8/20/2012 12:46 PM, Axb wrote: >>> On 08/20/2012 06:42 PM, Ben Johnson wrote: >>>> >>>> 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 >>>> --------------- >>> ~/Maildir/* assumes 1 file=1 mail >>> >>> pls try >>> >>> su amavis -c 'sa-learn --spam --progress --dir >>> /var/vmail/example.com/trainer/Maildir/.INBOX.Spam/cur/' >>> >>> or wherever the message are stored >> >> But first, you need access to the files. The simplest way is probably >> to add the amavis user account to the group used by the mail directories. >> >> Assuming the group is "vmail", the command should look like this (on >> RedHat/CentOS): >> >> $ usermod -a -G vmail amavis > > Thanks, guys. I did consider adding the "amavis" user to the "vmail" > group, but the default permissions on the directories within "Maildir" > are 700 (with vmail:vmail ownership). > > So, I'd have to fiddle with the permissions on the entire directory > tree, for each user, which seems like a bad idea. > > Furthermore, ISPconfig handles the creation (and deletion) of these > directories, so I hesitate to change anything manually and muck-up the > installation. > > While there may be permissions mask that is applied, modifying it seems > risky. > > I wonder what the rest of the Dovecot + Amavis + SA world is doing about > this. Maybe I should ask on the Amavis mailing list. > > If anyone has other suggestions, by all means, please do share. > >> This command will probably need to be run as root. If you are using a >> different distro, you will need to look up the command to add the amavis >> user to the vmail group. >> > > Much thanks, > > -Ben >
I was able to resolve the issue by adding the --username switch to the 'sa-learn' executable: # sa-learn --username=amavis --spam /var/vmail/example.com/trainer/Maildir/.INBOX.Spam/cur Thanks for all of the hints, folks! -Ben