Zionetrix::Git
Repositories
Help
Report an Issue
postfix_scripts
Code
Commits
Branches
Tags
Search
Tree:
774e0ce
Branches
Tags
master
postfix_scripts
scripts
clean_mail_to_unreal_domains
Initial commit
Benjamin Renard
commited
774e0ce
at 2016-01-19 19:51:30
clean_mail_to_unreal_domains
Blame
History
Raw
#!/bin/bash DROPED=0 CUR="XXXXXXXXXXXXX" IFS=" " for line in $( mailq ) do if [ $( echo "$line"|egrep -c '^[A-Z0-9]+' ) -eq 1 ] then CUR=$( echo "$line"|sed 's/^\([A-Z0-9]*\).*$/\1/' ) DROPED=0 if [ ! -n "$CUR" ] then echo -e "ERROR : unable to isolate mail ID from this line :\n\n\t$line" exit 3 fi elif [ $DROPED -eq 1 ] then continue elif [ $( echo "$line"|grep -c "^ .*@" ) -gt 0 ] then for domain in frre.fr gemail.com gmaiil.com gmail.co gmail.de gmail.fr gmail.om gmamil.com gmmail.com hayoo.fr homail.com hootmail.com hormail.com hotail.com hotamil.com hotmaill.com hotmeil.com hoymail.com hptmail.com lapose.net lapostre.net ornage.fr ornge.fr outlokk.com outloook.com rockatmail.com sfrl.fr wanado.fr wandoo.fr yacho.com yahoo.cm yaohoo.fr do if [ $( echo "$line"|grep -c "@$domain" ) -gt 0 ] then #postsuper -d "$CUR" echo $CUR DROPED=1 break fi done fi done