salut bon j'ai changé mon fusil d'épaule et j'ai viré amavisNG pour mettre à la place amavisd-new.
J'ai suivi cette procédure pour la configuration:
Create an user and group to run the daemon. This will be used for antispan & virus as well, so make it a good un. Then create a folder for amavisd-new to use, and the make it owned by the user created.
adduser amavis
mkdir /var/local/amavis
chown amavis:amavis /var/local/amavis
chmod 750 /var/local/amavis
Copy the amavisd from the source to /use/local/sbin, the conf file to /etc/amavis and the init file to /etc/rc.d/init.d.
cp amavisd /usr/local/sbin
chown root /usr/local/sbin/amavisd
chmod 755 /usr/local/sbin/amavisd
mkdir /etc/amavis
cp amavisd.conf /etc/amavis
chown root /etc/amavis/amavisd.conf
chmod 644 /etc/amavis/amavisd.conf
cp amavisd_init.sh /etc/rc.d/init.d/amavisd
Create a folder to store the quarantined emails
mkdir /var/local/quarantine
chown amavis:amavis /var/local/quarantine
chmd 750 /var/local/quarantine
Edit /etc/amavis/amavisd.conf. There are so many settings in there, so it is wise to:
a.Make a backup
b.Change one thing at a time
But first you need to set these settings:
$MYHOME = '/var/local/amavis';
$mydomain = 'yourdomain.tld';
$daemon_user = 'amavis';
$daemon_group = 'amavis';
$TEMPBASE = "$MYHOME/tmp";
$DO_SYSLOG = 1;
$LOGFILE = "$MYHOME/amavis.log";
$log_level = 2;
$QUARANTINEDIR = '/var/local/quarantine';
When everything is working you can set these settings back to:
$DO_SYSLOG = 0;
$log_level = 0;
That is the base install of the interface. Next you need to install the anti-spam & anti-virus.
Edit amavisd's conf file again and comment out all other virus scanners at the av_scanner,/i> section, and then only leave i>ClamAV in the @av_scanners_backup section.
@av_scanners = ();
@av_scanners_backup = (
['Clam Antivirus - clamscan', 'clamscan',
'--stdout --disable-summary -r {}', [0], [1],
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);
That should be it for content checking. As there as so many options in the amavisd conf file, you should go through it more throughly.
Voici mon amavisd.conf
$max_servers = 2; # number of pre-forked children (2..15 is common)
$daemon_user = 'amavis'; # (no default; customary: vscan or amavis)
$daemon_group = 'amavis'; # (no default; customary: vscan or amavis)
$mydomain = 'mondomaine.fr'; # a convenient default for other settings – Evidemment j'ai remplacé mondomaine.fr par mon véritable domaine....
$MYHOME = '/var/local/amavis'; # a convenient default for other settings
$TEMPBASE = "$MYHOME/tmp"; # working directory, needs to be created manually
$ENV{TMPDIR} = $TEMPBASE; # environment variable TMPDIR
$QUARANTINEDIR = '/var/local/quarantine';
Dans main.cf de postfix j'ai rajouté cette ligne en dernier...
#content_filter = smtp-amavis:[127.0.0.1]:10024
Dans master.cf j'ai ajouté ceci :
################amavis########################################
#smtp-amavis unix - - n - 2 smtp
# -o smtp_data_done_timeout=1200
# -o disable_dns_lookup=yes
#127.0.0.1:10025 inet n - n - - smtpd
# -o content_filter=
# -o local_recipient_maps=
# -o relay_recipient_maps=
# -o smtpd_restriction_classes=
# -o smtpd_client_restrictions=
# -o smtpd_helo_restrictions=
# -o smtpd_sender_restrictions=
# -o smtpd_recipient_restrictions=permit_mynetworks,reject
# -o mynetworks=127.0.0.0/8
# -o strict_rfc821_envelopes=yes
Quand j'essaye de lancer amavis par la commande /etc/rcd./init.d/amavisd start j'ai une erreur
Starting amavisd: execvp: No such file or directory
[ECHEC ]
si je passe par la commande suivante : # /usr/local/sbin/amavisd
ERROR: MISSING REQUIRED BASIC MODULES:
Net::Server
Net::Server::PreForkSimple
BEGIN failed--compilation aborted at /usr/local/sbin/amavisd line 139.
Bon en principe j'ai tous les modules perl nécessaires alors je ne comprend pas...
J'ai lancé spamassassin et il a l'air de fonctionner... en tout cas je n'ai pas eu d'échec.
Voici maintenant les messages d'erreur trouvé dans /var/log/mail/info
Feb 2 16:37:04 serveur postfix/smtp[32716]: connect to 127.0.0.1[127.0.0.1]: Connection refused (port 10024)
Peut-être que la connection est refusé par Iptables... alors je ne sais pas quoi faire....
voilà si qlq'un voit le problème et peut me filer un chtit coup de main se serait super parce que la j'en ai marre et je galère depuis des jours...
Attention je suis un Newbie sous linux donc j'ai pu faire des erreurs énormes...
Merci