<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/clamav'
         s:cUser='kron'
         s:oUser=''
         s:mUser='kron'>
        <s:name>knowledgebase/linux/miscapplications/clamav</s:name>
        <s:content>__ClamAV with Procmail__&#xD;&#xA;&#xD;&#xA;Using procmail is an easy way to use ClamAV with Postfix, or Sendmail (although the Sendmail milter below is probably better for Sendmail users).&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;SHELL=/bin/sh&#xD;&#xA;DROPPRIVS=yes&#xD;&#xA;&#xD;&#xA;AV_REPORT=`clamscan --stdout --disable-summary - | cut -d: -f 2`&#xD;&#xA;VIRUS=`if [ &quot;$AV_REPORT&quot; != &quot; OK&quot; ]; then echo Yes; else echo No;fi`&#xD;&#xA;&#xD;&#xA;:0fw&#xD;&#xA;| formail -i &quot;X-Virus: $VIRUS&quot;&#xD;&#xA;:0:&#xD;&#xA;* ^X-Virus: Yes&#xD;&#xA;$HOME/mail/junkbox&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;__ClamAV with Sendmail Milter__&#xD;&#xA;&#xD;&#xA;Download the Clam AV RPMs from http://dag.wieers.com/packages/clamav/&#xD;&#xA;&#xD;&#xA;Install the RPMs&#xD;&#xA;{code}&#xD;&#xA;rpm -Uvh clam*&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Check Sendmail supports MILTER&#xD;&#xA;{code}&#xD;&#xA;sendmail -d0 &lt; /dev/null | grep MILTER MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Change clamd to run with a socket&#xD;&#xA;{code}&#xD;&#xA;vi /etc/clamd.conf&#xD;&#xA;{code}&#xD;&#xA;Uncomment: #LocalSocket /var/run/clamav/clmilter.socket&#xD;&#xA;Comment out TCPSocket&#xD;&#xA;&#xD;&#xA;Configure Sendmail to use the milter&#xD;&#xA;{code}&#xD;&#xA;vi /etc/mail/sendmail.mc&#xD;&#xA;{code}&#xD;&#xA;Add: (one line)&#xD;&#xA;INPUT_MAIL_FILTER(`clamav&apos;, `S=local:/var/run/clamav/clmilter.socket, F=T, T=S:4m;R:4m&apos;)&#xD;&#xA;&#xD;&#xA;Make sure ClamAV and Sendmail are using the same socket.&#xD;&#xA;{code}&#xD;&#xA;vi /etc/sysconfig/clamav-milter&#xD;&#xA;{code}&#xD;&#xA;Change the socket location to &quot;/var/run/clamav/clmilter.socket&quot;&#xD;&#xA;&#xD;&#xA;Restart all the services&#xD;&#xA;{code}&#xD;&#xA;/etc/init.d/clamd start&#xD;&#xA;/etc/init.d/clam-av-milter start&#xD;&#xA;/etc/init.d/sendmail restart&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Send a test email and check for the ClamAV headers.&#xD;&#xA;&#xD;&#xA;__Clam AV and Procmail__&#xD;&#xA;&#xD;&#xA;Add this to /etc/procmailrc to have the suspicious emails go elsewhere:&#xD;&#xA;{code}&#xD;&#xA;:0:&#xD;&#xA;* ^X-Virus-Scan: Suspicious&#xD;&#xA;virus&#xD;&#xA;{code}</s:content>
        <s:mTime>2006-08-22 20:45:23.0</s:mTime>
        <s:cTime>2005-08-25 23:35:38.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/clamav/'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/ajax autocomplete'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix with amavis and mysql'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin on debian sarge'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/filtered webmin'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/rimuhosting ssh access'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
