Author Topic: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!  (Read 11936 times)

0 Members and 1 Guest are viewing this topic.

REDACTED

  • Guest
CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« on: November 06, 2014, 08:55:40 AM »
Good Day.
I`m installed trial Avast (avast.x86_64 1.1.5-1).
in amavisd.conf for avast: (in accordance with the documentation techdoc-avast-linux-en.pdf from avast.com)
### http://www.avast.com
 ['Avast', '/bin/scan', '{}',
  • , [1], qr/\t(.+)/m ],


user for Avast = avast
group=amavis
# cat /etc/group |grep amavis
amavis:x:492:clamav,avast

and follow errors in maillog:
Nov  6 17:06:07 mhub amavis[25669]: (25669-03) (!)run_av (Avast) FAILED - unexpected exit 2, output="avast: /var/amavis/tmp/amavis-20141106T170547-25669-nhiUasHs/parts: Permission denied"
Nov  6 17:06:07 mhub amavis[25669]: (25669-03) (!)Avast av-scanner FAILED: /bin/scan unexpected exit 2, output="avast: /var/amavis/tmp/amavis-20141106T170547-25669-nhiUasHs/parts: Permission denied" at (eval 101) line 897.

]# ls -l /var/amavis/tmp/
total 20
drwxrwx--- 3 amavis amavis 4096 Nov  5 17:41 amavis-20141105T174103-27936-NH7t6HFp
drwxrwx--- 3 amavis amavis 4096 Nov  5 17:42 amavis-20141105T174203-27937-SrYAWrn2
drwxrwx--- 3 amavis amavis 4096 Nov  5 23:11 amavis-20141105T231155-17941-IoU_8hST
drwxrwx--- 3 amavis amavis 4096 Nov  6 17:31 amavis-20141106T173106-27391-mBRhoqWg
drwxrwx--- 3 amavis amavis 4096 Nov  6 17:32 amavis-20141106T173202-27506-BDQx0bMi

# ls -l /var/amavis/tmp/amavis-20141106T173202-27506-BDQx0bMi/
total 8
-rw-r----- 1 amavis amavis 2407 Nov  6 17:51 email.txt
drwxr-x--- 2 amavis amavis 4096 Nov  6 17:51 parts

rights for reading is ok!

clamd works without any errors...

what could be the problem with avast?
« Last Edit: November 07, 2014, 02:28:32 AM by 2opv »

REDACTED

  • Guest
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #1 on: November 06, 2014, 11:47:49 AM »
and other users have same problem.
for example:
amavisd and Avast! scanner - permission problems
https://groups.google.com/forum/#!msg/mailing.unix.amavis-user/s4uf_7K2WPk/FZt0AWYR2q0J

Offline tumic

  • Avast team
  • Advanced Poster
  • *
  • Posts: 723
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #2 on: November 06, 2014, 06:49:54 PM »
Do you have SELinux enabled? Does it start working, if you disable SELinux (and reboot)?

REDACTED

  • Guest
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #3 on: November 07, 2014, 02:21:45 AM »
SElinux is disabled

# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
###SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Offline tumic

  • Avast team
  • Advanced Poster
  • *
  • Posts: 723
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #4 on: November 07, 2014, 06:44:07 PM »
Did you reboot after disabling SElinux? If SElinux is disabled, than it must be some error
with the access rights specific to your setup.

I have installed avast on a clean installation of CentOS 6.6 (amavis from rpmforge)  and it works
for me (If I disable SElinux).

Offline tumic

  • Avast team
  • Advanced Poster
  • *
  • Posts: 723
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #5 on: November 07, 2014, 06:47:28 PM »
Just a note - the av_scanners defiition you posted is broken, the correct one is

Code: [Select]
### http://www.avast.com
['Avast', '/bin/scan', '{}', [0], [1], qr/\t(.+)/m]

But this is probably only a copy&paste error since with such entry amavis would
not work at all I guess.

REDACTED

  • Guest
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #6 on: November 08, 2014, 02:55:35 PM »
Just a note - the av_scanners defiition you posted is broken, the correct one is

Code: [Select]
### http://www.avast.com
['Avast', '/bin/scan', '{}', [0], [1], qr/\t(.+)/m]

But this is probably only a copy&paste error since with such entry amavis would
not work at all I guess.

Yes, It is a copy&paste error....

REDACTED

  • Guest
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #7 on: November 12, 2014, 04:56:05 AM »
Is it possible to start avast daemon from other user (non "avast")?

Offline tumic

  • Avast team
  • Advanced Poster
  • *
  • Posts: 723
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #8 on: November 12, 2014, 12:43:38 PM »
Yes it is. Just create  /etc/sysconfig/avast with the following content:

Code: [Select]
AVAST_USER='another_user'
AVAST_GROUP='another_group'

and change the owner of the avast data directory /var/lib/avast:

Code: [Select]
chown -R another_user:another_group /var/lib/avast

REDACTED

  • Guest
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #9 on: November 12, 2014, 03:23:03 PM »
Ok, Thanks a lot!
It works! For me It runs from 'amavis' user.

Also need to change the owner of the avast run directory  /var/run/avast

#chown -R amavis:amavis /var/run/avast

Problem is solved.
Thanks!

Offline tumic

  • Avast team
  • Advanced Poster
  • *
  • Posts: 723
Re: CentOS 6.5(x64)+Postfix+Amavisd-new+Avast!
« Reply #10 on: November 14, 2014, 12:11:04 AM »
Also need to change the owner of the avast run directory  /var/run/avast

Yes, this is also required, I forgot this one.