Documentation amavisd-new

en cours de rédaction...


================== REMARQUE ==================
Les paramètres dans ce document son extraits de la version 2.4.5 '''d'amavisd-new'''.
Dans les prochaines mises à jour, un nouveau paramètre aura une annotation
supplémentaire comme : '''Depuis 2.X.X''' et un
paramètre obsolète aura : '''Obsolète depuis 2.X.X'''

Les types de paramètres d'amavisd.conf :

Pour plus de détail, se référer à la documentation de Perl car tous les paramètres dans amavis sont en Perl.

  • $var : variable scalaire, peut tout contenir. Exemples :
 $var = 'texte';
 $var = 10;
 $var = $autre_var;
  • %var : tableau associatif, peut contenir des paires de clé/valeur. Exemple :
 %var = ( 'key1' => 'value', 'key2' => 'value' );

  • @var : tableau de type liste, peut contenir toutes valeurs séparés par des virgules. Exemples :
 @var = ['texte1', 'texte2'];
 @var = [1, 2, 3];



  • Types de valeurs et variables spéciales :
 $var = undef : Désactive le paramètre
 $var = 2.1   : Décimal toujours séparés par un point
 $MYHOME      : Répertoire de base pour amavis (vue par le chroot comme : /addons/amavis/var/amavis)



Quelques fonctions spéciales :

  • read_hash() : Charge un tableau associatif à partir d'un fichier. Exemple :
 %var = read_hash("$MYHOME/local_domains");
  • read_array() : Charge une liste à partir d'un fichier. Exemple :
 @var = read_array('/etc/amavisd-mynetworks');
  • read_text() : Charge un texte à partir d'un fichier. Exemple :
 $var = read_text("$MYHOME/notify_virus_admin.txt");
  • new_RE() : Utilisation d'expressions régulières. Exemples :
 $var = new_RE( qr'nimda|hybris|klez'i);
 @var = ( new_RE( qr'nimda|hybris|klez'i, qr'tanatos|lentin|bridex|mimail'i ) );

Paramètres dans les Policies

Des paramètres peuvent être regroupés par politique et attribué par domaine à l'aide de policy_bank et d'une utilisation particulière de Postfix.

Etant à l'intérieur d'un HASH (tableau associatif), ces paramètres doivent être utilisés en respectant certaines contraintes.

  • Utilisation des paramètres en dehors d'une politique :
%final_destiny_by_ccat = (
  CC_VIRUS,      D_DISCARD,
  CC_BANNED,     D_DISCARD,
  CC_UNCHECKED,  D_BOUNCE,
  CC_SPAM,       D_PASS,
  CC_BADH,       D_PASS,
  CC_OVERSIZED,  D_BOUNCE,
  CC_CLEAN,      D_PASS,
  CC_CATCHALL,   D_PASS,
);

@spam_subject_tag_maps  = undef;
@spam_subject_tag2_maps = ['***SPAMMY*** '];
@spam_subject_tag3_maps = ['***SPAM*** '];

@spam_tag_level_maps  = [-999.0];
@spam_tag2_level_maps = [8.0];
@spam_tag3_level_maps = [10.0];
@spam_kill_level_maps = [10.0];

''' Ou plus généralement : '''
$sa_tag_level_deflt  = -999.0;
$sa_tag2_level_deflt = 8.0;
$sa_tag3_level_deflt = 10.0;
$sa_kill_level_deflt = 10.0;
  • Utilisation de ces mêmes paramètres dans une politique :
$policy_bank{'POLITIQUE1'} = {

   final_destiny_by_ccat        => {(
                                  CC_VIRUS,      D_DISCARD,
                                  CC_BANNED,     D_DISCARD,
                                  CC_UNCHECKED,  D_BOUNCE,
                                  CC_SPAM,       D_PASS,
                                  CC_BADH,       D_PASS,
                                  CC_OVERSIZED,  D_BOUNCE,
                                  CC_CLEAN,      D_PASS,
                                  CC_CATCHALL,   D_PASS,
                                )},

   spam_subject_tag_maps        => undef,
   spam_subject_tag2_maps       => ['***SPAMMY*** '],
   spam_subject_tag3_maps       => ['***SPAM*** '],

   spam_tag_level_maps          => [-999.0],
   spam_tag2_level_maps         => [8.0],
   spam_tag3_level_maps         => [10.0],
   spam_kill_level_maps         => [10.0],

};


