ok, beim installieren habe ich mir notizen gemacht. sie gelten für CentOS4.4. Bei SuSE bzw. OpenSuSE gibt es einige unterschiede. ich habe sie gesehen bei der sucherei im inet.
es geht los:
############ Amavis/clamav/spamassassin Anleitung für scalix mailserver ##############
1. Repository RPMForge installieren:
cd /tmp
wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
rpm --import RPM-GPG-KEY.dag.txt
rpm -ihv rpmforge-release-0.3.6-1.el4.rf.i386.rpm
yum install yum-plugin-protectbase
Edit the file /etc/yum.conf and add the following line to the [main] section:
mcedit /etc/yum.conf
plugins=1
Edit the file /etc/yum.repos.d/CentOS-Base.repo and add the following line to the [base] and [update] section:
mcedit /etc/yum.repos.d/CentOS-Base.repo
protect=1
Edit /etc/yum.repos.d/CentOS-Base.repo and add the following line to the other sections
protect=0
2. Folgende Pakete installieren:
yum install perl-DBI sendmail-cf sendmail-devel gcc gcc-c++ spamassassin
yum install clamd amavisd-new
3 Wichtig !!! Nicht das fertige Paket nehmen, sondern die neueste Version selbst kompilieren:
wget http://heanet.dl.sourceforge.net/sourceforge/amavisd-milter/amavisd-milter-1.2.1.tar.gz
tar xzvf amavisd-milter-1.2.1.tar.gz
cd amavisd-milter-1.2.1
./configure
make && make install
4.
mcedit /etc/amavisd.conf
folgende Zeile müsse hinzugefügt/kommentiert/unkommentiert werden:
#######################################
$protocol = "AM.PDP"; # Use AM.PDP protocol.
$unix_socketname = "$MYHOME/amavisd.sock"; # uncomment when using milter.
#$inet_socket_port = 10024; #comment out with milter.
$notify_method = 'pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -odd -f ${sender} -- ${recipient}';
$forward_method = undef; #must be set like this with sendmail milter.
$mydomain = "example.com" #Your domain
$myhostname = "cosmo.example.com"; #The FQDN of the Scalix host
$virus_admin = "root\@$mydomain"; #NDR recipient if virus found
$mailfrom_notify_admin = "virusalert\@$mydomain"; #NDR --> admin sender
$sa_tag_level_deflt = -9999; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 3.4; # add 'spam detected' headers at that level
#sa_kill_level_deflt = 6.31; # triggers spam evasive actions
#sa_dsn_cutoff_level = 9; # spam level beyond which a DSN is not sent
#$sa_quarantine_cutoff_level = 20; # spam level beyond which quarantine is off
$sa_spam_subject_tag = '[SPAM] '; # Prepended to the subject line if defined.
### http://www.clamav.net/
['ClamAV-clamd',
\&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
qr/\bOK$/, qr/\bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
###############################################
5. Wenn die datei fehlt, dann neu anlegen:
/etc/sysconfig/amavisd-milter
##############################################
### /etc/sysconfig/amavisd-milter
### Configuration options for amavisd-milter
### Suitable for Redhat & SuSE systems.
#
#
### Amavisd's homedir.
### This should match the '$MYHOME' directive in amavisd.conf
AMAVISD_HOME="/var/amavis"
### Location of milter binary.
MILTER="/usr/local/sbin/amavisd-milter"
### User that amavisd-milter will run as.
### For RH/CentOS/Fedora set to "amavis"
### For SuSE set to "vscan"
AMAVISD_MILTER_USER="amavis"
### This is the socket used for communication between sendmail <--> milter
### It must correspond to the "S=" variable of the milter definition in sendmail.cf
### Note the variable substitution!
MILTER_SOCKET="local:$AMAVISD_HOME/amavisd-milter.sock"
### This is the socket used for communication between amavisd <--> milter
### It must correspond to the value of "$unix_socketname" in amavisd.conf
### Note the variable substitution!
AMAVISD_SOCKET="$AMAVISD_HOME/amavisd.sock"
### Pid file
### Note the variable substitution!
MILTER_PID="$AMAVISD_HOME/amavisd-milter.pid"
### All the args to milter
MILTER_FLAGS="-s $MILTER_SOCKET -p $MILTER_PID -w $AMAVISD_HOME -S $AMAVISD_SOCKET"
########################################
6. Startscript für den selbskompilierten amavisd-milter Dienst
vi /etc/init.d/amavisd-milter
####################################
#!/bin/bash
# Init script for Amavisd-Milter.
# Written by Ben Tisdall
# chkconfig: 2345 78 31
# description: Amavisd Milter Interface
# processname: amavisd-milter
### Read in the standard init functions
source /etc/rc.d/init.d/functions
### Default variables
AMAVIS_USER="amavis"
MILTER_SOCKET=""
MILTER_FLAGS=""
desc="Amavisd Milter Interface"
RETVAL=0
SYSCONFIG="/etc/sysconfig/amavisd-milter"
### Read configuration
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
### MILTER set in /etc/sysconfig/amavisd
prog="${MILTER##*/}"
progdir="${MILTER%/*}"
### Check we have the milter
if ! [ -x $progdir/$prog ]; then
echo -e "\nFATAL ERROR: $progdir/$prog not found and/or not executable, please check your installation.\n"
exit 1
fi
### Functions
start() {
if [ "$MILTER_SOCKET" -a -x "$progdir/$prog" ]; then
echo -n $"Starting $desc ($prog): "
daemon --user "$AMAVIS_USER" $progdir/$prog "$MILTER_FLAGS"
RETVAL=$?
echo
if [ $RETVAL -eq 0 -a -n "$MILTER_PID" -a ! -L "/var/run/${MILTER_PID##*/}" ]; then
ln -s "$MILTER_PID" "/var/run/${MILTER_PID##*/}"
touch /var/lock/subsys/$prog
fi
fi
}
stop() {
if [ "$MILTER_SOCKET" -o -f /var/lock/subsys/$prog ]; then
echo -n $"Shutting down $desc ($prog): "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
fi
return $RETVAL
}
reload() {
echo -n $"Reloading $desc ($prog): "
killproc -HUP $prog
RETVAL=$?
echo
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
restart
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
status)
status $prog
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
RETVAL=1
esac
exit $RETVAL
#####################################
7. Dienst hunzufügen und Rechte anpassen
chkconfig --add amavisd-milter
chkconfig --level 235 amavisd-milter on
chmod 0755 /etc/init.d/amavisd-milter
8.
vi /etc/sysconfig/amavisd
und einfügen:
AMAVIS_SENDMAIL_MILTER="no"
9.
vi /etc/mail/sendmail.mc
und einfügen:
define(`MILTER', 1)dnl
INPUT_MAIL_FILTER(`milter-amavis', `S=local:/var/amavis/amavisd-milter.sock, F=T, T=S:10m;R:10m;E:10m')dnl
danach Befehl ausführen:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Run omsendin to reinsert the Scalix mods:
sudo omsendin
Sendmail.cf überprüfen, ob alles in Ordnung ist:
Find the line:
#O InputMailFilters
O InputMailFilters=milter-amavis
# 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}
O Milter.macros.eom={msg_id}
Under MAIL FILTER DEFINITIONS :
Xmilter-amavis, S=local:/var/amavis/amavisd-milter.sock, F=T, T=S:10m;R:10m;E:10m
10. Zum testen:
edit /etc/sysconfig/sendmail
QUEUE=1m
danach wieder zurück setzen
11. Tetsten ob user claman in der Gruppe amavis ist:
id clamav
wenn nicht, dann einfügen
usermod -G amavis clamav
12. mcedit /etc/clamd.conf
############################
LocalSocket /var/run/clamav/clamd.sock #Must match value in /etc/amavisd.conf
#TCPSocket 3310 #Only use one connection method or clamd won't start.
AllowSupplementaryGroups yes #Avoids a raft of permission issues!
FixStaleSocket yes
#############################
13. mcedit /etc/freshclam.conf
##############################
UpdateLogFile /var/log/clamav/freshclam.log
PidFile /var/clamav/freshclam.pid
NotifyClamd
##########################
14. Starting it all up
service spamassassin start
service clamd start
service amavisd-milter start
service amavisd start
service sendmail restart
15. Configuring Scalix
Backup /var/opt/scalix/??/s/sys/smtpd.cfg and add the following line to the end of the
first section (before [SUBMIT]):
SMTPFILTER=TRUE
### Wenn man diese einstellung macht, dann funzt die lolale Zustellung nicht mehr
16. Restart the Scalix SMTP Relay:
omoff -d0 smtpd && omon smtpd
17. Zum testen
tail -f /var/log/maillog
und mails senden und empfangen
es geht los:
############ Amavis/clamav/spamassassin Anleitung für scalix mailserver ##############
1. Repository RPMForge installieren:
cd /tmp
wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
rpm --import RPM-GPG-KEY.dag.txt
rpm -ihv rpmforge-release-0.3.6-1.el4.rf.i386.rpm
yum install yum-plugin-protectbase
Edit the file /etc/yum.conf and add the following line to the [main] section:
mcedit /etc/yum.conf
plugins=1
Edit the file /etc/yum.repos.d/CentOS-Base.repo and add the following line to the [base] and [update] section:
mcedit /etc/yum.repos.d/CentOS-Base.repo
protect=1
Edit /etc/yum.repos.d/CentOS-Base.repo and add the following line to the other sections
protect=0
2. Folgende Pakete installieren:
yum install perl-DBI sendmail-cf sendmail-devel gcc gcc-c++ spamassassin
yum install clamd amavisd-new
3 Wichtig !!! Nicht das fertige Paket nehmen, sondern die neueste Version selbst kompilieren:
wget http://heanet.dl.sourceforge.net/sourceforge/amavisd-milter/amavisd-milter-1.2.1.tar.gz
tar xzvf amavisd-milter-1.2.1.tar.gz
cd amavisd-milter-1.2.1
./configure
make && make install
4.
mcedit /etc/amavisd.conf
folgende Zeile müsse hinzugefügt/kommentiert/unkommentiert werden:
#######################################
$protocol = "AM.PDP"; # Use AM.PDP protocol.
$unix_socketname = "$MYHOME/amavisd.sock"; # uncomment when using milter.
#$inet_socket_port = 10024; #comment out with milter.
$notify_method = 'pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -odd -f ${sender} -- ${recipient}';
$forward_method = undef; #must be set like this with sendmail milter.
$mydomain = "example.com" #Your domain
$myhostname = "cosmo.example.com"; #The FQDN of the Scalix host
$virus_admin = "root\@$mydomain"; #NDR recipient if virus found
$mailfrom_notify_admin = "virusalert\@$mydomain"; #NDR --> admin sender
$sa_tag_level_deflt = -9999; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 3.4; # add 'spam detected' headers at that level
#sa_kill_level_deflt = 6.31; # triggers spam evasive actions
#sa_dsn_cutoff_level = 9; # spam level beyond which a DSN is not sent
#$sa_quarantine_cutoff_level = 20; # spam level beyond which quarantine is off
$sa_spam_subject_tag = '[SPAM] '; # Prepended to the subject line if defined.
### http://www.clamav.net/
['ClamAV-clamd',
\&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
qr/\bOK$/, qr/\bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
###############################################
5. Wenn die datei fehlt, dann neu anlegen:
/etc/sysconfig/amavisd-milter
##############################################
### /etc/sysconfig/amavisd-milter
### Configuration options for amavisd-milter
### Suitable for Redhat & SuSE systems.
#
#
### Amavisd's homedir.
### This should match the '$MYHOME' directive in amavisd.conf
AMAVISD_HOME="/var/amavis"
### Location of milter binary.
MILTER="/usr/local/sbin/amavisd-milter"
### User that amavisd-milter will run as.
### For RH/CentOS/Fedora set to "amavis"
### For SuSE set to "vscan"
AMAVISD_MILTER_USER="amavis"
### This is the socket used for communication between sendmail <--> milter
### It must correspond to the "S=" variable of the milter definition in sendmail.cf
### Note the variable substitution!
MILTER_SOCKET="local:$AMAVISD_HOME/amavisd-milter.sock"
### This is the socket used for communication between amavisd <--> milter
### It must correspond to the value of "$unix_socketname" in amavisd.conf
### Note the variable substitution!
AMAVISD_SOCKET="$AMAVISD_HOME/amavisd.sock"
### Pid file
### Note the variable substitution!
MILTER_PID="$AMAVISD_HOME/amavisd-milter.pid"
### All the args to milter
MILTER_FLAGS="-s $MILTER_SOCKET -p $MILTER_PID -w $AMAVISD_HOME -S $AMAVISD_SOCKET"
########################################
6. Startscript für den selbskompilierten amavisd-milter Dienst
vi /etc/init.d/amavisd-milter
####################################
#!/bin/bash
# Init script for Amavisd-Milter.
# Written by Ben Tisdall
# chkconfig: 2345 78 31
# description: Amavisd Milter Interface
# processname: amavisd-milter
### Read in the standard init functions
source /etc/rc.d/init.d/functions
### Default variables
AMAVIS_USER="amavis"
MILTER_SOCKET=""
MILTER_FLAGS=""
desc="Amavisd Milter Interface"
RETVAL=0
SYSCONFIG="/etc/sysconfig/amavisd-milter"
### Read configuration
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
### MILTER set in /etc/sysconfig/amavisd
prog="${MILTER##*/}"
progdir="${MILTER%/*}"
### Check we have the milter
if ! [ -x $progdir/$prog ]; then
echo -e "\nFATAL ERROR: $progdir/$prog not found and/or not executable, please check your installation.\n"
exit 1
fi
### Functions
start() {
if [ "$MILTER_SOCKET" -a -x "$progdir/$prog" ]; then
echo -n $"Starting $desc ($prog): "
daemon --user "$AMAVIS_USER" $progdir/$prog "$MILTER_FLAGS"
RETVAL=$?
echo
if [ $RETVAL -eq 0 -a -n "$MILTER_PID" -a ! -L "/var/run/${MILTER_PID##*/}" ]; then
ln -s "$MILTER_PID" "/var/run/${MILTER_PID##*/}"
touch /var/lock/subsys/$prog
fi
fi
}
stop() {
if [ "$MILTER_SOCKET" -o -f /var/lock/subsys/$prog ]; then
echo -n $"Shutting down $desc ($prog): "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
fi
return $RETVAL
}
reload() {
echo -n $"Reloading $desc ($prog): "
killproc -HUP $prog
RETVAL=$?
echo
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
restart
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
status)
status $prog
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
RETVAL=1
esac
exit $RETVAL
#####################################
7. Dienst hunzufügen und Rechte anpassen
chkconfig --add amavisd-milter
chkconfig --level 235 amavisd-milter on
chmod 0755 /etc/init.d/amavisd-milter
8.
vi /etc/sysconfig/amavisd
und einfügen:
AMAVIS_SENDMAIL_MILTER="no"
9.
vi /etc/mail/sendmail.mc
und einfügen:
define(`MILTER', 1)dnl
INPUT_MAIL_FILTER(`milter-amavis', `S=local:/var/amavis/amavisd-milter.sock, F=T, T=S:10m;R:10m;E:10m')dnl
danach Befehl ausführen:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Run omsendin to reinsert the Scalix mods:
sudo omsendin
Sendmail.cf überprüfen, ob alles in Ordnung ist:
Find the line:
#O InputMailFilters
O InputMailFilters=milter-amavis
# 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}
O Milter.macros.eom={msg_id}
Under MAIL FILTER DEFINITIONS :
Xmilter-amavis, S=local:/var/amavis/amavisd-milter.sock, F=T, T=S:10m;R:10m;E:10m
10. Zum testen:
edit /etc/sysconfig/sendmail
QUEUE=1m
danach wieder zurück setzen
11. Tetsten ob user claman in der Gruppe amavis ist:
id clamav
wenn nicht, dann einfügen
usermod -G amavis clamav
12. mcedit /etc/clamd.conf
############################
LocalSocket /var/run/clamav/clamd.sock #Must match value in /etc/amavisd.conf
#TCPSocket 3310 #Only use one connection method or clamd won't start.
AllowSupplementaryGroups yes #Avoids a raft of permission issues!
FixStaleSocket yes
#############################
13. mcedit /etc/freshclam.conf
##############################
UpdateLogFile /var/log/clamav/freshclam.log
PidFile /var/clamav/freshclam.pid
NotifyClamd
##########################
14. Starting it all up
service spamassassin start
service clamd start
service amavisd-milter start
service amavisd start
service sendmail restart
15. Configuring Scalix
Backup /var/opt/scalix/??/s/sys/smtpd.cfg and add the following line to the end of the
first section (before [SUBMIT]):
SMTPFILTER=TRUE
### Wenn man diese einstellung macht, dann funzt die lolale Zustellung nicht mehr
16. Restart the Scalix SMTP Relay:
omoff -d0 smtpd && omon smtpd
17. Zum testen
tail -f /var/log/maillog
und mails senden und empfangen