<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">So I guess you have explicitly set (probably in /etc/amavis/conf.d/50-user):<br></div><div class="gmail_default" style="font-size:small">$MYHOME = '/var/amavis';</div><div class="gmail_default" style="font-size:small">whereas the preset in debian/ubuntu package of amavis is:</div><div class="gmail_default" style="font-size:small">$MYHOME = '/var/lib/amavis';</div><div class="gmail_default" style="font-size:small">... or maybe you built amavis from source?<br></div><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small"></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 22 May 2019 at 15:28, Alexander Azeev <<a href="mailto:artang89@gmail.com">artang89@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Question about selinux from <a href="mailto:uhlar@fantomas.sk" target="_blank">uhlar@fantomas.sk</a> got me thinking.<div>As it turns out, the issue was with apparmor.</div><div><br></div><div>In /etc/apparmor.d/usr.sbin.clamd there is a line:</div><div>"# For amavisd-new integration <br>/var/lib/amavis/tmp/** r, "<br></div><div><br></div><div>I changed it to "/var/amavis/tmp/** r,", rebooted and it works now!</div><div>Thanks everyone for helping.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 22 мая 2019 г. в 16:42, Patrick Ben Koetter <<a href="mailto:p@sys4.de" target="_blank">p@sys4.de</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Alexander,<br>
<br>
I've just checked on an Ubuntu 14 LTS and I want you to check this too:<br>
<br>
What are the permissions where amavis stores messages (and parts)? In my case<br>
the directory (NOTE: Your's seems to be /var/amavis/tmp/? Is that correct?) is<br>
0755 for amavis:amavis:<br>
<br>
# ls -ld /var/lib/amavis/tmp/<br>
drwxr-xr-x 19 amavis amavis 380 May 22 15:27 /var/lib/amavis/tmp/<br>
<br>
Clamav is in group amavis:<br>
# id clamav<br>
uid=110(clamav) gid=117(clamav) groups=117(clamav),119(amavis)<br>
<br>
Amavis is in group amavis:<br>
# id amavis<br>
uid=112(amavis) gid=119(amavis) groups=119(amavis)<br>
<br>
Did you restart clamav after you added its user to amavis' group?<br>
Can you confirm the same settings?<br>
<br>
Tanks<br>
<br>
p@rick<br>
<br>
<br>
* Alexander Azeev <<a href="mailto:artang89@gmail.com" target="_blank">artang89@gmail.com</a>>:<br>
> Ubuntu 18.04.1 LTS, selinux is disabled.<br>
> <br>
> getenforce<br>
> Command 'getenforce' not found, but can be installed with:<br>
> sudo apt install selinux-utils<br>
> <br>
> ср, 22 мая 2019 г. в 15:46, Matus UHLAR - fantomas <<a href="mailto:uhlar@fantomas.sk" target="_blank">uhlar@fantomas.sk</a>>:<br>
> <br>
> > >> >> On Tue, 21 May 2019 at 14:54, Alexander Azeev <<a href="mailto:artang89@gmail.com" target="_blank">artang89@gmail.com</a>><br>
> > wrote:<br>
> > >> >>> Hello, I have a problem with clamd not being able to scan mail<br>
> > properly.<br>
> > >> >>> In the amavis log there are messages like:<br>
> > >> >>><br>
> > >> >>> run_av (ClamAV-clamd) result:<br>
> > >> >>> /var/amavis/tmp/amavis-20190518T065844-01954-dOjV4CBP/parts: lstat()<br>
> > >> >>> failed: Permission denied.<br>
> > >> >>> ERROR\n/var/amavis/tmp/amavis-20190518T065844-01954-dOjV4CBP/parts:<br>
> > OK\n<br>
> > >> >>> run_av (ClamAV-clamd): CLEAN<br>
> > >> >>> run_av (ClamAV-clamd) result: clean<br>
> > >> >>><br>
> > >> >>> So it passes everything as CLEAN, even the EICAR test virus.<br>
> > >> >>> It seems to be a permissions issue.<br>
> > >> >>> I used this article to check my settings<br>
> > >> >>><br>
> > <a href="https://www.moshe-schmidt.de/linux/clamav-permission-denied-how-to-fix-it/" rel="noreferrer" target="_blank">https://www.moshe-schmidt.de/linux/clamav-permission-denied-how-to-fix-it/</a><br>
> > >> >>> ,<br>
> > >> >>> but everything seems to be correct.<br>
> ><br>
> > >вт, 21 мая 2019 г. в 21:23, Matus UHLAR - fantomas <<a href="mailto:uhlar@fantomas.sk" target="_blank">uhlar@fantomas.sk</a>>:<br>
> > >> did you restart clamav after?<br>
> ><br>
> > On 22.05.19 14:42, Alexander Azeev wrote:<br>
> > >Of course, I did that as well as restarting amavis and even the machine<br>
> > >itself.<br>
> ><br>
> > what os/distro? Don't you run with selinux enabled by any chance?<br>
> > --<br>
> > Matus UHLAR - fantomas, <a href="mailto:uhlar@fantomas.sk" target="_blank">uhlar@fantomas.sk</a> ; <a href="http://www.fantomas.sk/" rel="noreferrer" target="_blank">http://www.fantomas.sk/</a><br>
> > Warning: I wish NOT to receive e-mail advertising to this address.<br>
> > Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.<br>
> > Fighting for peace is like fucking for virginity...<br>
> ><br>
> <br>
> <br>
> -- <br>
> С уважением,<br>
> Азеев Александр<br>
<br>
-- <br>
[*] sys4 AG<br>
<br>
<a href="https://sys4.de" rel="noreferrer" target="_blank">https://sys4.de</a>, +49 (89) 30 90 46 64<br>
Schleißheimer Straße 26/MG,80333 München<br>
<br>
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263<br>
Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief<br>
Aufsichtsratsvorsitzender: Florian Kirstein<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_1089882125480985188gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">С
уважением,</span>
<div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Азеев
Александр</div>
</div>
<br><span></span></div></div></div></div>
</blockquote></div></div>