Postfix y MySQL · 1 min read · Oct 07, 2025
Usuarios Virtuales Y Dominios Con Postfix, Courier Y MySQL (Debian Etch) - Página 5
11 Notificaciones de Exceso de Cuota
Si deseas recibir notificaciones sobre todas las cuentas de correo electrónico que están sobre la cuota, haz lo siguiente:
cd /usr/local/sbin/
wget http://puuhis.net/vhcs/quota.txt
mv quota.txt quota_notify
chmod 755 quota_notifyAbre /usr/local/sbin/quota_notify y edita las variables en la parte superior. Más abajo en el archivo (hacia el final) hay dos líneas donde debes agregar un signo de %:
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 = 'Mi Empresa'; my $COADDR = '[email protected]'; my $SUADDR = '[email protected]'; my $MAIL_REPORT = 1; my $MAIL_WARNING = 1; [...] print "Subject: WARNING: Your mailbox is $lusers{ $luser}% full.\n"; [...] print "Your mailbox: $luser is $lusers{ $luser}% full.\n\n"; [...] |
Ejecuta
crontab -epara crear un trabajo cron para ese script:
| 0 0 * * * /usr/local/sbin/quota_notify &> /dev/null |
(Nota (un poco fuera de tema): en Debian crontab -e abrirá automáticamente el editor nano. Si estás acostumbrado a trabajar con el editor vi (como yo), ejecuta los siguientes comandos:
rm -f /etc/alternatives/editor
ln -s /usr/bin/vi /etc/alternatives/editorDespués, ejecuta crontab -e, y vi se abrirá.)
12 Probar Postfix
Para ver si Postfix está listo para SMTP-AUTH y TLS, ejecuta
telnet localhost 25Después de haber establecido la conexión con tu servidor de correo Postfix, escribe
ehlo localhostSi ves las líneas
250-STARTTLSy
250-AUTH LOGIN PLAINtodo está 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#Escribe
quitpara volver a la consola del sistema.
Recibe nuevas publicaciones en tu bandeja de entrada.
No spam. Cancela la suscripción en cualquier momento.