{"id":703,"date":"2017-03-21T13:02:11","date_gmt":"2017-03-21T11:02:11","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=703"},"modified":"2017-03-21T13:02:11","modified_gmt":"2017-03-21T11:02:11","slug":"debian-8-how-to-fix-amvavis-reporting-permission-denied-for-clamav","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=703","title":{"rendered":"Debian 8 &#8211; How to fix amvavis reporting \u201cpermission denied\u201d for clamav"},"content":{"rendered":"<div id=\"question-header\">\n<h1><a class=\"question-hyperlink\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav\">How to fix amvavis reporting \u201cpermission denied\u201d for clamav<\/a><\/h1>\n<\/div>\n<div id=\"mainbar\">\n<div id=\"question\" class=\"question\" data-questionid=\"604446\">\n<div id=\"adzerk111600534\" class=\"everyonelovesstackoverflow adzerk-vote\"><img decoding=\"async\" src=\"http:\/\/engine.adzerk.net\/i.gif?e=eyJhdiI6NjMzMDUsImF0Ijo0LCJidCI6MCwiY20iOjUyNjcxNCwiY2giOjE2NTMxLCJjayI6e30sImNyIjoyMDEyMzM1LCJkaSI6IjJkMzY0N2QzMTRkOTRiYzJiNjgyNzhiODJlOGYzZGQwIiwiZG0iOjEsImZjIjoyNDUzODU2LCJmbCI6Mjg1NDU1NywiaXAiOiIxOTMuNDAuMTc4LjEzMCIsImt3IjoicGVybWlzc2lvbnMsYW50aXZpcnVzLGNsYW1hdixhbWF2aXNkLW5ldyx4LWNvbW11bml0eSx4LWhvc3QtYXNrdWJ1bnR1LmNvbSIsIm53IjoyMiwicGMiOjQuNSwiZWMiOjQuNSwicHIiOjY0NjEzLCJydCI6Miwic3QiOjU2NzQ5LCJ1ayI6InVlMS0xOTY5NDgwNzVhMGM0ZTk3OWM5MmU1MDY3ZTZiYWJjYSIsInpuIjoyOSwidHMiOjE0OTAwOTQwNDQzODQsImJmIjp0cnVlLCJwbiI6ImFkemVyazExMTYwMDUzNCIsImZxIjowfQ&amp;s=4igDjJKD5ZlSe4UHBzur_k5SFzM\" width=\"0px\" height=\"0px\" border=\"0\" \/><\/div>\n<table>\n<tbody>\n<tr>\n<td class=\"votecell\">\n<div class=\"vote\"><a class=\"vote-up-off\" title=\"This question shows research effort; it is useful and clear\">up vote<\/a><span class=\"vote-count-post \">5<\/span><a class=\"vote-down-off\" title=\"This question does not show any research effort; it is unclear or not useful\">down vote<\/a><a class=\"star-off\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#\">favorite<\/a><\/p>\n<div class=\"favoritecount\"><b>1<\/b><\/div>\n<\/div>\n<\/td>\n<td class=\"postcell\">\n<div>\n<div class=\"post-text\">\n<p>I&#8217;ve recently noticed a frustrating niggle&#8230; When processing email, an Ubuntu Server (with all the updates applied) reports &#8220;Permission denied&#8221; when trying to virus scan attachments.<\/p>\n<pre><code>Apr  2 14:05:20 svr amavis[6376]: (06376-01) (!)run_av (ClamAV-clamd) FAILED - unexpected , output=\"\/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/parts: lstat() failed: Permission denied. ERROR\\n\"\r\nApr  2 14:05:20 svr amavis[6376]: (06376-01) (!)ClamAV-clamd av-scanner FAILED: CODE(0x30cf250) unexpected , output=\"\/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/parts: lstat() failed: Permission denied. ERROR\\n\" at (eval 136) line 899.\r\nApr  2 14:05:20 svr amavis[6376]: (06376-01) (!)WARN: all primary virus scanners failed, considering backups\r\n<\/code><\/pre>\n<p>When I look at the directories in question, I see this:<\/p>\n<pre><code>$ ls -ld \/var\/lib\/amavis\/tmp\r\ndrwxrwx--- 4 amavis amavis 4096 Apr  2 14:16 \/var\/lib\/amavis\/tmp\r\n$ ls -ld \/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/\r\ndrwxr-x--- 3 amavis amavis 4096 Apr  2 14:05 \/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/\r\n$ ls -ld \/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/parts                                                                                                                                                                           \r\ndrwxr-x--- 2 amavis amavis 4096 Apr  2 14:16 \/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/parts\r\n<\/code><\/pre>\n<p>I made sure the clamd user is a member of the amavisd group &#8211; but this didn&#8217;t fix anything. Can anyone tell me, specifically, which component wants what permissions &#8211; and&#8230; ideally&#8230; what to do to fix this?<\/p>\n<p><strong>Clarification<\/strong>: I am not looking an explanations of the fundamentals of permissions. I am looking for a solution appropriate to this specific problem &#8211; which, at first glance, at least, looks as if a component of the amavis suite (perhaps clamd) is using the wrong umask value. Of course, this fault may have arisen as a result of a number of bugs or configuration glitches. I am looking, specifically, for the most appropriate resolution for this case&#8230; where a &#8216;vanilla&#8217; amavis\/clamav install fails to access the contents of temporary folders it creates as\/when required to scan inbound email.<\/p>\n<p>I am aware of <a href=\"http:\/\/unix.stackexchange.com\/questions\/91874\/postfix-amavis-new-clamav-permission-denied-error\">this<\/a> similar (non-Ubuntu) question. The Redhat\/Centos answer doesn&#8217;t solve the problem I experience with Ubuntu.<\/p>\n<p>This problem is encountered on &#8220;Ubuntu 14.04.2 LTS&#8221; &#8211; there are no pending updates.<\/p>\n<\/div>\n<div class=\"post-taglist\"><a class=\"post-tag js-gps-track\" title=\"show questions tagged 'permissions'\" href=\"http:\/\/askubuntu.com\/questions\/tagged\/permissions\" rel=\"tag\">permissions<\/a> <a class=\"post-tag js-gps-track\" title=\"show questions tagged 'antivirus'\" href=\"http:\/\/askubuntu.com\/questions\/tagged\/antivirus\" rel=\"tag\">antivirus<\/a> <a class=\"post-tag js-gps-track\" title=\"show questions tagged 'clamav'\" href=\"http:\/\/askubuntu.com\/questions\/tagged\/clamav\" rel=\"tag\">clamav<\/a> <a class=\"post-tag js-gps-track\" title=\"show questions tagged 'amavisd-new'\" href=\"http:\/\/askubuntu.com\/questions\/tagged\/amavisd-new\" rel=\"tag\">amavisd-new<\/a><\/div>\n<table class=\"fw\">\n<tbody>\n<tr>\n<td class=\"vt\">\n<div class=\"post-menu\"><a id=\"link-post-604446\" class=\"short-link\" title=\"short permalink to this question\" href=\"http:\/\/askubuntu.com\/q\/604446\">share<\/a><a class=\"suggest-edit-post\" title=\"\" href=\"http:\/\/askubuntu.com\/posts\/604446\/edit\">improve this question<\/a><\/div>\n<\/td>\n<td class=\"post-signature\" align=\"right\">\n<div class=\"user-info \">\n<div class=\"user-action-time\"><a title=\"show all edits to this post\" href=\"http:\/\/askubuntu.com\/posts\/604446\/revisions\">edited <span class=\"relativetime\" title=\"2015-04-04 13:31:46Z\">Apr 4 &#8217;15 at 13:31<\/span><\/a><\/div>\n<div class=\"user-gravatar32\"><\/div>\n<div class=\"user-details\"><\/div>\n<\/div>\n<\/td>\n<td class=\"post-signature owner\">\n<div class=\"user-info \">\n<div class=\"user-action-time\">asked <span class=\"relativetime\" title=\"2015-04-02 13:26:00Z\">Apr 2 &#8217;15 at 13:26<\/span><\/div>\n<div class=\"user-gravatar32\">\n<div class=\"gravatar-wrapper-32\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gravatar.com\/avatar\/6434f37c6ce6daa400fc98f4cacd097e?s=32&amp;d=identicon&amp;r=PG\" alt=\"\" width=\"32\" height=\"32\" \/><\/div>\n<\/div>\n<div class=\"user-details\"><a href=\"http:\/\/askubuntu.com\/users\/272038\/asteve\">aSteve<\/a><\/p>\n<div class=\"-flair\"><span class=\"reputation-score\" dir=\"ltr\" title=\"reputation score \">174<\/span><span title=\"2 gold badges\"><span class=\"badgecount\">2<\/span><\/span><span title=\"3 silver badges\"><span class=\"badgecount\">3<\/span><\/span><span title=\"15 bronze badges\"><span class=\"badgecount\">15<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"votecell\"><\/td>\n<td>\n<div id=\"comments-604446\" class=\"comments \">\n<table>\n<tbody data-remaining-comments-count=\"0\" data-canpost=\"false\" data-cansee=\"true\" data-comments-unavailable=\"false\" data-addlink-disabled=\"true\">\n<tr id=\"comment-844527\" class=\"comment \">\n<td>\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">The group <code>amavis<\/code> has no write permissions for <code>\/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/<\/code> and <code>\/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/pa\u200c\u200brts<\/code><\/span> \u2013\u00a0<a class=\"comment-user\" title=\"52,407 reputation\" href=\"http:\/\/askubuntu.com\/users\/367165\/a-b\">A.B.<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment844527_604446\"><span class=\"relativetime-clean\" title=\"2015-04-02 14:31:10Z\">Apr 2 &#8217;15 at 14:31<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<tr id=\"comment-844531\" class=\"comment \">\n<td>\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">Try this <code>chmod -R g+w \/var\/lib\/amavis\/tmp<\/code><\/span> \u2013\u00a0<a class=\"comment-user\" title=\"52,407 reputation\" href=\"http:\/\/askubuntu.com\/users\/367165\/a-b\">A.B.<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment844531_604446\"><span class=\"relativetime-clean\" title=\"2015-04-02 14:35:21Z\">Apr 2 &#8217;15 at 14:35<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<tr id=\"comment-844816\" class=\"comment \">\n<td>\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">The problem isn&#8217;t that I can&#8217;t change the permissions to permit group write on the directories&#8230; The problem is that I don&#8217;t know how to ensure that directories created under \/var\/lib\/amavis\/tmp\/ &#8211; in future &#8211; get created with the correct permissions. This directory seems to be where amavis expands messages to inspect attachments. The defaults used to work&#8230; now, after some updates, it doesn&#8217;t.<\/span> \u2013\u00a0<a class=\"comment-user owner\" title=\"174 reputation\" href=\"http:\/\/askubuntu.com\/users\/272038\/asteve\">aSteve<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment844816_604446\"><span class=\"relativetime-clean\" title=\"2015-04-02 20:57:52Z\">Apr 2 &#8217;15 at 20:57<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<tr id=\"comment-845781\" class=\"comment \">\n<td>\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">Then work on your question.<\/span> \u2013\u00a0<a class=\"comment-user\" title=\"52,407 reputation\" href=\"http:\/\/askubuntu.com\/users\/367165\/a-b\">A.B.<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment845781_604446\"><span class=\"relativetime-clean\" title=\"2015-04-04 09:43:32Z\">Apr 4 &#8217;15 at 9:43<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div id=\"comments-link-604446\" data-rep=\"50\" data-anon=\"true\"><a class=\"js-add-link comments-link disabled-link \" title=\"Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.\">add a comment<\/a><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div id=\"answers\"><a name=\"tab-top\"><\/a><\/p>\n<div id=\"answers-header\">\n<div class=\"subheader answers-subheader\">\n<h2>4 Answers<\/h2>\n<div>\n<div id=\"tabs\"><a title=\"Answers with the latest activity first\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav?answertab=active#tab-top\" data-nav-xhref=\"\" data-value=\"active\" data-shortcut=\"A\">active<\/a><a title=\"Answers in the order they were provided\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav?answertab=oldest#tab-top\" data-nav-xhref=\"\" data-value=\"oldest\" data-shortcut=\"O\">oldest<\/a><a class=\"youarehere\" title=\"Answers with the highest score first\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav?answertab=votes#tab-top\" data-nav-xhref=\"\" data-value=\"votes\" data-shortcut=\"V\">votes<\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><a name=\"662672\"><\/a><\/p>\n<div id=\"answer-662672\" class=\"answer\" data-answerid=\"662672\">\n<table>\n<tbody>\n<tr>\n<td class=\"votecell\">\n<div class=\"vote\"><a class=\"vote-up-off\" title=\"This answer is useful\">up vote<\/a><span class=\"vote-count-post \">8<\/span><a class=\"vote-down-off\" title=\"This answer is not useful\">down vote<\/a><\/div>\n<\/td>\n<td class=\"answercell\">\n<div class=\"post-text\">\n<p>A working solution is to change<\/p>\n<p>AllowSupplementaryGroups false -&gt; true<\/p>\n<p>in \/etc\/clamav\/clamd.conf<\/p>\n<p>restart clamav-daemon<\/p>\n<\/div>\n<table class=\"fw\">\n<tbody>\n<tr>\n<td class=\"vt\">\n<div class=\"post-menu\"><a id=\"link-post-662672\" class=\"short-link\" title=\"short permalink to this answer\" href=\"http:\/\/askubuntu.com\/a\/662672\">share<\/a><a class=\"suggest-edit-post\" title=\"\" href=\"http:\/\/askubuntu.com\/posts\/662672\/edit\">improve this answer<\/a><\/div>\n<\/td>\n<td class=\"post-signature\" align=\"right\">\n<div class=\"user-info \">\n<div class=\"user-action-time\">answered <span class=\"relativetime\" title=\"2015-08-17 19:32:32Z\">Aug 17 &#8217;15 at 19:32<\/span><\/div>\n<div class=\"user-gravatar32\">\n<div class=\"gravatar-wrapper-32\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gravatar.com\/avatar\/512c94131fe978926c8f43a9bf5de586?s=32&amp;d=identicon&amp;r=PG\" alt=\"\" width=\"32\" height=\"32\" \/><\/div>\n<\/div>\n<div class=\"user-details\"><a href=\"http:\/\/askubuntu.com\/users\/440601\/war\">war<\/a><\/p>\n<div class=\"-flair\"><span class=\"reputation-score\" dir=\"ltr\" title=\"reputation score \">81<\/span><span title=\"1 silver badge\"><span class=\"badgecount\">1<\/span><\/span><span title=\"1 bronze badge\"><span class=\"badgecount\">1<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"votecell\"><\/td>\n<td>\n<div id=\"comments-662672\" class=\"comments \">\n<table>\n<tbody data-remaining-comments-count=\"0\" data-canpost=\"false\" data-cansee=\"true\" data-comments-unavailable=\"false\" data-addlink-disabled=\"true\">\n<tr id=\"comment-1083754\" class=\"comment \">\n<td class=\"comment-actions\">\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><span class=\"cool\" title=\"number of 'useful comment' votes received\">2<\/span><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">This is what solved it for me (I&#8217;m on Debian Jessie). Adding clamav to the amavis group didn&#8217;t solve it.<\/span> \u2013\u00a0<a class=\"comment-user\" title=\"257 reputation\" href=\"http:\/\/askubuntu.com\/users\/15352\/chmike\">chmike<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment1083754_662672\"><span class=\"relativetime-clean\" title=\"2016-02-06 16:27:49Z\">Feb 6 &#8217;16 at 16:27<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<tr id=\"comment-1241324\" class=\"comment \">\n<td>\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">The <code>AllowSupplementaryGroups<\/code> option has been dropped in recent versions of clamav (0.99.2+, Jun 2, 2016 in upstream).<\/span> \u2013\u00a0<a class=\"comment-user\" title=\"296 reputation\" href=\"http:\/\/askubuntu.com\/users\/108536\/daniel-v%c3%a9rit%c3%a9\">Daniel V\u00e9rit\u00e9<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment1241324_662672\"><span class=\"relativetime-clean\" title=\"2016-08-31 02:35:30Z\">Aug 31 &#8217;16 at 2:35<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<tr id=\"comment-1379528\" class=\"comment \">\n<td>\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">+1 This worked. The approved answer below DOES NOT. If you followed the Ubuntu AmavisNew wiki page (hopefully), you would have already added amavis\/clamav as supplementary groups to one another. Approved answer does nothing but repeat this &#8211; and does not work. I am running default pkgs on 16.04.1 LTS. ref: <a href=\"https:\/\/help.ubuntu.com\/community\/PostfixAmavisNew\" rel=\"nofollow noreferrer\">help.ubuntu.com\/community\/PostfixAmavisNew<\/a><\/span> \u2013\u00a0<a class=\"comment-user\" title=\"102 reputation\" href=\"http:\/\/askubuntu.com\/users\/169878\/bshea\">bshea<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment1379528_662672\"><span class=\"relativetime-clean\" title=\"2017-02-16 17:46:48Z\">Feb 16 at 17:46<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<tr id=\"comment-1379537\" class=\"comment \">\n<td>\n<table>\n<tbody>\n<tr>\n<td class=\" comment-score\"><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td class=\"comment-text\">\n<div class=\"comment-body\"><span class=\"comment-copy\">Specifically: <a href=\"https:\/\/help.ubuntu.com\/community\/PostfixAmavisNew#Troubleshooting\" rel=\"nofollow noreferrer\">help.ubuntu.com\/community\/PostfixAmavisNew#Troubleshooting<\/a><\/span> \u2013\u00a0<a class=\"comment-user\" title=\"102 reputation\" href=\"http:\/\/askubuntu.com\/users\/169878\/bshea\">bshea<\/a> <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"http:\/\/askubuntu.com\/questions\/604446\/how-to-fix-amvavis-reporting-permission-denied-for-clamav#comment1379537_662672\"><span class=\"relativetime-clean\" title=\"2017-02-16 17:55:38Z\">Feb 16 at 17:55<\/span><\/a><\/span><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div id=\"comments-link-662672\" data-rep=\"50\" data-anon=\"true\"><a class=\"js-add-link comments-link disabled-link \" title=\"Use comments to ask for more information or suggest improvements. Avoid comments like \u201c+1\u201d or \u201cthanks\u201d.\">add a comment<\/a><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div id=\"adzerk1379464513\" class=\"everyonelovesstackoverflow adzerk-vote\"><img decoding=\"async\" src=\"http:\/\/engine.adzerk.net\/i.gif?e=eyJhdiI6NDE0LCJhdCI6NCwiYnQiOjAsImNtIjozNzM4NjIsImNoIjoxNjUzMSwiY2siOnt9LCJjciI6MTQ1MTYzNSwiZGkiOiJlNjM2YWM4NDAxZDY0NDdlODhkNmI4NDA1ZTdkMDc3MyIsImRtIjoxLCJmYyI6MTY3NDM2NSwiZmwiOjE1MzMwNzIsImlwIjoiMTkzLjQwLjE3OC4xMzAiLCJrdyI6InBlcm1pc3Npb25zLGFudGl2aXJ1cyxjbGFtYXYsYW1hdmlzZC1uZXcseC1jb21tdW5pdHkseC1ob3N0LWFza3VidW50dS5jb20iLCJudyI6MjIsInBjIjowLCJlYyI6MCwicHIiOjU3MjIyLCJydCI6Miwic3QiOjU2NzQ5LCJ1ayI6InVlMS0xOTY5NDgwNzVhMGM0ZTk3OWM5MmU1MDY3ZTZiYWJjYSIsInpuIjozMCwidHMiOjE0OTAwOTQwNDQzODUsImJmIjp0cnVlLCJwbiI6ImFkemVyazEzNzk0NjQ1MTMiLCJmcSI6MH0&amp;s=BHUsCenaLCKCyI42fVGwPKTEbBI\" width=\"0px\" height=\"0px\" border=\"0\" \/><\/div>\n<p><a name=\"605585\"><\/a><\/p>\n<div id=\"answer-605585\" class=\"answer accepted-answer\" data-answerid=\"605585\">\n<table>\n<tbody>\n<tr>\n<td class=\"votecell\">\n<div class=\"vote\"><a class=\"vote-up-off\" title=\"This answer is useful\">up vote<\/a><span class=\"vote-count-post \">4<\/span><a class=\"vote-down-off\" title=\"This answer is not useful\">down vote<\/a><span class=\"vote-accepted-on load-accepted-answer-date\" title=\"loading when this answer was accepted...\">accepted<\/span><\/div>\n<\/td>\n<td class=\"answercell\">\n<div class=\"post-text\">\n<p>While the <code>clamd<\/code> user was a member of the <code>amavis<\/code> group, the <code>clamd<\/code> process was running as the <code>clamav<\/code> (not <code>clamd<\/code>) user.<\/p>\n<p>Adding <code>clamav<\/code> to the <code>amavis<\/code> group solved the issue.<\/p>\n<\/div>\n<table class=\"fw\">\n<tbody>\n<tr>\n<td class=\"vt\">\n<div class=\"post-menu\"><a id=\"link-post-605585\" class=\"short-link\" title=\"short permalink to this answer\" href=\"http:\/\/askubuntu.com\/a\/605585\">share<\/a><a class=\"suggest-edit-post\" title=\"\" href=\"http:\/\/askubuntu.com\/posts\/605585\/edit\">improve this answer<\/a><\/div>\n<\/td>\n<td class=\"post-signature\" align=\"right\">\n<div class=\"user-info user-hover\">\n<div class=\"user-action-time\"><a title=\"show all edits to this post\" href=\"http:\/\/askubuntu.com\/posts\/605585\/revisions\">edited <span class=\"relativetime\" title=\"2015-04-10 23:05:20Z\">Apr 10 &#8217;15 at 23:05<\/span><\/a><\/div>\n<div class=\"user-gravatar32\">\n<div class=\"gravatar-wrapper-32\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.stack.imgur.com\/ZuYFV.png?s=32&amp;g=1\" alt=\"\" width=\"32\" height=\"32\" \/><\/div>\n<\/div>\n<div class=\"user-details\"><a href=\"http:\/\/askubuntu.com\/users\/26246\/user-dz\">user.dz<\/a><\/p>\n<div class=\"-flair\"><span class=\"reputation-score\" dir=\"ltr\" title=\"reputation score 27,613\">27.6k<\/span><span title=\"9 gold badges\"><span class=\"badgecount\">9<\/span><\/span><span title=\"62 silver badges\"><span class=\"badgecount\">62<\/span><\/span><span title=\"129 bronze badges\"><span class=\"badgecount\">129<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<\/td>\n<td class=\"post-signature owner\" align=\"right\">\n<div class=\"user-info \">\n<div class=\"user-action-time\">answered <span class=\"relativetime\" title=\"2015-04-05 12:13:26Z\">Apr 5 &#8217;15 at 12:13<\/span><\/div>\n<div class=\"user-gravatar32\">\n<div class=\"gravatar-wrapper-32\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gravatar.com\/avatar\/6434f37c6ce6daa400fc98f4cacd097e?s=32&amp;d=identicon&amp;r=PG\" alt=\"\" width=\"32\" height=\"32\" \/><\/div>\n<\/div>\n<div class=\"user-details\"><a href=\"http:\/\/askubuntu.com\/users\/272038\/asteve\">aSteve<\/a><\/p>\n<div class=\"-flair\"><span class=\"reputation-score\" dir=\"ltr\" title=\"reputation score \">174<\/span><span title=\"2 gold badges\"><span class=\"badgecount\">2<\/span><\/span><span title=\"3 silver badges\"><span class=\"badgecount\">3<\/span><\/span><span title=\"15 bronze badges\"><span class=\"badgecount\">15<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"votecell\"><\/td>\n<td>\n<div id=\"comments-link-605585\" data-rep=\"50\" data-anon=\"true\"><a class=\"js-add-link comments-link disabled-link \" title=\"Use comments to ask for more information or suggest improvements. Avoid comments like \u201c+1\u201d or \u201cthanks\u201d.\">add a comment<\/a><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><a name=\"833361\"><\/a><\/p>\n<div id=\"answer-833361\" class=\"answer\" data-answerid=\"833361\">\n<table>\n<tbody>\n<tr>\n<td class=\"votecell\">\n<div class=\"vote\"><a class=\"vote-up-off\" title=\"This answer is useful\">up vote<\/a><span class=\"vote-count-post \">0<\/span><a class=\"vote-down-off\" title=\"This answer is not useful\">down vote<\/a><\/div>\n<\/td>\n<td class=\"answercell\">\n<div class=\"post-text\">\n<p>As <code>AllowSupplementaryGroups<\/code> does not exist anymore, I ended by adding each user to the other group, like this:<\/p>\n<pre><code>usermod -a -G clamav amavis\r\nusermod -a -G amavis clamav\r\n<\/code><\/pre>\n<p>(and restart everything just to be sure)<\/p>\n<pre><code>\/etc\/init.d\/clamav-daemon restart\r\n\/etc\/init.d\/amavis restart\r\n\/etc\/init.d\/postfix restart\r\n<\/code><\/pre>\n<p>With this, no need to change folder permission on <code>\/var\/lib\/amavis\/tmp<\/code> (and I&#8217;m not sure those permissions will be left as is on the next apt-get upgrade&#8230;)<\/p>\n<\/div>\n<table class=\"fw\">\n<tbody>\n<tr>\n<td class=\"vt\">\n<div class=\"post-menu\"><a id=\"link-post-833361\" class=\"short-link\" title=\"short permalink to this answer\" href=\"http:\/\/askubuntu.com\/a\/833361\">share<\/a><a class=\"suggest-edit-post\" title=\"\" href=\"http:\/\/askubuntu.com\/posts\/833361\/edit\">improve this answer<\/a><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to fix amvavis reporting \u201cpermission denied\u201d for clamav up vote5down votefavorite 1 I&#8217;ve recently noticed a frustrating niggle&#8230; When processing email, an Ubuntu Server (with all the updates applied) reports &#8220;Permission denied&#8221; when trying to virus scan attachments. Apr 2 14:05:20 svr amavis[6376]: (06376-01) (!)run_av (ClamAV-clamd) FAILED &#8211; unexpected , output=&#8221;\/var\/lib\/amavis\/tmp\/amavis-20150402T140519-06376-PZcyHfOt\/parts: lstat() failed: Permission [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":621,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-703","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=703"}],"version-history":[{"count":1,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/703\/revisions"}],"predecessor-version":[{"id":704,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/703\/revisions\/704"}],"up":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/621"}],"wp:attachment":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}