Sendmail And ClamAV (Slackware 10.0)
December 14th, 2006
Options for clamav compile: add user and group clamav ./configure—enable-milter make make install ###############Configurations clamd.conf #############Start clamd.conf LogFile /var/log/clamav/clamd.log LogTime LogSyslog LogFacility LOG_MAIL PidFile /var/clamav/clamd.pid TemporaryDirectory /var/tmp DatabaseDirectory /var/lib/clamav LocalSocket /var/clamav/clamd.sock FixStaleSocket MaxConnectionQueueLength 30 ReadTimeout 300 MaxDirectoryRecursion 20 User root AllowSupplementaryGroups ScanOLE2 ScanMail ScanArchive ArchiveMaxFileSize 15M ArchiveBlockEncrypted ClamukoScanOnOpen ClamukoScanOnClose ClamukoScanOnExec ClamukoIncludePath /home #############Stop clamd.conf #############Start freshclam.conf DatabaseDirectory /var/lib/clamav UpdateLogFile /var/log/clamav/freshclam.log LogVerbose LogSyslog PidFile /var/clamav/freshclam.pid DatabaseOwner clamav DatabaseMirror database.clamav.net #############Stop freshclam.conf Add FreshClamAV to Crontab: #FreshClamAV 0 0 * * * /usr/local/bin/freshclam—quiet
rc scripts:
rc.clamd: #############Start rc.clamd #!/bin/sh- Start/stop/restart clamd.
- Start clamd: clamd_start() { if [ -x /usr/local/sbin/clamd ]; then echo -n “Starting Clam AntiVirus Daemon: ” /usr/local/sbin/clamd fi }
- Stop clamd: clamd_stop() { killall clamd }
- Restart clamd: clamd_restart() { clamd_stop sleep 1 clamd_start }
- Start/stop/restart clamav-milter.
- Local clamav-milter config
CLAMAV_FLAGS=”
-config-file=/usr/local/etc/clamd.conf—max-children=50—force-scan—dont-log-clean—noreject—bounce—local—outgoing—quarantinedir=/var/mail/quarantine /var/clamav/clmilter.sock”
- Start clamav-milter: clamav_milter_start() { if [ -x /usr/local/sbin/clamav-milter ]; then echo -n “Starting Clamav Milter Daemon: ” rm -rf /var/clamav/clmilter.sock /usr/local/sbin/clamav-milter ${CLAMAV_FLAGS} fi }
- Stop clamav-milter: clamav_milter_stop() { echo -n “Stopping Clamav Milter Daemon: ” killall clamav-milter rm -rf /var/clamav/clmilter.sock }
- Restart clamav-milter: clamav_milter_restart() { clamav-milter_stop sleep 1 clamav-milter_start }
- Start the clamav daemon: if [ -x /etc/rc.d/rc.clamd ]; then . /etc/rc.d/rc.clamd start fi
- Start the clamav-milter daemon: if [ -x /etc/rc.d/rc.clamav-milter ]; then . /etc/rc.d/rc.clamav-milter start fi
- Start the sendmail daemon: if [ -x /etc/rc.d/rc.sendmail ]; then . /etc/rc.d/rc.sendmail start fi Senmail.cf add:
- Input mail filters O InputMailFilters=clmilter
- Milter options
#O Milter.LogLevel
O Milter.macros.connect=j, _, {daemon_name}, {if_name}, {if_addr}
O Milter.macros.helo={tls_version}, {cipher}, {cipher_bits}, {cert_subject}, {cert_issuer}
O Milter.macros.envfrom=i, {auth_type}, {auth_authen}, {auth_ssf}, {auth_author}, {mail_mailer}, {mail_host}, {mail_addr}
O Milter.macros.envrcpt={rcpt_mailer}, {rcpt_host}, {rcpt_addr}
######################################################################
######################################################################
#####
- MAIL FILTER DEFINITIONS ##### ###################################################################### ###################################################################### Xclmilter, S=local:/var/clamav/clmilter.sock,F=, T=S:4m;R:4m
Sendmail add Milter
December 14th, 2006
cd devtools/Site
echo “APPENDDEF” >> site.config.m4
cd ../../
./Build -c
./Build install
.................... ....................
cd ../cf/cf
cp generic-linux.mc sendmail.mc
sh Build sendmail.cf
sh Build install-cf