{"id":1129,"date":"2017-02-20T14:03:05","date_gmt":"2017-02-20T19:03:05","guid":{"rendered":"http:\/\/easy-admin.ca\/?p=1129"},"modified":"2017-08-21T10:15:53","modified_gmt":"2017-08-21T14:15:53","slug":"testing-clamav-for-virus-in-emails","status":"publish","type":"post","link":"https:\/\/easy-admin.ca\/index.php\/2017\/02\/20\/testing-clamav-for-virus-in-emails\/","title":{"rendered":"Testing ClamAV for Virus in Emails"},"content":{"rendered":"<p>To verify <strong>ClamAV<\/strong> is working properly, let\u2019s download a test virus (which we can get from http:\/\/www.eicar.org\/download\/eicar.com) to the Maildir<\/p>\n<pre># cd \/home\/[username]\/Maildir\r\n# wget http:\/\/www.eicar.org\/download\/eicar.com<\/pre>\n<p>And then scan the <strong>\/home\/[username]\/Maildir<\/strong> directory recursively:<\/p>\n<pre># clamscan --infected --remove --recursive \/home\/[username]\/Maildir<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1165 size-full\" src=\"https:\/\/easy-admin.ca\/wp-content\/uploads\/2017\/02\/eicar_406e9dc9549025aede2395075968df55.png\" alt=\"\" width=\"640\" height=\"569\" srcset=\"https:\/\/easy-admin.ca\/wp-content\/uploads\/2017\/02\/eicar_406e9dc9549025aede2395075968df55.png 640w, https:\/\/easy-admin.ca\/wp-content\/uploads\/2017\/02\/eicar_406e9dc9549025aede2395075968df55-300x267.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Now, feel free to set up this scan to run through a <strong>cronjob<\/strong>. Create a file named <code>\/etc\/cron.daily\/dailyclamscan<\/code>, insert the following lines:<\/p>\n<pre>#!\/bin\/bash\r\nSCAN_DIR=\"\/home\/[username]\/Maildir\"\r\nLOG_FILE=\"\/var\/log\/clamav\/dailyclamscan.log\"\r\ntouch $LOG_FILE\r\n\/usr\/bin\/clamscan --infected --remove --recursive $SCAN_DIR &gt;&gt; $LOG_FILE\r\n<\/pre>\n<p>and grant execute permissions:<\/p>\n<pre># chmod +x \/etc\/cron.daily\/dailyclamscan\r\n<\/pre>\n<p>The above cronjob will scan the mail server directory recursively and leave a log of its operation in <code>\/var\/log\/clamav\/dailyclamscan.log<\/code> (make sure the <strong>\/var\/log\/clamav<\/strong> directory exists).<\/p>\n<p><strong>NOTES:<\/strong><br \/>\n# man clamscan<br \/>\n# clamscan -r -i \/home<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To verify ClamAV is working properly, let\u2019s download a test virus (which we can get from http:\/\/www.eicar.org\/download\/eicar.com) to the Maildir # cd \/home\/[username]\/Maildir # wget http:\/\/www.eicar.org\/download\/eicar.com And then scan the \/home\/[username]\/Maildir directory recursively: # clamscan &#8211;infected &#8211;remove &#8211;recursive \/home\/[username]\/Maildir Now, feel free to set up this scan to run through a cronjob. Create a file &hellip; <a href=\"https:\/\/easy-admin.ca\/index.php\/2017\/02\/20\/testing-clamav-for-virus-in-emails\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Testing ClamAV for Virus in Emails<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Testing ClamAV for Virus in Emails - HP Server","description":"To verify ClamAV is working properly, let\u2019s download a test virus (which we can get from http:\/\/www.eicar.org\/download\/eicar.com) to the Maildir # cd \/home\/[use"},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1129","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/comments?post=1129"}],"version-history":[{"count":0,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1129\/revisions"}],"wp:attachment":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/media?parent=1129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/categories?post=1129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/tags?post=1129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}