ports/116847: [PATCH] Add postfix VERP support to mail/mailman

Xin LI delphij at FreeBSD.org
Wed Oct 3 00:30:05 UTC 2007


>Number:         116847
>Category:       ports
>Synopsis:       [PATCH] Add postfix VERP support to mail/mailman
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 03 00:30:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Xin LI
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD tarsier.delphij.net 7.0-CURRENT FreeBSD 7.0-CURRENT #3: Wed Sep 19 21:08:02 CST 2007 delphij at tarsier.delphij.net:/usr/obj/usr/src/sys/TARSIER i386


>Description:
	In recent Postfix releases the SMTP server has supplied an VERP functionality
which will drastically improve performance of mail delivery when using in conjuction
with Mailman.

	While the patch was submitted to Mailman developers years ago they does not
seem to adopt it.

	The proposed patch adds the support of XVERP delivery to Mailman when
WITH_POSTFIX is specified or choosen in OPTIONS menu.  It is disabled by default
but can easily enabled with VERP_STYLE = 'Postfix' in mm_cfg.py.

	This version of patch is what is running at cn.FreeBSD.org's production
mailing list.

	Maintainer (jmelo@) cc'ed.
>How-To-Repeat:
	Mailman can not use XVERP extension of the Postfix SMTP server.
>Fix:


--- mailman-verp.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/mailman/Makefile,v
retrieving revision 1.73
diff -u -p -r1.73 Makefile
--- Makefile	4 Sep 2007 14:50:56 -0000	1.73
+++ Makefile	2 Oct 2007 20:37:22 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	mailman
 DISTVERSION=	2.1.9
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES?=	mail
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE} \
 		http://www.list.org/
@@ -95,6 +95,7 @@ defined(WITH_COURIER)
 BROKEN=	choose only one MTA integration
 .endif
 MAIL_GID?=	mailman
+EXTRA_PATCHES+=	${FILESDIR}/postfix-verp.diff
 .endif
 
 .if defined(WITH_COURIER)
Index: files/patch-Mailman::Defaults.py.in
===================================================================
RCS file: /home/ncvs/ports/mail/mailman/files/patch-Mailman::Defaults.py.in,v
retrieving revision 1.3
diff -u -p -r1.3 patch-Mailman::Defaults.py.in
--- files/patch-Mailman::Defaults.py.in	20 Jan 2003 13:07:34 -0000	1.3
+++ files/patch-Mailman::Defaults.py.in	3 Oct 2007 00:11:21 -0000
@@ -1,6 +1,6 @@
---- Mailman/Defaults.py.in.orig	Thu Dec 26 21:48:41 2002
-+++ Mailman/Defaults.py.in	Mon Jan 20 14:07:05 2003
-@@ -97,7 +97,7 @@
+--- Mailman/Defaults.py.in.orig	2006-08-04 20:20:33.000000000 +0800
++++ Mailman/Defaults.py.in	2007-10-03 08:09:00.678284951 +0800
+@@ -107,7 +107,7 @@
  # Command that is used to convert text/html parts into plain text.  This
  # should output results to standard output.  %(filename)s will contain the
  # name of the temporary file that the program should operate on.
@@ -9,7 +9,7 @@
  
  
  
-@@ -356,8 +356,8 @@
+@@ -392,8 +392,8 @@
  # and virtual-mailman.db files, respectively, from the associated plain text
  # files.  The file being updated will be appended to this string (with a
  # separating space), so it must be appropriate for os.system().
@@ -20,7 +20,7 @@
  
  # Ceiling on the number of recipients that can be specified in a single SMTP
  # transaction.  Set to 0 to submit the entire recipient list in one
-@@ -391,7 +391,7 @@
+@@ -427,7 +427,7 @@
  
  # Command for direct command pipe delivery to sendmail compatible program,
  # when DELIVERY_MODULE is 'Sendmail'.
@@ -29,3 +29,16 @@
  
  # Set these variables if you need to authenticate to your NNTP server for
  # Usenet posting or reading.  If no authentication is necessary, specify None
+@@ -661,6 +661,12 @@
+ # debugging).
+ MAX_AUTORESPONSES_PER_DAY = 10
+ 
++# This FreeBSD port of Mailman can utilize Postfix SMTP server's VERP ability.
++# You may set VERP_STYLE = 'Postfix' to enable it.
++VERP_STYLE = 'Manual'
++
++# When using Postfix style VERP you will need the following setting.
++POSTFIX_XVERP_OPTS = '+='
+ 
+ 
+ #####
Index: files/postfix-verp.diff
===================================================================
RCS file: files/postfix-verp.diff
diff -N files/postfix-verp.diff
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/postfix-verp.diff	3 Oct 2007 00:13:43 -0000
@@ -0,0 +1,51 @@
+--- Mailman/Handlers/SMTPDirect.py.orig	2005-12-31 02:50:08.000000000 +0800
++++ Mailman/Handlers/SMTPDirect.py	2007-10-03 08:12:39.402049123 +0800
+@@ -64,11 +64,11 @@
+         self.__conn.connect(mm_cfg.SMTPHOST, mm_cfg.SMTPPORT)
+         self.__numsessions = mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION
+ 
+-    def sendmail(self, envsender, recips, msgtext):
++    def sendmail(self, envsender, recips, msgtext, mailopts=[]):
+         if self.__conn is None:
+             self.__connect()
+         try:
+-            results = self.__conn.sendmail(envsender, recips, msgtext)
++            results = self.__conn.sendmail(envsender, recips, msgtext, mailopts)
+         except smtplib.SMTPException:
+             # For safety, close this connection.  The next send attempt will
+             # automatically re-open it.  Pass the exception on up.
+@@ -114,7 +114,7 @@
+     # recipients they'll swallow in a single transaction.
+     deliveryfunc = None
+     if (not msgdata.has_key('personalize') or msgdata['personalize']) and (
+-           msgdata.get('verp') or mlist.personalize):
++           (msgdata.get('verp') and mm_cfg.VERP_STYLE == 'Manual') or mlist.personalize):
+         chunks = [[recip] for recip in recips]
+         msgdata['personalize'] = 1
+         deliveryfunc = verpdeliver
+@@ -357,8 +357,14 @@
+     # Errors-To while new ones will at worst ignore the header.
+     del msg['sender']
+     del msg['errors-to']
+-    msg['Sender'] = envsender
+-    msg['Errors-To'] = envsender
++    mailopts=[]
++    if msgdata.get('verp') and mm_cfg.VERP_STYLE == 'Postfix':
++        mailopts.append('XVERP=' + mm_cfg.POSTFIX_XVERP_OPTS)
++    else:
++        # these get left out of VERPed messages so they don't accidently
++        # override the VERP header.
++        msg['Sender'] = envsender
++        msg['Errors-To'] = envsender
+     # Get the plain, flattened text of the message, sans unixfrom
+     msgtext = msg.as_string()
+     refused = {}
+@@ -366,7 +372,7 @@
+     msgid = msg['message-id']
+     try:
+         # Send the message
+-        refused = conn.sendmail(envsender, recips, msgtext)
++        refused = conn.sendmail(envsender, recips, msgtext, mailopts)
+     except smtplib.SMTPRecipientsRefused, e:
+         syslog('smtp-failure', 'All recipients refused: %s, msgid: %s',
+                e, msgid)
--- mailman-verp.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list