[ mailman-Patches-707624 ] SMTPDirect doesn't use persistent SMTP connections

SourceForge.net noreply at sourceforge.net
Fri Mar 21 09:26:28 EST 2003


Patches item #707624, was opened at 2003-03-21 18:26
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=300103&aid=707624&group_id=103

Category: mail delivery
Group: Mailman 2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Jesús Cea Avión (jcea)
Assigned to: Nobody/Anonymous (nobody)
Summary: SMTPDirect doesn't use persistent SMTP connections

Initial Comment:
Mailman 2.1.1 here.

"/Mailman/Handlers/SMTPDirect.py" is suppose to reuse
SMTP connections up to
"mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION" different
messages.

Nevertheless, it's NOT the case: "SMTPDirect" drop the
connection when send each message. This is an important
CPU hog when mailman has a long queue spool.

Here is the patch (sorry, I can't send it as an attach,
shame on me). It's fairly trivial :

>>>>>

Index: SMTPDirect.py
===================================================================
RCS file:
/opt/src/cvsroot/mailman/Mailman/Handlers/SMTPDirect.py,v
retrieving revision 1.1.1.5
retrieving revision 1.1.1.5.2.1
diff -u -u -r1.1.1.5 -r1.1.1.5.2.1
--- SMTPDirect.py       2003/03/20 10:14:58     1.1.1.5
+++ SMTPDirect.py       2003/03/21 16:48:31     1.1.1.5.2.1
@@ -48,7 +48,7 @@
 
 
 # Manage a connection to the SMTP server
-class Connection:
+class ConnectionClass:
     def __init__(self):
         self.__connect()
 
@@ -79,7 +79,15 @@
     def quit(self):
         self.__conn.quit()
 
+    def rset(self) :
+        self.__conn.rset()
 
+    def __del__(self) :
+        self.quit()
+
+
+Connection=ConnectionClass()
+
 
 def process(mlist, msg, msgdata):
     recips = msgdata.get('recips')
@@ -130,7 +138,7 @@
     # This means at worst, the last chunk for which
delivery was attempted
     # could get duplicates but not every one, and no
recips should miss the
     # message.
-    conn = Connection()
+    conn = Connection
     try:
         msgdata['undelivered'] = chunks
         while chunks:
@@ -147,7 +155,8 @@
                 raise
         del msgdata['undelivered']
     finally:
-        conn.quit()
+        conn.rset()
+        # conn.quit()
         msgdata['recips'] = origrecips
     # Log the successful post
     t1 = time.time()

<<<<<


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=300103&aid=707624&group_id=103



More information about the Mailman-coders mailing list