Script pour supprimer facilement du spam sur les MLs lists.crans.org
This commit is contained in:
parent
cb54cbeeca
commit
be1ece3beb
1 changed files with 34 additions and 0 deletions
34
mailman/discard_from_domain.sh
Executable file
34
mailman/discard_from_domain.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pour dropper les spams en provenance d'un domaine identifié
|
||||
# sur toutes les MLs
|
||||
|
||||
if [ "$(hostname)" != "redisdead" ]
|
||||
then
|
||||
echo "À exécuter sur redisdead."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "" ]
|
||||
then
|
||||
echo -e "Usage : discard_from_domain.sh domain.tld\n"
|
||||
echo "Droppe les mails en provenance de domain.tld sur toutes les MLs (demande confirmation)"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "Recherche…"
|
||||
|
||||
targets=$(grep -lRi "$1" /var/lib/mailman/data/heldmsg*)
|
||||
|
||||
echo "${targets}"
|
||||
|
||||
echo -n "Exterminate ? [y/N] "
|
||||
read -r ans
|
||||
|
||||
case ${ans} in
|
||||
y|Y|o|O)
|
||||
echo "${targets}" | xargs /var/lib/mailman/bin/discard
|
||||
;;
|
||||
*)
|
||||
echo "Aborting"
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue