{"id":270,"date":"2011-07-11T10:30:19","date_gmt":"2011-07-11T10:30:19","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=270"},"modified":"2011-07-11T10:30:19","modified_gmt":"2011-07-11T10:30:19","slug":"mailscanner-postfix-clamav-and-spamassassin-setup-rhelcentos-5","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=270","title":{"rendered":"MailScanner, Postfix, ClamAV and SpamAssassin Setup RHEL\/CentOS 5\/6"},"content":{"rendered":"<p>\n\tHello,\n<\/p>\n<p>\n\tthis howto only describes how to configure MailScanner on a CentOS 5 machine. The requirements like Postfix (CentOS repository), ClamAV (EPEL repository) and Spamassassin (CentOS repository) have to be installed and working before you continue.\n<\/p>\n<p>\n\tFirst download MailScanner from their website (<a href=\"http:\/\/www.mailscanner.info\" target=\"_blank\">www.mailscanner.info<\/a>), extract the .tar.gz and execute the install.sh. The script starts now and compiles all needed rpm packages (rpm-build package is needed and has to be installed before with yum). Wait 15 minutes and Mailscanner is installed.\n<\/p>\n<p>\n\tNow let&#39;s configure it:\n<\/p>\n<p>\n\t&#8211; edit the file \/etc\/MailScanner\/MailScanner.conf and set following values\n<\/p>\n<pre class=\"steps\">\n%org-name% = <em>your organization name<\/em>\n%org-long-name% = <em>your full organization name<\/em>\nRun As User = postfix\nRun As Group = postfix\nIncoming Queue Dir = \/var\/spool\/postfix\/hold\nOutgoing Queue Dir = \/var\/spool\/postfix\/incoming\nIncoming Work Group = clam\nIncoming Work Permissions = 0640\nMTA = postfix\nVirus Scanners = clamd\nClamd Socket = \/var\/run\/clamav\/clamd.sock\nUse SpamAssassin = yes\nSpamAssassin User State Dir = \/var\/spool\/MailScanner\/spamassassin<\/pre>\n<p>\n\t&#8211; then go and create the folder \/var\/spool\/MailScanner\/Spamassassin\n<\/p>\n<pre>\n# mkdir \/var\/spool\/MailScanner\/spamassassin<\/pre>\n<p>\n\t&#8211; change permissions&nbsp; to owner postfix and group clamav and restrict access to others\n<\/p>\n<pre>\n# chown -R postfix:clamav \/var\/spool\/MailScanner\/incoming\n# chmod -R 770 \/var\/spool\/MailScanner\/incoming\n# chown -R postfix:clamav \/var\/spool\/MailScanner\/quarantine\n# chmod -R 770 \/var\/spool\/MailScanner\/quarantine\n# chown -R postfix:clamav \/var\/spool\/MailScanner\/spamassassin\n# chmod -R 770 \/var\/spool\/MailScanner\/spamassassin\n<\/pre>\n<p>\n\t&#8211; MailScanner looks for freshclam in a different location than installed so create a symbolic link to it\n<\/p>\n<pre>\n# ln -s \/usr\/bin\/freshclam \/usr\/local\/bin\/freshclam\n<\/pre>\n<p>\n\tok, MailScanner should now be installed and configured now, let&#39;s integrate postfix:\n<\/p>\n<p>\n\t&#8211; edit the \/etc\/postfix\/main.cf and uncomment the line\n<\/p>\n<pre class=\"steps\">\nheader_checks = regexp:\/etc\/postfix\/header_checks\n<\/pre>\n<p>\n\tadd the next line to that file\n<\/p>\n<pre>\n\/^Received:\/ HOLD\n<\/pre>\n<p>\n\tThat&#39;s it&#8230; the postfix service should be started through MailScanner so disable or enable following services:\n<\/p>\n<pre>\n# chkconfig postfix off\n# chkconfig MailScanner on\n# chkconfig spamassassin on\n# chkconfig clamd on\n<\/pre>\n<p>\n\t<strong>UPDATE: If you are using perl 5.10.1 it can be that Mailscanner exits with errors in an endless loop causing high cpu usage and no message delivery or keeps sending messages about problem messages. In that case open \/usr\/sbin\/MailScanner and add the -U parameter to the first line (allow unsafe operations).<\/strong>\n<\/p>\n<p>\n\tsource: <a href=\"http:\/\/www.linuxmail.info\/mailscanner-postfix-clamav-spamassassin-howto-centos-5\/\" target=\"_blank\">http:\/\/www.linuxmail.info\/mailscanner-postfix-clamav-spamassassin-howto-centos-5\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, this howto only describes how to configure MailScanner on a CentOS 5 machine. The requirements like Postfix (CentOS repository), ClamAV (EPEL repository) and Spamassassin (CentOS repository) have to be installed and working before you continue. First download MailScanner from their website (www.mailscanner.info), extract the .tar.gz and execute the install.sh. The script starts now and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[],"class_list":["post-270","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=270"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/270\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}