Complément sur D_PASS, D_REJECT, D_BOUNCE, D_DISCARD

Vous trouverez ces valeurs dans les paramètres comme final_destiny_by_ccat ou final_XXXXX_destiny.

  • 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é.

Système de templates Amavis pour les notifications :

  • Amavis fournit un système de template très poussé afin de personnaliser toutes les notifications ainsi que les informations dans les logs.
  • Pour plus d'information, se référer au document README.customize dans les sources d'amavis.

Modèle de notification - Spam - Administrateur :

  • Dans RadicalSpam vous trouverez ce template dans /var/rs/addons/amavis/var/amavis/notify_spam_admin.txt
  • Utilisation : Cette notification peut être envoyé aux administrateurs de messagerie de votre entreprise pour chaque SPAM détecté afin d'analyser et corriger si nécessaire, le filtrage anti-spam.
Date: %d
From: %f
Subject: SPAM FROM <%o> - \[%c\]
To: [? %#T |undisclosed-recipients: ;|[<%T>|, ]]
Message-ID: <SA%i@%h>

---------------------------------------------------------------------
ID Quarantaine : %i
---------------------------------------------------------------------
Policy  : %p
Hit     : %c sur _REQD_
From    : %o
Subject : %j
Reçu le : %d
Client  : %a - %g
------------------------- Destinataires -----------------------------
Non délivré(s) :
%O

Délivré(s) :
%D

[%A
]\

------------------------- BEGIN HEADERS -----------------------------
Return-Path: %s
[%H
]\
-------------------------- END HEADERS ------------------------------


Modèle de notification - Virus/Banned - Administrateur

  • Dans RadicalSpam vous trouverez ce template dans /var/rs/addons/amavis/var/amavis/notify_virus_admin.txt
  • Remarque : Le template est le même pour les VIRUS et pour les BANNED.
  • Utilisation : Cette notification peut être envoyé aux administrateurs de messagerie de votre entreprise pour chaque VIRUS ou BANNED détecté afin d'analyser et corriger si nécessaire, le filtrage anti-virus / anti-banned.
Date: %d
From: %f
Subject: [? [:ccat_maj] |Clean (?) mail|Clean mail|TEMPFAIL-ed mail|\
OVERSIZED mail|INVALID HEADER in mail|spam|SPAM|UNCHECKED contents in mail|\
BANNED contents (%F) in mail|VIRUS (%V) in mail]\
 FROM [?%l||LOCAL ][?%a||\[%a\] ][?%s|<>|[?%o|(?)|%s]]
To: [? %#T |undisclosed-recipients: ;|[<%T>|, ]]
[? %#C |#|Cc: [<%C>|, ]]
Message-ID: <VA%i@%h>

---------------------------------------------------------------------
Policy  : %p
Hit     : %c
From    : %o
Subject : %j
Quar.ID : %i
Msg.ID  : %n
Reçu le : %d
Tag l2  : %2
MTA id  : %Q
Cli. IP : %a
Cli. DNS: %g
------------------------- Destinataires -----------------------------
Non délivré(s) :
%O

Délivré(s) :
%D
---------------------------------------------------------------------
# Chemin vers le fichier en quarantaine
%q
[%A
]\

------------------------- BEGIN HEADERS -----------------------------
Return-Path: %s
[%H
]\
-------------------------- END HEADERS ------------------------------


Modèle de notification - Virus/Banned - Expéditeur

  • Dans RadicalSpam vous trouverez ce template dans /var/rs/addons/amavis/var/amavis/notify_virus_sender.txt
  • Remarque : Le template est le même pour les VIRUS et pour les BANNED.
  • Utilisation : Cette notification peut être envoyé à l'expéditeur quand un virus ou une pièce jointe est interdite.
Date: %d
From: %f
Subject: Notification: Action sur un message.
To: [? %#T |undisclosed-recipients: ;|[<%T>|, ]]
[? %#C |#|Cc: [<%C>|, ]]
Message-ID: <VR%i@%h>

Le message suivant n'a pas été livré.

Date.............: %d
Expéditeur.......: ([?%s|<>|[?%o|(?)|%s]])
Destinataire.....: %T
Sujet............: %j
Pièce jointe.....: %F

Le message a été supprimé car il ne répondait pas aux normes de securité : Virus ou
Attachement de pièce jointe non conforme (par exemple .exe, .bat, .com, ...)


Modèle de notification - Virus/Banned - Destinataire

  • Dans RadicalSpam vous trouverez ce template dans /var/rs/addons/amavis/var/amavis/notify_virus_recips.txt
  • Remarque : Le template est le même pour les VIRUS et pour les BANNED.
  • Utilisation : Cette notification peut être envoyé au(x) destinataire(s) quand un virus ou une pièce jointe est interdite.
Date: %d
From: %f
Subject: Notification: Action sur un message.
To: [? %#T |undisclosed-recipients: ;|[<%T>|, ]]
[? %#C |#|Cc: [<%C>|, ]]
Message-ID: <VR%i@%h>

Le message suivant a été supprimé.

Date.............: %d
Expéditeur.......: ([?%s|<>|[?%o|(?)|%s]])
Destinataire.....: %T
Sujet............: %j
Pièce jointe.....: %F

Le message a été supprimé car il ne répondait pas aux normes de securité : Virus ou
Attachement de pièce jointe non conforme (par exemple .exe, .bat, .com, ...)


Variables et fonctions pour la personnalisation :

%0 : recipient email address belong to local_domains_maps: L or 0

%1 : above tag level for this recipient:  Y or 0

%2 : above tag2 level for this recipient: Y or 0

%a : Adresse IP du client original

%b : message digest of mail body (MD5, hex)

%c : Nombre de points que SpamAssassin a attribué au message

%d : Voir %date_rfc2822_local

%e : best guess of the originator IP address collected from the Received trace

%f : Email administrateur (utilisé dans le From:)

%g : Nom DNS du client original

%h : Nom dns du serveur en cours (variable $myhostname) ou résolution DNS

%i : quarantine id, e.g. name of the quarantine file, or empty ($VIRUSFILE)

%j : Champs 'Subject' du message d'origine

%k above kill level for this recipient: Y or 0

%l : true si l'expéditeur est dans local_domains, undef sinon

%m : Champs 'Message-ID' du message d'origine

%n : ID attribué par Amavis

%o : best attempt at determining true sender of the virus - normally same as %s

%p : Nom de la policy utilisé

%q : list of quarantine mailbox names, or empty if not quarantined

%r : first 'Resent-Message-ID' header field body #TODO: A tester

%s : Adresse originale de l'expéditeur prise dans le champs 'From' de l'enveloppe (rfc2821-quoted)

%t : Premier 'Received'

%u : Voir %date_unix_utc

%v : Dernier virus trouvé

%x : Spécial !!! Utilisé pour l'évaluation de macros

%y : Durée en ms pris pour le traitement du message par Amavis

%z : Taille originale du message en octets


%A : Rapport SpamAssassin pour les spam

%B : Liste des destinataires du champs 'Bcc:' (sur plusieurs lignes)

%C : Liste des destinataires du champs 'Cc:' (sur plusieurs lignes)

%D : Liste des destinataires qui ont effectivement reçus le message

%F : Liste des fichiers interdits (scr, vbs, etc...)

%H : Liste de toutes les entêtes (sauf 'Return-Path:' ou 'Delivered-To:')

%N : a list of recipients with UNsuccessful delivery status (will NOT get mail)

%O : Liste des destinataires qui n'ont pas reçus le message

%Q : queue ID du MTA

%R : Liste originale de tous les destinataires dans l'enveloppe

%S : address that will get sender notification;

%T : Liste des destinataires du champs 'To:' (sur plusieurs lignes)

%U : Voir %date_iso8601_utc

%V : Liste des virus trouvé

%W : Liste des scanners anti-virus detectés

%X : a list of header syntax violations


%date_unix_utc      : timestamp of the message reception - Unix time (seconds since 1970-01-01T00:00Z as a decimal integer)

%date_iso8601_utc   : timestamp of the message reception - ISO 8601 (EN 28601) UTC date-time

%date_iso8601_local : sub {iso8601_timestamp($MSGINFO->rx_time)}

%date_rfc2822_local : Date au format de la RFC 2822

[:header_field|Authentication-Results]

[:header_field|From]

[:wrap|78||  |Message-ID: %m] wrap  with arguments: width, prefix, indent, string

lc lowercases arguments and concatenates them to a single string

uc uppercases arguments and concatenates them to a single string

len  returns string length of its first argument

incr

decr

min

max

sprintf

join

dquote

uquote

substr

index

useragent

x-mailer

ccat_maj

ccat_min

ccat_name

AUTOLEARN   autolearn status

DATE        same as date_rfc2822_local

SCORE       similar to macro 'c', but returns a single number (sum of
              SA score and boost), and allows padding as per SA documentation.
              In a per-message log ($log_templ) when a message has multiple
              recipients, a minimum value is given;

STARS       score as in macro SCORE, but represented as a bar of characters

REPORT      a SA terse report of tests hit (for header reports)

SUMMARY     similar to macro A, but provides a single multiline string,
              a SA summary of tests hit for standard body reports

REMOTEHOSTADDR IP address of your connecting MTA (often 127.0.0.1)

REMOTEHOSTNAME your connecting MTA (often [127.0.0.1] or localhost)

TESTS       similar to %T in logging, but without scores

TESTSSCORES similar to %T in logging, but allows to specify a separator

YESNO       similar to macro '2', but provides Yes/No instead of 1/0

YESNOCAPS   similar to macro '2', but provides YES/NO instead of 1/0

REQD        minimal tag2 level of all recipients


Liste des paramètres pour les catégories principales

Désactivation de filtre :

Gestion des Niveaux (score) :

Gestion de la Quarantaine :

Notifications :

Modification du sujet :

Performances :

Filtrage des pièces jointes :

Listes blanches / noires / lovers :

Protocole SMTP :


Liste des paramètres par ordre alphabétique


additional_perl_modules

Depuis la version2.4.3
TypeScalaire : $
DescriptionChargement de modules Perl supplémentaires
Syntaxe?

addr_extension_bad_header


addr_extension_bad_header_maps


addr_extension_banned


addr_extension_banned_maps


addr_extension_maps_by_ccat


addr_extension_spam


addr_extension_spam_maps


addr_extension_virus


addr_extension_virus_maps


admin_maps_by_ccat


allowed_added_header_fields


allowed_header_tests


allow_fixing_improper_header


allow_fixing_improper_header_folding


amavis_auth_pass


amavis_auth_user


append_header_fields_to_bottom


archive_quarantine_method


archive_quarantine_to


archive_quarantine_to_maps


auth_mech_avail


auth_mech_avail


auth_reauthenticate_forwarded


auth_required_inp


auth_required_out


auth_required_release


av_scanners


av_scanners_backup


bad_header_admin


bad_header_admin_maps


bad_header_lovers_maps


bad_header_quarantine_method


bad_header_quarantine_to


bad_header_quarantine_to_maps


banned_admin


banned_admin_maps


banned_filename_maps


banned_filename_re


banned_files_lovers_maps


banned_files_quarantine_method


banned_namepath_re


banned_quarantine_to


banned_quarantine_to_maps


bdy_encoding


blacklist_sender_maps


bypass_banned_checks_maps


bypass_decode_parts


bypass_header_checks_maps


bypass_spam_checks_maps


bypass_virus_checks_maps


child_timeout


clean_quarantine_method


clean_quarantine_to


clean_quarantine_to_maps


daemon_chroot_dir


daemon_group


daemon_user


db_home


debug_sender_maps


decoders


defang_all


defang_bad_header


defang_banned


defang_by_ccat


defang_spam


defang_undecipherable


defang_virus


default_ldap


DO_SYSLOG


dsn_bcc


dsn_bcc_by_ccat


dspam


enable_db


enable_global_cache


enable_ldap


enforce_smtpd_message_size_limit_64kb_min


file


final_bad_header_destiny


final_banned_destiny


final_destiny_by_ccat


final_spam_destiny


final_virus_destiny


first_infected_stops_scan


forward_method


gzip


hdr_encoding


hdr_encoding_qb


hdrfrom_notify_admin


hdrfrom_notify_admin_by_ccat


hdrfrom_notify_recip


hdrfrom_notify_recip_by_ccat


hdrfrom_notify_sender


hdrfrom_notify_sender_by_ccat


hdrfrom_notify_spamadmin


helpers_home


inet_acl


inet_socket_bind


inet_socket_port


insert_received_line


interface_policy


keep_decoded_original_maps


keep_decoded_original_re


ldap_lookups_no_at_means_domain


local_client_bind_address


local_delivery_aliases


local_domains_maps


local_domains_re


localhost_name


localpart_is_case_sensitive


lock_file


LOGFILE


log_level


log_recip_templ


log_templ


lookup_sql_dsn


lovers_maps_by_ccat


mailfrom_notify_admin


mailfrom_notify_admin_by_ccat


mailfrom_notify_recip


mailfrom_notify_recip_by_ccat


mailfrom_notify_spamadmin


mailfrom_to_quarantine


map_full_type_to_short_type_maps


map_full_type_to_short_type_re


MAX_EXPANSION_FACTOR


MAX_EXPANSION_QUOTA


MAXFILES


MAXLEVELS


max_requests


max_servers


message_size_limit_maps


MIN_EXPANSION_FACTOR


MIN_EXPANSION_QUOTA


mydomain


MYHOME


myhostname


mynetworks


mynetworks_maps


newvirus_admin


newvirus_admin_maps


notify_admin_templ_by_ccat


notify_method


notify_recips_templ_by_ccat


notify_sender_templ


notify_sender_templ_by_ccat


notify_spam_admin_templ


notify_spam_recips_templ


notify_spam_sender_templ


notify_virus_admin_templ


notify_virus_recips_templ


notify_virus_sender_templ


os_fingerprint_method


path


penpals_bonus_score


penpals_halflife


penpals_threshold_high


penpals_threshold_low


per_recip_blacklist_sender_lookup_tables


per_recip_whitelist_sender_lookup_tables


pid_file


policy_bank


policy_bank_name


prepend_header_fields_hdridx


propagate_dsn_if_possible


protocol


QUARANTINEDIR


quarantine_method_by_ccat


quarantine_subdir_levels


quarantine_to_maps_by_ccat


recipient_delimiter


release_method


remove_existing_spam_headers


remove_existing_x_scanned_headers


replace_existing_extension


resend_method


sa_debug


sa_dsn_cutoff_level


sa_kill_level_deflt


sa_local_tests_only


sa_mail_body_size_limit


sa_quarantine_cutoff_level


sa_spam_level_char


sa_spam_modifies_subj


sa_spam_report_header


sa_spam_subject_tag


sa_spawned


sa_tag2_level_deflt


sa_tag3_level_deflt


sa_tag_level_deflt


sa_timeout


score_sender_maps


smtpd_discard_ehlo_keywords


smtpd_greeting_banner


smtpd_message_size_limit


smtpd_quit_banner


smtpd_recipient_limit


smtpd_timeout


spam_admin


spam_admin_maps


spam_check_negative_ttl


spam_check_positive_ttl


spam_dsn_cutoff_level_maps


spam_kill_level_maps


spam_lovers_maps


spam_modifies_subj_maps


spam_quarantine_bysender_to


spam_quarantine_bysender_to_maps


spam_quarantine_cutoff_level_maps


spam_quarantine_method


spam_quarantine_to


spam_quarantine_to_maps


spam_subject_tag2_maps


spam_subject_tag3_maps


spam_subject_tag_maps


spam_tag2_level_maps


spam_tag3_level_maps


spam_tag_level_maps


sql_clause


sql_lookups_no_at_means_domain


sql_quarantine_chunksize_max


sql_quarantine_chunksize_max


sql_select_policy


sql_select_white_black_list


storage_sql_dsn


subject_tag_maps_by_ccat


syslog_facility


syslog_ident


SYSLOG_LEVEL


syslog_priority


TEMPBASE


terminate_dsn_on_notify_success


timestamp_fmt_mysql


trim_trailing_space_in_lookup_result_fields


uncompress


undecipherable_subject_tag


unix_socketname


virus_admin


virus_admin_maps


virus_check_negative_ttl


virus_check_positive_ttl


viruses_that_fake_sender_maps


viruses_that_fake_sender_re


virus_lovers_maps


virus_quarantine_method


virus_quarantine_to


virus_quarantine_to_maps


warnbadhrecip


warnbadhrecip_maps


warnbadhsender


warnbannedrecip


warnbannedrecip_maps


warnbannedsender


warn_offsite


warnrecip_maps_by_ccat


warnsender_by_ccat


warnspamsender


warnvirusrecip


warnvirusrecip_maps


warnvirussender


whitelist_sender_maps


X_HEADER_LINE


X_HEADER_TAG


zoo

 
Radical Spam - Solutions de filtrage Open Source