View Single Post
  #5  
Old 5th May 2010, 17:53
Drex56 Drex56 is offline
Junior Member
 
Join Date: May 2010
Posts: 16
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Just to Add to Maxum's post I did the following which ridded me of the dreaded Clam error:

Assumptions:

1. clamd is located in
Code:
/usr/sbin
2. AppAromor profiles are held in
Code:
/etc/apparmor.d
3. MailScanner incoming queue is
Code:
/var/spool/MailScanner/incoming
Obviously you will need to do the following to add clamd to the www-data group so that it can access the directory:

Code:
sudo usermod -a -G www-data clamav
Now edit the profile for clamd:
Code:
sudo nano /etc/apparmor.d/usr.sbin.clamd
Add the Incoming folder to the list of folders
Code:
  /var/spool/MailScanner/** rw,

  /var/spool/MailScanner/incoming/** rw,
Now to be honest, I dont really need the second line as the ** means files AND directories underneath the current directory but will leave it in there as "it's what worked for me".

After that I reload ALL the Apparmor profiles (it was easier at the time to find that than find how to reload just one).

Code:
sudo /etc/init.d/apparmor reload
After this send yourself a test mail and look at mail.log using:
Code:
tail -f /var/log/mail.log
And watch as clamd does not error.

Hope this helps.

Regards

Drex
Reply With Quote