Applied patch from Tomi Tuominen to fix deprecation warning.
[eoc.git] / eoc.py
diff --git a/eoc.py b/eoc.py
index f855b36333737e77f1599a551ba107f9732ded1c..ac899233bf4bb3e92906688383665c37725608bf 100644 (file)
--- a/eoc.py
+++ b/eoc.py
@@ -4,11 +4,11 @@ This is a simple mailing list manager that mimicks the ezmlm-idx mail
 address commands. See manual page for more information.
 """
 
-VERSION = "1.2.4"
+VERSION = "1.2.6"
 PLUGIN_INTERFACE_VERSION = "1"
 
 import getopt
-import md5
+import hashlib
 import os
 import shutil
 import smtplib
@@ -78,8 +78,7 @@ COMMANDS = SIMPLE_COMMANDS + SUB_COMMANDS + HASH_COMMANDS
 
 
 def md5sum_as_hex(s):
-    return md5.new(s).hexdigest()
-
+    return hashlib.md5(s).hexdigest()
 
 def forkexec(argv, text):
     """Run a command (given as argv array) and write text to its stdin"""
@@ -440,7 +439,7 @@ class MailingListManager:
                     sys.exit(1)
             else:
                 status = forkexec([self.sendmail, "-oi", "-f", 
-                                   envelope_sender] + recipienients, text)
+                                   envelope_sender] + recipients, text)
                 if status:
                     error("%s returned %s, mail sending probably failed" %
                            (self.sendmail, status))
@@ -551,7 +550,7 @@ class MailingList:
         
             return "\n".join(headers) + "\n\n" + body
         except:
-            warning("Cannot MIME encode header, using original ones, sorry")
+            info("Cannot MIME encode header, using original ones, sorry")
             return text
 
     def template(self, template_name, dict):
@@ -657,7 +656,7 @@ class MailingList:
                                           "boundary": self.invent_boundary(),
                                        })
         else:
-            self.info_message([recipient], "setlist-sorry", {})
+            self.send_info_message([recipient], "setlist-sorry", {})
 
     def parse_setlist_addresses(self, text):
         body = text.split("\n\n", 1)[1]