From b131d3841c3357ae64c22cf9bee21204acabad75 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sat, 9 Nov 2013 01:24:31 +0100 Subject: [PATCH] =?utf8?q?[mailman]=20truc=20oubli=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- mailman_bad_guys.py | 4 ++-- mailman_search_and_destroy.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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 ? ") -- 2.39.2