RadicalSpam est livré pré-configuré pour obtenir de très bon résultat dès le départ mais il est tout de même nécessaire de personnaliser votre serveur avec les indications ci-après.
[root@linux /]$ cd /tmp [root@linux /]$ wget http://download.radicalspam.org/releases/radicalspam-server-stable.tar.gz [root@linux /]$ wget http://download.radicalspam.org/releases/radicalspam-server-stable.tar.gz.md5 [root@linux /]$ md5sum -c radicalspam-server-stable.tar.gz.md5
[root@linux /]$ cd /var [root@linux /]$ tar --numeric-owner -xzf /tmp/radicalspam-server-stable.tar.gz [root@linux /]$ rm -f /tmp/radicalspam-server-stable.tar.gz*
[root@linux /]$ cd /home [root@linux /]$ tar --numeric-owner -xzf /tmp/radicalspam-server-stable.tar.gz [root@linux /]$ rm -f /tmp/radicalspam-server-stable.tar.gz* [root@linux /]$ ln -sf /home/rs /var/rs
[root@linux /]$ ln -sf /var/rs/etc/scripts/radicalspam /etc/init.d/radicalspam [root@linux /]$ cd /etc/rc3.d/ [root@linux /]$ ln -sf ../init.d/radicalspam S99radicalspam [root@linux /]$ ln -sf ../init.d/radicalspam K01radicalspam
# Si votre installation est conforme, vous devez être en runlevel 2 [root@linux /]$ ln -sf /var/rs/etc/scripts/radicalspam /etc/init.d/radicalspam [root@linux /]$ cd /etc/rc2.d/ [root@linux /]$ ln -sf ../init.d/radicalspam S99radicalspam [root@linux /]$ ln -sf ../init.d/radicalspam K01radicalspam
Après l'installation vous devez configurer syslog ou syslog-ng. Syslog et Syslog-NG fournissent un moyen simple de donner un accès aux applications d'un environnement chroot en créant un socket /dev/log supplémentaire dans le répertoire désigné. Après la modification de syslog/syslog-ng, vous disposerez du socket standard /dev/log et d'un socket supplémentaire dans /var/rs/dev/log.
[root@linux /]$ vi /etc/sysconfig/syslog
SYSLOGD_OPTIONS="-m 0"
SYSLOGD_OPTIONS="-m 60 -r -a /dev/log -a /var/rs/dev/log"
[root@linux /]$ /etc/init.d/syslog restart
[root@linux /]$ vi /etc/sysconfig/syslog
SYSLOGD_ADDITIONAL_SOCKET_RADICALSPAM="/var/rs/dev/log"
[root@linux /]$ /etc/init.d/syslog restart
[root@linux /]$ vi /etc/syslog-ng/syslog-ng.conf
source src { unix-stream("/dev/log"); internal(); };
source src {
unix-stream("/dev/log");
internal();
unix-stream("/var/rs/dev/log");
};
[root@linux /]$ /etc/init.d/syslog-ng restart
[root@linux /]$ vi /etc/syslog-ng/syslog-ng.conf
source s_sys {
file ("/proc/kmsg" log_prefix("kernel: "));
unix-stream ("/dev/log");
internal();
# udp(ip(0.0.0.0) port(514));
# tcp(ip(0.0.0.0) port(514));
};
source s_sys {
file ("/proc/kmsg" log_prefix("kernel: "));
unix-stream ("/dev/log");
internal();
# udp(ip(0.0.0.0) port(514));
# tcp(ip(0.0.0.0) port(514));
unix-stream("/var/rs/dev/log");
};
[root@linux /]$ /etc/init.d/syslog-ng restart
[root@linux /]$ vi /etc/default/syslogd
SYSLOGD=""
SYSLOGD="-m 60 -r -a /dev/log -a /var/rs/dev/log"
[root@linux /]$ /etc/init.d/sysklogd restart
[root@linux /]$ vi /root/.bashrc # Ajoutez en fin de fichier : export PATH=/var/rs/etc/scripts:$PATH
export PATH=/var/rs/etc/scripts:/var/rs/addons/postfix/scripts:$PATH
. /root/.bashrc
Le mode DEBUG est activé par défaut depuis la version 3.5.3. Il vous permet de visualiser les problèmes éventuels d'excution dans le fichier /var/rs/var/log/radicalspam-debug.log.
Pour activer/désactiver le mode DEBUG, tapez la commande suivante :
[root@linux /]$ radicalspam debug
Une configuration correcte du nom d'hôte est capitale pour le bon fonctionnement de la plateforme. N'oubliez pas d'utiliser un nom FQDN (complètement formé hote.domain.xxx) et dans la mesure du possible, le nom correspondant au MX dont RadicalSpam sera le support.
[root@linux /]$ vi /var/rs/etc/radicalspam.conf
Remplacez la valeur par le nom FQDN de votre MX : MY_HOSTNAME="radicalspam.localhost.org"
[root@linux /]$ radicalspam status
La configuration du Postfix est prévu pour gérer la plupart des besoins d'un relais SMTP avec filtrage.
Les modifications des paramètres postfix doivent être ABSOLUMENT gérées à partir des fichiers config-postfix.sh et master.cf
[root@linux /]$ mv /usr/sbin/sendmail /usr/sbin/old-sendmail [root@linux /]$ ln -sf /var/rs/addons/tools/bin/mini_sendmail /usr/sbin/sendmail
Exemple avec CentOS : [root@linux /]$ ln -sf /var/rs/addons/tools/bin/mini_sendmail /etc/alternatives/mta [root@linux /]$ ln -sf /etc/alternatives/mta /usr/sbin/sendmail Regardez d'abord avec 'ls /usr/sbin/sendmail' si la commande est déjà un lien symbolique.
[root@linux /]$ vi /var/rs/addons/postfix/etc/master.cf
# WAN - ETH0 - Interface pour les mails en provenance d'internet 127.0.0.2:smtp inet n - n - - smtpd ... # LAN - ETH1 - Interface pour les mails en provenance du LAN 127.0.0.3:smtp inet n - n - - smtpd ...
Le scénario : - Votre domaine internet : domain.com - L'adresse IP de votre messagerie locale (domino/exchange/autres) : 192.168.10.10 - Vous laissez passer tous les mails entrants à destination de votre domaine
[root@linux /]$ cd /var/rs/addons/postfix/etc
[root@linux /]$ vi local-relays domain.com OK [root@linux /]$ vi local-transport domain.com relay:[192.168.10.10]:25 [root@linux /]$ vi local-directory @domain.com OK [root@linux /]$ vi local-filters domain.com FILTER smtp-amavis:[127.0.0.1]:10024 [root@linux /]$ vi local-mynetworks-lan 192.168.10.10 # Serveur Domino1 [root@linux /]$ vi local-spoofing domain.com REJECT ANTI-SPOOFING
Le système ainsi que différentes applications (cron/logrotate/etc...) génèrent des mails à l'attention du compte root. Si vous ne fournissez pas une correspondance, ces mails risquent d'être perdus.
[root@linux /]$ vi aliases root: mon_adresse@exemple.net
[root@linux /]$ radicalspam postfix_refresh
Avant de lancer les phases suivantes (razor_init, update_clamav, update_sa), il faut impérativement que la résolution DNS fonctionne dans l'environnement CHROOT de RadicalSpam.
[root@linux /]$ radicalspam start_bind
[root@linux /]$ vi /var/rs/etc/resolv.conf
(Doit renvoyer l'adresse IP du serveur Web de !RadicalSpam) [root@linux /]$ chroot /var/rs /addons/bind/bin/host www.radical-spam.org
Remarque : RadicalSpam est configuré pour interroger un serveur DNS local. Si vous ne disposez pas d'un DNS installé sur la même machine et si vous n'utilisez pas l'addons bind fourni à partir de RadicalSpam 3.5, vous devez renseigner le fichier /var/rs/etc/resolv.conf en reprenant les mêmes informations que le fichier /etc/resolv.conf du système hôte.
[root@linux /]$ vi /var/rs/etc/resolv.conf
nameserver 127.0.0.1
[root@linux /]$ radicalspam razor_init
[root@linux /]$ radicalspam update_clamav
[root@linux /]$ radicalspam update_sa
[root@linux /]$ radicalspam start
[root@linux /]$ ln -sf /var/rs/addons/rs-tools/cron/rs-clamav-update.cron /etc/cron.d/rs-clamav-update
[root@linux /]$ ln -sf /var/rs/addons/rs-tools/cron/rs-sa-update.cron /etc/cron.d/rs-sa-update
Maintenant vous êtes prêts pour affiner la configuration -> Configuration