1

Topic: ClamAV Failed (permissions error)

==== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Centos 6.5
- Related log if you're reporting an issue: /var/log/maillog
====

I've noticed these errors in my maillog:

Feb 12 09:27:06 dmzsvr14v amavis[1401]: (01401-01) (!)run_av (ClamAV-clamd) FAILED - unexpected , output="/var/spool/amavisd/tmp/amavis-20140212T092705-01401-iNC5oOO9/parts: lstat() failed: Permission denied. ERROR\n"
Feb 12 09:27:06 dmzsvr14v amavis[1401]: (01401-01) (!)ClamAV-clamd av-scanner FAILED: CODE(0x32d1568) unexpected , output="/var/spool/amavisd/tmp/amavis-20140212T092705-01401-iNC5oOO9/parts: lstat() failed: Permission denied. ERROR\n" at (eval 116) line 897.
Feb 12 09:27:06 dmzsvr14v amavis[1401]: (01401-01) (!)WARN: all primary virus scanners failed, considering backups

There appears to be a permissions error that is causing ClamAV to fail? I've checked that clamd is running.

Thanks!
Luke

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: ClamAV Failed (permissions error)

Please show us output of below commands, we need to know the permission on below directories:

# ls -dl /var/spool/amavisd/
# ls -l /var/spool/amavisd/

3

Re: ClamAV Failed (permissions error)

ZhangHuangbin wrote:

Please show us output of below commands, we need to know the permission on below directories:

# ls -dl /var/spool/amavisd/
# ls -l /var/spool/amavisd/

Here you go:

ls -l /var/spool/amavisd/
total 52
srwxr-x---    1 amavis amavis     0 Feb 13 05:56 amavisd.sock
drwx------.   2 amavis amavis  4096 Feb 13 05:56 db
drwx------.   2 amavis amavis  4096 Dec  2 10:34 quarantine
drwx------. 554 amavis amavis 40960 Feb 13 10:31 tmp
ls -dl /var/spool/amavisd/
drwx--x---. 7 amavis amavis 4096 Feb 13 05:56 /var/spool/amavisd/

4

Re: ClamAV Failed (permissions error)

What's the system user ClamAV service running as? Please add ClamAV user to Amavisd group "amavis". for example:

# usermod clamav -G amavis

Also, set permission 0750 to /var/spool/amavisd/tmp:

# chmod -R 0750 /var/spool/amavisd/tmp

If it doesn't work, try 0770 instead.