Outils pour utilisateurs

Outils du site


admin:services:mail

Ceci est une ancienne révision du document !


< retour à la page de l'administration technique

Serveur email

Le serveur mail de FedeRez est Postfix. Le filtrage de spam est effectué par Postgrey, amavisd-new, SpamAssassin et ClamAV. Les emails sortants sont signés par OpenDKIM.

Ce serveur gère aussi les mailing-lists.

Installation

# aptitude install postfix postgrey
# aptitude install amavisd-new clamav clamav-daemon clamav-freshclam
# aptitude install spamassassin bzip2 libnet-ph-perl libnet-snpp-perl libnet-telnet-perl
# aptitude install lha arj rar unrar unrar-free nomarch lzop cabextract razor pyzor p7zip-full pax zip unzip lha zoo

Postfix

# dpkg-reconfigure postfix
System mail name : hexagon.federez.net
root and postmaster mail recipient : admin@federez.net
Other destinations to accept mail for : federez.net, hexagon.federez.net, etc.
Force synchronous updates on mail queue : No
Local networks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
Use procmail for local delivery : Yes
Mailbox size limite : 0
Local address extension character: +
Internet protocols to use: all

Postgrey

Dans /etc/default/postgrey :

POSTGREY_OPTS="--inet=127.0.0.1:10023 --delay=65 --max-age=40 --retry-window=5h --auto-whitelist-clients=3"
POSTGREY_TEXT="Unable to accept the message now. Please retry later."

Dans /etc/postfix/main.cf :

# postgrey
smtpd_recipient_restrictions = permit_mynetworks,
                               permit_sasl_authenticated,
                               reject_unauth_destination,
                               check_policy_service inet:127.0.0.1:10023

La whitelist est dans /etc/postgrey/whitelist_clients.

Tout relancer :

# kill $(ps aux | grep '/postgrey' | grep -v grep | awk '{print $2}')
# /etc/init.d/postgrey restart
# /etc/init.d/postfix restart

amavisd-new, SpamAssassin et ClamAV

Dans /etc/postfix/master.cf, spécifier un service amavisfeed pour transmettre des messages à amavis et un service d'écoute sur le port 10025 pour récupérer les emails filtrés :

# amavisd-new
amavisfeed unix    -       -       n       -       2     smtp
     -o smtp_data_done_timeout=1200
     -o smtp_send_xforward_command=yes
     -o smtp_tls_note_starttls_offer=no

127.0.0.1:10025 inet n    -       n       -       -     smtpd
     -o content_filter=
     -o smtpd_delay_reject=no
     -o smtpd_client_restrictions=permit_mynetworks,reject
     -o smtpd_helo_restrictions=
     -o smtpd_sender_restrictions=
     -o smtpd_recipient_restrictions=permit_mynetworks,reject
     -o smtpd_data_restrictions=reject_unauth_pipelining
     -o smtpd_end_of_data_restrictions=
     -o smtpd_restriction_classes=
     -o mynetworks=127.0.0.0/8
     -o smtpd_error_sleep_time=0
     -o smtpd_soft_error_limit=1001
     -o smtpd_hard_error_limit=1000
     -o smtpd_client_connection_count_limit=0
     -o smtpd_client_connection_rate_limit=0
     -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
     -o local_header_rewrite_clients=
     -o smtpd_milters=
     -o local_recipient_maps=
     -o relay_recipient_maps=

Dans /etc/postfix/main.cf, déclarer le service de filtrage :

# amavis
content_filter=amavisfeed:[127.0.0.1]:10024
receive_override_options = no_address_mappings

Dans /etc/amavis/conf.d/15-content_filter_mode, activer le filtrage de spam et de virus :

@bypass_virus_checks_maps = (
   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);

Dans /etc/amavis/conf.d/05-domain_id, spécifier les domaines à prendre en compte :

@local_domains_acl = ( ".federez.net", ".federez.org", ".federez.fr", ".federez.eu" );

Dans /etc/spamassassin/local.cf, désactiver l'expiration par SpamAssassin de tokens Bayes :

bayes_auto_expire 0

Activer le lancement de SpamAssassin par le système en modifiant /etc/default/spamassassin :

CRON=1

Enfin, initialiser SpamAssassin, ClamAV et amavisd-new, puis tout relancer :

# adduser clamav amavis
# freshclam
# su debian-spamd -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys"
# /etc/init.d/amavis restart
# /etc/init.d/clamav-freshclam restart
# /etc/init.d/clamav-daemon restart
# /etc/init.d/postfix restart
admin/services/mail.1422267744.txt.gz · Dernière modification : 2015/01/26 11:22 de bertrand.bonnefoy-claudet

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki