From: Vincent Le Gallic Date: Sat, 9 Nov 2013 00:24:31 +0000 (+0100) Subject: [mailman] truc oublié X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=b131d3841c3357ae64c22cf9bee21204acabad75;p=scripts-20-100.git [mailman] truc oublié --- diff --git a/mailman_bad_guys.py b/mailman_bad_guys.py index 1c0399a..c086725 100755 --- a/mailman_bad_guys.py +++ b/mailman_bad_guys.py @@ -55,9 +55,9 @@ def exterminate(mail, ml): l.Save() l.Unlock() -def exterminate_this_guy(bad_guy): +def exterminate_this_guy(bad_guy, dico=None): """Trouve les MLs auxquelles est abonné ``bad_guy`` et l'en supprime en demandant confirmation.""" - mls = get_mls_from_mail(bad_guy) + mls = get_mls_from_mail(bad_guy, dico) mls.sort() if mls: print("Exterminating %s from %s" % (bad_guy, ", ".join(mls))) diff --git a/mailman_search_and_destroy.py b/mailman_search_and_destroy.py index 0c6b82b..2a5cbb1 100755 --- a/mailman_search_and_destroy.py +++ b/mailman_search_and_destroy.py @@ -47,7 +47,10 @@ def files_to_mails(files): if isdelivery: results = get_context_and_mail(mail) if results: - [result] = results + if len(results) > 1: + print "hmm, strange, plusieurs matchs :" + print results + result = results[0] bad_guys.append(result) else: ans = raw_input("Headers not found. Show mail ? ")