postsuper -d ALL
ou se quiser remover uma mensagem especifica:
postsuper -d ID_DA_MENSAGEM
Script para remover emails da Mailq usando palavra
uso:
sh mailq.sh
vai perguntar quais emails você quer remover
vamos dizer que quer remover todos os emails enviados por [email protected]
nesse caso, digite [email protected]
#!/bin/bash
# Script para remover spam da mailq
####
c=0
echo “digite o prefixo (ex.: @yahoo.com)”
read prefix
while [ $c != 10 ]; do
for i in `mailq |grep $prefix |grep ^$c`; do `rm -rf /var/spool/postfix/active/$c/$i`; done;
for i in `mailq |grep $prefix |grep ^$c`; do `rm -rf /var/spool/postfix/defer/$c/$i`; done;
for i in `mailq |grep $prefix |grep ^$c`; do `rm -rf /var/spool/postfix/deferred/$c/$i`; done;
c=`expr $c + 1`
done;
# Apaga A
for i in `mailq |grep $prefix |grep ^A`; do `rm -rf /var/spool/postfix/defer/A/$i`; done;
for i in `mailq |grep $prefix |grep ^A`; do `rm -rf /var/spool/postfix/deferred/A/$i`; done;
for i in `mailq |grep $prefix |grep ^A`; do `rm -rf /var/spool/postfix/active/A/$i`; done;
## Apaga B
for i in `mailq |grep $prefix |grep ^B`; do `rm -rf /var/spool/postfix/defer/B/$i`; done;
for i in `mailq |grep $prefix |grep ^B`; do `rm -rf /var/spool/postfix/deferred/B/$i`; done;
for i in `mailq |grep $prefix |grep ^B`; do `rm -rf /var/spool/postfix/active/B/$i`; done;
## Apaga C
for i in `mailq |grep $prefix |grep ^C`; do `rm -rf /var/spool/postfix/defer/C/$i`; done;
for i in `mailq |grep $prefix |grep ^C`; do `rm -rf /var/spool/postfix/deferred/C/$i`; done;
for i in `mailq |grep $prefix |grep ^C`; do `rm -rf /var/spool/postfix/active/C/$i`; done;
## Apaga D
for i in `mailq |grep $prefix |grep ^D`; do `rm -rf /var/spool/postfix/defer/D/$i`; done;
for i in `mailq |grep $prefix |grep ^D`; do `rm -rf /var/spool/postfix/deferred/D/$i`; done;
### Apaga E
for i in `mailq |grep $prefix |grep ^E`; do `rm -rf /var/spool/postfix/defer/E/$i`; done;
for i in `mailq |grep $prefix |grep ^E`; do `rm -rf /var/spool/postfix/deferred/E/$i`; done;
for i in `mailq |grep $prefix |grep ^E`; do `rm -rf /var/spool/postfix/active/E/$i`; done;
# Apaga F
for i in `mailq |grep $prefix |grep ^F`; do `rm -rf /var/spool/postfix/defer/F/$i`; done;
for i in `mailq |grep $prefix |grep ^F`; do `rm -rf /var/spool/postfix/deferred/F/$i`; done;
for i in `mailq |grep $prefix |grep ^F`; do `rm -rf /var/spool/postfix/active/F/$i`; done;
# Apaga 1
for i in `mailq |grep $prefix |grep ^1`; do `rm -rf /var/spool/postfix/defer/1/$i`; done;
for i in `mailq |grep $prefix |grep ^1`; do `rm -rf /var/spool/postfix/deferred/1/$i`; done;
for i in `mailq |grep $prefix |grep ^1`; do `rm -rf /var/spool/postfix/active/1/$i`; done;
# Apaga 2
for i in `mailq |grep $prefix |grep ^2`; do `rm -rf /var/spool/postfix/defer/2/$i`; done;
for i in `mailq |grep $prefix |grep ^2`; do `rm -rf /var/spool/postfix/deferred/2/$i`; done;
for i in `mailq |grep $prefix |grep ^2`; do `rm -rf /var/spool/postfix/active/2/$i`; done;
# Apaga 3
for i in `mailq |grep $prefix |grep ^3`; do `rm -rf /var/spool/postfix/defer/3/$i`; done;
for i in `mailq |grep $prefix |grep ^3`; do `rm -rf /var/spool/postfix/deferred/3/$i`; done;
for i in `mailq |grep $prefix |grep ^3`; do `rm -rf /var/spool/postfix/active/3/$i`; done;
# Apaga 4
for i in `mailq |grep $prefix |grep ^4`; do `rm -rf /var/spool/postfix/defer/4/$i`; done;
for i in `mailq |grep $prefix |grep ^4`; do `rm -rf /var/spool/postfix/deferred/4/$i`; done;
for i in `mailq |grep $prefix |grep ^4`; do `rm -rf /var/spool/postfix/active/4/$i`; done;
# Apaga 5
for i in `mailq |grep $prefix |grep ^5`; do `rm -rf /var/spool/postfix/defer/5/$i`; done;
for i in `mailq |grep $prefix |grep ^5`; do `rm -rf /var/spool/postfix/deferred/5/$i`; done;
for i in `mailq |grep $prefix |grep ^5`; do `rm -rf /var/spool/postfix/active/5/$i`; done;
# Apaga 6
for i in `mailq |grep $prefix |grep ^6`; do `rm -rf /var/spool/postfix/defer/6/$i`; done;
for i in `mailq |grep $prefix |grep ^6`; do `rm -rf /var/spool/postfix/deferred/6/$i`; done;
for i in `mailq |grep $prefix |grep ^6`; do `rm -rf /var/spool/postfix/active/6/$i`; done;