Julian Kippels writes:
Additionally if the MTA would reject connections from IPs that generate too many errors, then why is Mailman 3 still able to deliver to domain B and C when domain A has already failed?
Because *Mailman* doesn't doesn't handle bounces by domain, only by address. It will send to your MTA every address on the list that is enabled, regardless of whether transmission to other addresses at that domain failed. The *MTA* handles domain-level lossage such as DNS and network outage. Mailman is blissfully unaware of that until the individual addresses start bouncing (which by default in most MTAs takes a week or two of retries), but it doesn't care if they're all from the same domain, it handles each one individually without affecting other addresses at that domain.
Currently I am trying to write a script to check if mail aliasses are alive and remove users if that check should fail.
This isn't straightforward, as most site now disable the SMTP verify command. IIRC you need to open a connection, do the HELO, MAIL FROM, RCPT TO dance, check for error (if so, record as a bounce), and then close the connection before issuing the DATA command.
I plan to run this as a cron job for every list every night.
I find it hard to imagine that's useful. I'm not sure why you would have accumulated large numbers of dead addresses on Mailman 2 lists unless you had bounce processing disabled. Nevertheless, if you do hav dozens per list, running the script once a month should be enough unless you have really mammoth lists (> 10,000 subscriptions), or your subscribers are changing addresses as frequently as spammers do.
I don't think that this is a good option, but I don't see anything better right now.
What version of Mailman 3 are you running? I don't recall the version offhand, but bounce processing was fully implemented only about two or three years ago. Recent versions of Mailman 3 will automatically disable, and eventually remove, subscriptions that bounce "often enough" (ie, the number of bounces and interval until various purges of old bounce information are configurable). If you want to purge a large number of "dead" addresses quickly, just set the disable and delete levels very low, then set them back to default. That should do the trick.
Note that some distros provide rather old versions of Mailman 3, where bounce processing did not work.
Steve