Postfix Configuration · 1 min read · Oct 07, 2025
Utilisateurs et domaines virtuels avec Postfix, Courier et MySQL (Debian Etch) - Page 5
11 Notifications de dépassement de quota
Si vous souhaitez recevoir des notifications concernant tous les comptes email qui dépassent le quota, faites ceci :
cd /usr/local/sbin/
wget http://puuhis.net/vhcs/quota.txt
mv quota.txt quota_notify
chmod 755 quota_notifyOuvrez /usr/local/sbin/quota_notify et modifiez les variables en haut. Plus bas dans le fichier (vers la fin), il y a deux lignes où vous devez ajouter un signe % :
vi /usr/local/sbin/quota_notify| [...] my $POSTFIX_CF = "/etc/postfix/main.cf"; my $MAILPROG = "/usr/sbin/sendmail -t"; my $WARNPERCENT = 80; my @POSTMASTERS = ('[email protected]'); my $CONAME = 'Ma Société'; my $COADDR = '[email protected]'; my $SUADDR = '[email protected]'; my $MAIL_REPORT = 1; my $MAIL_WARNING = 1; [...] print "Subject: WARNING: Votre boîte aux lettres est $lusers{ $luser}% pleine.\n"; [...] print "Votre boîte aux lettres : $luser est $lusers{ $luser}% pleine.\n\n"; [...] |
Exécutez
crontab -epour créer un job cron pour ce script :
| 0 0 * * * /usr/local/sbin/quota_notify &> /dev/null |
(Note (un peu hors sujet) : sur Debian, crontab -e ouvrira automatiquement l’éditeur nano. Si vous êtes habitué à travailler avec l’éditeur vi (comme moi), exécutez les commandes suivantes :
rm -f /etc/alternatives/editor
ln -s /usr/bin/vi /etc/alternatives/editorEnsuite, exécutez crontab -e, et vi s’ouvrira.)
12 Tester Postfix
Pour voir si Postfix est prêt pour SMTP-AUTH et TLS, exécutez
telnet localhost 25Après avoir établi la connexion à votre serveur de messagerie Postfix, tapez
ehlo localhostSi vous voyez les lignes
250-STARTTLSet
250-AUTH LOGIN PLAINtout va bien :
server1:/usr/local/sbin# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Debian/GNU)
ehlo localhost
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.
server1:/usr/local/sbin#Tapez
quitpour revenir à l’invite de commande du système.
Recevez de nouveaux articles dans votre boîte de réception.
Aucun spam. Désabonnez-vous à tout moment.