About This File
Many users has bad email: account deleted, user suspended, no space in mailbox etc. Your mails to this users back to you with errors.
This is advanced version of (SL) Force users to change email
- Make users unapproved until they did not change their email address
- To users with bad emails did not send any emails
- Approving emails by users
- Move users to selected group
- Log all actions
All you need for work is bad emails list.
How to get users list with bad emails?
1. Manually: see your mailer-daemon letters
2. You can use special services
2. Auto: in mail error.log
i am doing like this:
#BAD EMAILS cat mail.log|grep "user is terminated\|No such user\|account is disabled\|The email account that you tried to reach does not exist" >mail.log.badmails cat mail.log.badmails|cut -d " " -f1,2|uniq -c >mail.log.badmails.stats sed -E "s/[[:space:]]+/ /g" mail.log.badmails|cut -d " " -f7|sort|uniq -c|sort -n -r|sed 's/to=<//g'|sed 's/>,//g'|sed 's/ //g' >mail.log.badmails.to.stats sed -E "s/[[:space:]]+/ /g" mail.log.badmails|cut -d " " -f7|sort|uniq -c|sort -n -r|sed 's/.*to=<//g'|sed 's/>,//g' >mail.log.badmails.list
You get file mail.log.badmails.list where all your bad mails listed.
Just copy-paste into config. Thats all.
Tested with 4.3!