8e678e5
A clamav-milter setup consists of the following three components:
019ada6
8e678e5
* the clamav-milter itself
019ada6
8e678e5
  --> this is provided by the 'clamav-milter' package plus (alternatively)
8e678e5
      'clamav-milter-upstart' or 'clamav-milter-sysvinit'
8e678e5
8e678e5
  The main configuration is in /etc/mail/clamav-milter.conf and MUST
8e678e5
  be changed before first use.
8e678e5
8e678e5
  The -sysvinit package is managed by the traditional tools, but
8e678e5
  -upstart requires modification of /etc/event.d/clamav-milter to
8e678e5
  enable automatic startup.  See comments there for more details.
8e678e5
8e678e5
* a clamav scanner daemon
8e678e5
8e678e5
  --> this package is called 'clamav-scanner' plus (alternatively)
8e678e5
      'clamav-scanner-upstart' or 'clamav-scanner-sysvinit'
8e678e5
8e678e5
  The daemon is configured by /etc/clamd.d/scan.conf (which MUST be
8e678e5
  edited before first use).
8e678e5
8e678e5
  The -sysvinit package is managed by the traditional tools, but
8e678e5
  -upstart requires modification of /etc/event.d/clamd.scan to enable
8e678e5
  automatic startup.  See comments there for more details.
8e678e5
5e13498
* the MTA (sendmail/postfix)
8e678e5
8e678e5
  --> you should know how to install this...
8e678e5
8e678e5
  When communicating across unix sockets with the clamav-milter, it is
702bc5a
  suggested to use the /var/run/clamav-milter/clamav-milter.socket
702bc5a
  path.  You have to add something like
8e678e5
702bc5a
    INPUT_MAIL_FILTER(`clamav', `S=local:/var/run/clamav-milter/clamav-milter.socket, F=, T=S:4m;R:4m')dnl
8e678e5
8e678e5
  to your sendmail.mc.
8e678e5
8e678e5
8e678e5
8e678e5
It is suggested that components communicate through TCP sockets as
8e678e5
this eases setup.  Please add corresponding packet filter rules!
702bc5a
702bc5a
702bc5a
EXAMPLE
702bc5a
=======
702bc5a
702bc5a
For clamav-milter, a possible setup might be created by
702bc5a
702bc5a
A)  On the MTA  (assumed hostname 'host-mta')
702bc5a
702bc5a
  1. Add to sendmail.mc
702bc5a
702bc5a
    | INPUT_MAIL_FILTER(`clamav', `S=inet:6666@host-milter, F=, T=S:4m;R:4m')dnl
702bc5a
702bc5a
  2. Rebuild sendmail.cf
702bc5a
702bc5a
702bc5a
B)  On the clamav-milter host (assumed hostname 'host-milter')
702bc5a
702bc5a
  1. Install clamav-milter + clamav-milter-upstart packages
702bc5a
702bc5a
  2. Set in /etc/mail/clamav-milter.conf
702bc5a
702bc5a
    | MilterSocket	inet:6666
702bc5a
    | ClamdSocket	tcp:host-scanner:6665
702bc5a
702bc5a
     and all the other options which are required on your system
702bc5a
702bc5a
  3. Edit /etc/event.d/clamav-milter and uncomment the both
702bc5a
702bc5a
    | start on starting\ local
702bc5a
    | start on starting local
702bc5a
702bc5a
     lines. Restart your system or execute
702bc5a
702bc5a
    | initctl emit starting local
702bc5a
702bc5a
  4. Add something like
702bc5a
702bc5a
    | iptables -N IN-cmilt
702bc5a
    | iptables -A IN-cmilt -s host-mta -j ACCEPT
702bc5a
    | iptables -A IN-cmilt -j DROP
702bc5a
702bc5a
    | iptables -A INPUT -p tcp --dport 6666 -j IN-cmilt
702bc5a
702bc5a
     to your firewall setup
702bc5a
702bc5a
C)  On the clamav-scanner host (assumed hostname 'host-scanner')
702bc5a
702bc5a
  1. Install clamav-scanner + clamav-scanner-upstart packages
702bc5a
702bc5a
  2. Add to /etc/clamd.d/scan.conf
702bc5a
702bc5a
    | TCPSocket 6665
702bc5a
    | TCPAddr   host-scanner
702bc5a
702bc5a
     comment out possible 'LocalSocket' lines and set all the other
702bc5a
     options which are required on your system
702bc5a
702bc5a
  3. Edit /etc/event.d/clamav-scanner and uncomment the both
702bc5a
702bc5a
    | start on starting\ local
702bc5a
    | start on starting local
702bc5a
702bc5a
     lines. Restart your system or execute
702bc5a
702bc5a
    | initctl emit starting local
702bc5a
702bc5a
  4. Add something like
702bc5a
702bc5a
    | iptables -N IN-cscan
702bc5a
    | iptables -A IN-cscan -s host-milter -j ACCEPT
702bc5a
    | iptables -A IN-cscan -j DROP
702bc5a
702bc5a
    | iptables -A INPUT -p tcp --dport 6665 -j IN-csan
702bc5a
702bc5a
     to your firewall setup