informatique:reseau:messagerie:amavis

Ceci est une ancienne révision du document !


Exemple de fichier de configuration : //50-user//

use strict;

#
# Place your configuration directives here.  They will override those in
# earlier files.
#
# See /usr/share/doc/amavisd-new/ for documentation and examples of
# the directives you can use in this file
#

# GENERAL
$MYHOME = '/var/lib/amavis';
$mydomain = 'exemple.com';
$myhostname = 'exemple.com';
$max_servers = 4;
$max_requests = 20;
$child_timeout = 5*60;
read_hash(\%local_domains, '/etc/amavis/local_domains');
@mynetworks = qw( 127.0.0.0/8 );
@mynetworks_maps = (\@mynetworks);

# LOGGING AND DEBUGGING
$DO_SYSLOG = 1;

# MTA INTERFACE - INPUT
$inet_socket_port = 10024;
$inet_socket_bind = '127.0.0.1';
@inet_acl = qw(127.0.0.1 [::1]);
$insert_received_line = 0;
$unix_socketname = undef;

# MTA INTERFACE - OUTPUT

# MAIL FORWARDING
$forward_method = 'smtp:[127.0.0.1]:10025';

# QUARANTINE
$QUARANTINEDIR = "$MYHOME/virusmails";

$virus_quarantine_method = 'local:virus-%m';
$spam_quarantine_method = 'local:spam-%m';
$banned_files_quarantine_method = 'local:banned-%m';
$bad_header_quarantine_method = 'local:badh-%m';

$virus_quarantine_to = "virus\@$mydomain;
$banned_quarantine_to     = undef;
$bad_header_quarantine_to = undef;
$spam_quarantine_to       = "spam\@$mydomain";

# NOTIFICATIONS
$notify_method = $forward_method;
$mailfrom_notify_admin     = "postmaster\@$mydomain";
$mailfrom_notify_recip     = "postmaster\@$mydomain";
$mailfrom_notify_spamadmin = "postmaster\@$mydomain";
$warnvirussender = undef;
$warnvirusrecip = undef;
$virus_admin = undef;
$warnbannedsender = undef;
$warnbadhsender = undef;
$warnbannedrecip = undef;
$warnspamsender = undef;
$warn_offsite = 1;

# ADDING ADDRESS EXTENSIONS TO RECIPIENTS - 'plus addressing'

# MAIL DECODING

# BAD HEADER
$final_bad_header_destiny = D_PASS;

# ANTI-VIRUS AND INVALID/FORBIDDEN CONTENTS CONTROLS
@bypass_virus_checks_maps = (
   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
@bypass_virus_checks_acl =  map ( {'!'.$_} keys(%local_domains));
push(@bypass_virus_checks_acl,'.');
$final_virus_destiny      = D_DISCARD;
$first_infected_stops_scan = 1;

# BANNING
$final_banned_destiny     = D_PASS;

# ANTI-SPAM CONTROLS
@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
@bypass_spam_checks_acl =  map ( {'!'.$_} keys(%local_domains));
push(@bypass_spam_checks_acl,'.');
$final_spam_destiny       = D_DISCARD;
$sa_local_tests_only = undef;
$sa_auto_whitelist = undef;
$sa_tag_level_deflt  = -1000; # Ajout d'en-tetes decrivant l'etat "spam" du mail
$sa_tag2_level_deflt = 5; # Modification du sujet pour cette note
$sa_kill_level_deflt = 7; # Mise en quarantaine si > a cette note
$sa_dsn_cutoff_level = undef;
$sa_spam_subject_tag = '***SPAM*** ';
$sa_spam_modifies_subj = undef;

# Whitelist
@whitelist_sender_acl = qw( .umpsend.u-m-p.org );

# MAPPING A CONTENTS CATEGORY TO A SETTING CHOSEN

# POLICY BANKS
$policy_bank{'MYNETS'} = {
       bypass_spam_checks_maps   => [1],
       bypass_banned_checks_maps => [1]
};

#------------ Do not modify anything below this line -------------
1;  # insure a defined return

# vim: filetype=perl

Contenu du fichier /etc/amavis/local_domains :

exemple.com
exmeple.org
...
  • D_PASS :
    • Le message sera distribué aux destinataires.
    • A utiliser en général pour le marquage de spam.
  • D_BOUNCE :
    • Le message sera stoppé et une notification généré par AMAVIS sera envoyé.
  • D_DISCARD :
    • Le message sera stoppé de façon discrète et aucune notification ne sera envoyé.
  • D_REJECT :
    • Le message sera stoppé et une notification SMTP (non-delivery) sera envoyé.

Pyzor

pyzor discover
pyzor ping

Remarques :

  • Firewalling : le port 24441 UDP doit être ouvert vers l'extérieur.
  • Si le discover pause problème. Ouvrir le fichier ~/.pyzor/servers et mettre dans le fichier :
82.94.255.100:24441

Razor

su - amavis
razor-admin -discover
razor-admin -create
razor-admin -register -user postmaster@test.com
razor-admin -discover

Remarque :

  • Firewalling : le port 2703 TCP doit être ouvert vers l'extérieur.

Références

  • informatique/reseau/messagerie/amavis.1297422191.txt.gz
  • Dernière modification : 2011/06/21 12:48
  • (modification externe)