]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/mailer.py
- drop util.sendfile, use shutil.copyfileobj instead
[tld-builder.git] / TLD_Builder / mailer.py
index f76a8bda289957ad214e462951fb4a844f3ec463..764bdf416d8845ad3e15fcb99a77339817f8a0e4 100644 (file)
@@ -5,7 +5,7 @@ import os
 import sys
 from io import StringIO
 from config import config
-import util
+import shutil
 import log
 
 def recode(s):
@@ -58,7 +58,7 @@ class Message:
                     self.body.write("\n\n[...]\n\n")
                 line += 1
         else:
-            util.sendfile(open(log), self.body)
+            shutil.copyfileobj(open(log), self.body)
 
     def set_std_headers(self):
         self.headers["Date"] = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime())
@@ -73,7 +73,7 @@ class Message:
             f.write("%s: %s\n" % (k, v))
         f.write("\n")
         self.body.seek(0)
-        util.sendfile(self.body, f)
+        shutil.copyfileobj(self.body, f)
 
     def send(self):
         if not os.path.exists("/usr/lib/sendmail"):