sendmail with clamav-milter step by setp installation documentation

From: Mahmud Jami (debianjami_at_yahoo.com)
Date: 09/04/04

  • Next message: spencer ward: "Several questions."
    Date: Sat, 4 Sep 2004 04:10:20 -0700 (PDT)
    To: Debian users <debian-user@lists.debian.org>
    
    

    I have successfully install sendmail with clamav-milter. And it’s running fine. Here I write step by step installation documentation so that anyone can easily install sendmail with clamav-milter at most of Linux distribution.

     

    My installation platform is:

     

    -Sendmail-8.12

    -ClamAV-75

     

    STEP NO.1:

     

    Check that MILTER support is enable at Sendmail. To check it, run the following command:

     

    #sendmail -d0 < /dev/null | grep MILTER

     

    If MILTER support is already enable, this will show the following like message,

     

    DNSMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7

     

    Most of the case you will see that MILTER is enable by default. If MILTER is not enable, then you need to rebuild your sendmail with MILTER support from its binary source.

     

    STEP NO.2:

     

    Check that MILTER library "libmilter*" is installed.

     

    #whereis libmilter

     

    This will show “libmilter” files. If “libmilter” is not installed it can't find any “libmilter” files. In most cases "libmilter" is not installed by default. So, you need to install it. To install “libmilter” you need to download sendmail binary source software from www.sendmail.org depending on your sendmail version. If you are using sendmail-8.12 then you need to download sendmail-8.12 version binary source from www.sendmail.org .

     

    #cd /usr/local/src

    #tar zxvf /usr/local/download/sendmail-8.12.11.tar.gz

    #cd sendmail-8.12.11

    #cd libmilter

    #sh Build install

     

    Now run,

     

    #whereis libmilter

     

    This will locate all "libmilter" related files. At this moment your sendmail is realy to work with Clamav-milter.

     

    STEP NO.3:

     

    Download latest stable clamav source from www.clamav.net .

     

    #cd /usr/local/src

    #tar zxvf clamav-0.75.tar.gz

    #cd clamav-0.75

    #./configure --enable-milter

     

    And check that /usr/local/sbin/clamav-milter is exists.

     

    STEP NO.4:

     

    Read the clamav configuration file /usr/local/etc/clamav.conf and edit it to suit your requirements.

     

    Even you can edit (just uncomment the #) it as:

     

    LogFile /var/log/clamav/clamd.log

    LogFileUnlock

    LogClean

    LogVerbose

    LocalSocket /var/run/clmilter.sock

    FixStaleSocket

    StreamSaveToDisk

    StreamMaxLength 10M

    ScanMail

    ScanArchive

    ScanRAR

    ArchiveMaxFileSize 10M

     

    Then create clamav log file and directory,

     

    #mkdir /var/log/clamav

    #touch /var/log/clamav/clamd.log

    #chown -R clamav.clamav /var/log/clamav

     

    Then run clamd and clamav-milter,

     

    #/usr/local/sbin/clamd

    #sudo /usr/local/sbin/clamav-milter --max-children=2 -olb \

    local:/var/run/clamav-milter.sock

     

    Check that clamd and clamav-milter process is running and its log file.

     

    #ps ax | grep clamd

     

    #tail -f /var/log/clamav/clamd.log

     

    STEP NO.5:

     

    Read and configure the clamav auto updating program freshclam configuration file /usr/local/etc/freshclam.conf.

     

    You can edit it as:

     

    UpdateLogFile /var/log/clamav/freshclam.log

    LogVerbose

    DatabaseMirror database.clamav.net

    MaxAttempts 3

    Checks 12

    Checks 8

    NotifyClamd

     

    Then create freshclam log file and directory

     

    #touch /var/log/clamav/freshclam.log

    #chown -R clamav.clamav /var/log/clamav

     

    Now run freshclam as a daemon,

     

    #/usr/local/bin/freshclam -d

     

    And check log,

     

    #tail -f /var/log/clamav/freshclam.log

     

    STEP NO.6:

     

    Now configure your sendmail to use clamav-milter.sock socket. To do this, edit your sendmail.mc file, rebuild your sendmail.cf file and finally retsart your sendmail service and check log file.

     

    Edit your sendmail.mc and add the following line,

     

    INPUT_MAIL_FILTER(`clamav', `S=local:/var/run/clamav-milter.sock, F=T, T=S:4m;R:4m')

     

    #m4 sendmail.mc > sendmail.cf

    #/etc/init.d/sendmail restart

     

    STEP NO.7:

     

    We need to start our clamav and freshclam automatically with our Linux default runlevel, So we need to create a startup script for clamav and freshclam at /etc/init.d/

     

    #cd /etc/init.d

    #vi clamav.sh

     

    Add the following lines at clamav.sh file:

     

    #!/bin/bash

    #for clamd and clamav-milter

    /usr/local/sbin/clamd

    sudo /usr/local/sbin/clamav-milter --max-children=2 -olb \

    local:/var/run/clamav-milter.sock

     

    #for freshclam as a daemon

    /usr/local/bin/freshclam -d

     

    Save it. Then make it executable,

     

    #chmod u+x clamav.sh

     

    Then run it and check the process,

     

    #./clamav.sh

     

    #ps ax | grep clam

     

    And finally make a soft link with it at your default runlevel. My default runlevel is 3.

     

    #cd /etc/rc.d/rc3.d

    #ln -s /etc/init.d/clamav.sh S80clamav

     

    Reboot and check process and log files so that your clamav, freshclam and sendmail are running properly.

                    
    ---------------------------------
    Do you Yahoo!?
    Win 1 of 4,000 free domain names from Yahoo! Enter now.

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: spencer ward: "Several questions."

    Relevant Pages

    • Re: Clamav problem
      ... >> to error state ... >group writable (or perhaps just post the permissions here). ... How should I do can let clamav-milter start before sendmail? ...
      (comp.unix.bsd.freebsd.misc)
    • Re: Sendmail + clamav-milter...
      ... or not clamav-milter is properly configured and running. ... I'm not sure if I need to install and run clamav-server w/ ... I don't always see something in the email headers though. ... something to do with local email to local email. ...
      (Fedora)
    • Re: need help with clamd, freshclam & clamav-milter setup...
      ... den 01.12.2005 schrieb Mike Leahy um 12:40: ... Fedora Extras packages have extra readmes. ... > (services are all ok, as far as I can tell, sendmail is hooked into ... > clamav-milter). ...
      (Fedora)
    • Sendmail + clamav-milter...
      ... I'm setting up sendmail on FC6 and am having trouble determining whether ... or not clamav-milter is properly configured and running. ... has anyone played with milter-regex or the greylist milter? ...
      (Fedora)
    • Re: clamav-milter problems
      ... The clamav-milter logs show that it has started, ... I don't see any errors in any logs, ... sendmail seems to be ignoring the milter. ... Is Fedora Sendmail built with milter support? ...
      (Fedora)