From e4302599c58732d14e2c901092b5e8df13c3f46e Mon Sep 17 00:00:00 2001 From: Jim Popovitch Date: Sun, 3 Mar 2013 15:56:11 -0500 Subject: Send monthly password reminders from virtual list(s), not sitelist --- cron/mailpasswds | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cron/mailpasswds b/cron/mailpasswds index da643761..831e9ab0 100755 --- a/cron/mailpasswds +++ b/cron/mailpasswds @@ -141,7 +141,9 @@ def main(): for host in byhost.keys(): # Site owner is `mailman@dom.ain' userinfo = {} + virtlist = {} for mlist in byhost[host]: + virtlist = mlist listaddr = mlist.GetListEmail() for member in mlist.getMembers(): # The user may have disabled reminders for this list @@ -218,7 +220,7 @@ def main(): # Add the table to the end so it doesn't get wrapped/filled text += (header + '\n' + NL.join(table)) msg = Message.UserNotification( - addr, siteowner, + addr, sitebounce, _('%(host)s mailing list memberships reminder'), text.encode(enc, 'replace'), poplang) # Note that text must be encoded into 'enc' because unicode @@ -228,11 +230,7 @@ def main(): msg['X-No-Archive'] = 'yes' del msg['auto-submitted'] msg['Auto-Submitted'] = 'auto-generated' - # We want to make this look like it's coming from the siteowner's - # list, but we also want to be sure that the apparent host name is - # the current virtual host. Look in CookHeaders.py for why this - # trick works. Blarg. - msg.send(sitelist, **{'errorsto': sitebounce, + msg.send(virtlist, **{'errorsto': sitebounce, '_nolist' : 1, 'verp' : mm_cfg.VERP_PASSWORD_REMINDERS, }) -- cgit v1.2.3 From 962c9d48558a3545fa2e319fa3033ba3aaead2ec Mon Sep 17 00:00:00 2001 From: Jim Popovitch Date: Sat, 8 Oct 2016 22:35:15 +0000 Subject: Send bounce messages from virtual domains not siteowner --- Mailman/Bouncer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Mailman/Bouncer.py b/Mailman/Bouncer.py index 29fe4ea5..47955fa3 100644 --- a/Mailman/Bouncer.py +++ b/Mailman/Bouncer.py @@ -224,7 +224,7 @@ class Bouncer: # it was of dubious value). However, we'll provide empty, strange, or # meaningless strings for the unused %()s fields so that the language # translators don't have to provide new templates. - siteowner = Utils.get_site_email(self.host_name) + owneraddr = self.GetOwnerEmail() text = Utils.maketext( 'bounce.txt', {'listname' : self.real_name, @@ -233,11 +233,10 @@ class Bouncer: 'did' : _('disabled'), 'but' : '', 'reenable' : '', - 'owneraddr': siteowner, + 'owneraddr': owneraddr, }, mlist=self) subject = _('Bounce action notification') - umsg = Message.UserNotification(self.GetOwnerEmail(), - siteowner, subject, + umsg = Message.UserNotification(owneraddr, owneraddr, subject, lang=self.preferred_language) # BAW: Be sure you set the type before trying to attach, or you'll get # a MultipartConversionError. -- cgit v1.2.3 From fc432afa375f34b935ab692619c1ba8bfb0e191a Mon Sep 17 00:00:00 2001 From: Jim Popovitch Date: Mon, 10 Oct 2016 21:47:57 +0000 Subject: Replaced UserNotification() with OwnerNotification() in two places, removed envsender override when processing owner emails (envsender was coded to use site-email, but to pass DMARC we need it to use the virtual domain) --- Mailman/Bouncer.py | 6 ++---- Mailman/Handlers/Hold.py | 3 +-- Mailman/Queue/MaildirRunner.py | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Mailman/Bouncer.py b/Mailman/Bouncer.py index 47955fa3..573b46e4 100644 --- a/Mailman/Bouncer.py +++ b/Mailman/Bouncer.py @@ -224,7 +224,6 @@ class Bouncer: # it was of dubious value). However, we'll provide empty, strange, or # meaningless strings for the unused %()s fields so that the language # translators don't have to provide new templates. - owneraddr = self.GetOwnerEmail() text = Utils.maketext( 'bounce.txt', {'listname' : self.real_name, @@ -233,11 +232,10 @@ class Bouncer: 'did' : _('disabled'), 'but' : '', 'reenable' : '', - 'owneraddr': owneraddr, + 'owneraddr': self.GetOwnerEmail(), }, mlist=self) subject = _('Bounce action notification') - umsg = Message.UserNotification(owneraddr, owneraddr, subject, - lang=self.preferred_language) + umsg = Message.OwnerNotification(self, subject, tomoderators=0) # BAW: Be sure you set the type before trying to attach, or you'll get # a MultipartConversionError. umsg.set_type('multipart/mixed') diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py index 5452d06a..d0d22690 100644 --- a/Mailman/Handlers/Hold.py +++ b/Mailman/Handlers/Hold.py @@ -264,8 +264,7 @@ def hold_for_approval(mlist, msg, msgdata, exc): d['subject'] = usersubject # craft the admin notification message and deliver it subject = _('%(listname)s post from %(sender)s requires approval') - nmsg = Message.UserNotification(owneraddr, owneraddr, subject, - lang=lang) + nmsg = Message.OwnerNotification(mlist, subject, tomoderators=1) nmsg.set_type('multipart/mixed') text = MIMEText( Utils.maketext('postauth.txt', d, raw=1, mlist=mlist), diff --git a/Mailman/Queue/MaildirRunner.py b/Mailman/Queue/MaildirRunner.py index d9fe02cb..5959dcd6 100644 --- a/Mailman/Queue/MaildirRunner.py +++ b/Mailman/Queue/MaildirRunner.py @@ -172,7 +172,6 @@ class MaildirRunner(Runner): elif subq == 'owner': msgdata.update({ 'toowner': 1, - 'envsender': Utils.get_site_email(extra='bounces'), 'pipeline': mm_cfg.OWNER_PIPELINE, }) queue = get_switchboard(mm_cfg.INQUEUE_DIR) -- cgit v1.2.3 From 2fa8a893c410648ee86d28d379f717f2a83d0fd1 Mon Sep 17 00:00:00 2001 From: Jim Popovitch Date: Mon, 10 Oct 2016 22:11:22 +0000 Subject: fixed indentation in cron/mailpasswds --- cron/mailpasswds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron/mailpasswds b/cron/mailpasswds index 831e9ab0..db9c4875 100755 --- a/cron/mailpasswds +++ b/cron/mailpasswds @@ -141,9 +141,9 @@ def main(): for host in byhost.keys(): # Site owner is `mailman@dom.ain' userinfo = {} - virtlist = {} + virtlist = {} for mlist in byhost[host]: - virtlist = mlist + virtlist = mlist listaddr = mlist.GetListEmail() for member in mlist.getMembers(): # The user may have disabled reminders for this list -- cgit v1.2.3 From 8d98726fc0aa73ab8ab17822b4331e91162f722f Mon Sep 17 00:00:00 2001 From: Jim Popovitch Date: Tue, 11 Oct 2016 15:26:21 +0000 Subject: Further changes to keep domains aligned with virtual list notification emails --- Mailman/Cgi/create.py | 5 ++--- Mailman/Handlers/Moderate.py | 5 ++--- Mailman/ListAdmin.py | 12 ++++-------- Mailman/MTA/Manual.py | 12 ++++-------- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/Mailman/Cgi/create.py b/Mailman/Cgi/create.py index dd862208..cac5a2e7 100644 --- a/Mailman/Cgi/create.py +++ b/Mailman/Cgi/create.py @@ -250,10 +250,9 @@ def process_request(doc, cgidata): 'requestaddr' : mlist.GetRequestEmail(), 'siteowner' : siteowner, }, mlist=mlist) - msg = Message.UserNotification( - owner, siteowner, + msg = Message.OwnerNotification(mlist, _('Your new mailing list: %(listname)s'), - text, mlist.preferred_language) + text=text, tomoderators=0) msg.send(mlist) # Success! diff --git a/Mailman/Handlers/Moderate.py b/Mailman/Handlers/Moderate.py index 199c97ac..f9e79cbe 100644 --- a/Mailman/Handlers/Moderate.py +++ b/Mailman/Handlers/Moderate.py @@ -174,10 +174,9 @@ def do_discard(mlist, msg): lang = mlist.preferred_language varhelp = '%s/?VARHELP=privacy/sender/discard_these_nonmembers' % \ mlist.GetScriptURL('admin', absolute=1) - nmsg = Message.UserNotification(mlist.GetOwnerEmail(), - mlist.GetBouncesEmail(), + nmsg = Message.OwnerNotification(mlist, _('Auto-discard notification'), - lang=lang) + lang=lang, tomoderators=0) nmsg.set_type('multipart/mixed') text = MIMEText(Utils.wrap(_( 'The attached message has been automatically discarded.')), diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py index af579331..13502352 100755 --- a/Mailman/ListAdmin.py +++ b/Mailman/ListAdmin.py @@ -403,10 +403,8 @@ class ListAdmin: }, mlist=self) # This message should appear to come from the -owner so as # to avoid any useless bounce processing. - owneraddr = self.GetOwnerEmail() - msg = Message.UserNotification(owneraddr, owneraddr, subject, text, - self.preferred_language) - msg.send(self, **{'tomoderators': 1}) + msg = Message.OwnerNotification(self, subject, text=text, + tomoderators=1) # Restore the user's preferred language. i18n.set_language(lang) @@ -460,10 +458,8 @@ class ListAdmin: }, mlist=self) # This message should appear to come from the -owner so as # to avoid any useless bounce processing. - owneraddr = self.GetOwnerEmail() - msg = Message.UserNotification(owneraddr, owneraddr, subject, text, - self.preferred_language) - msg.send(self, **{'tomoderators': 1}) + msg = Message.OwnerNotification(self, subject, text=text, + tomoderators=1) def __handleunsubscription(self, record, value, comment): addr = record diff --git a/Mailman/MTA/Manual.py b/Mailman/MTA/Manual.py index 92e1c03c..46adfae2 100644 --- a/Mailman/MTA/Manual.py +++ b/Mailman/MTA/Manual.py @@ -94,10 +94,9 @@ equivalent) file by adding the following lines, and possibly running the # this request. siteowner = Utils.get_site_email(extra='owner') # Should this be sent in the site list's preferred language? - msg = Message.UserNotification( - siteowner, siteowner, + msg = Message.OwnerNotification(mlist, _('Mailing list creation request for list %(listname)s'), - sfp.getvalue(), mm_cfg.DEFAULT_SERVER_LANGUAGE) + sfp.getvalue()) msg.send(mlist) @@ -135,12 +134,9 @@ equivalent) file by removing the following lines, and possibly running the if not cgi: print >> outfp return - siteowner = Utils.get_site_email(extra='owner') - # Should this be sent in the site list's preferred language? - msg = Message.UserNotification( - siteowner, siteowner, + msg = Message.OwnerNotification(mlist, _('Mailing list removal request for list %(listname)s'), - sfp.getvalue(), mm_cfg.DEFAULT_SERVER_LANGUAGE) + sfp.getvalue()) msg['Date'] = email.Utils.formatdate(localtime=1) outq = get_switchboard(mm_cfg.OUTQUEUE_DIR) outq.enqueue(msg, recips=[siteowner], nodecorate=1) -- cgit v1.2.3 From 17cc3dae404831d29c1d8ea4794105cdbbe3bbb7 Mon Sep 17 00:00:00 2001 From: Jim Popovitch Date: Wed, 12 Oct 2016 14:38:43 +0000 Subject: OwnerNotification needs to explictly set msg.envsender rather than relying on the downstream pipeline to get it right (too often it gets it wrong and sets Sender to sitelist domain) --- Mailman/Message.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Mailman/Message.py b/Mailman/Message.py index 24c15a84..609786a2 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -318,6 +318,7 @@ class OwnerNotification(UserNotification): del self['to'] self['To'] = mlist.GetOwnerEmail() self._sender = sender + self.envsender = sender def _enqueue(self, mlist, **_kws): # Not imported at module scope to avoid import loop -- cgit v1.2.3 From f381505907c2a810835a711c8b4e19d10092a069 Mon Sep 17 00:00:00 2001 From: Jim Popovitch Date: Wed, 19 Oct 2016 04:07:14 +0000 Subject: force OwnerNotification to use mlist.getListAddress('bounces') --- Mailman/Message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mailman/Message.py b/Mailman/Message.py index 609786a2..0edc3c31 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -311,7 +311,7 @@ class OwnerNotification(UserNotification): recips.extend(mlist.moderator) # We have to set the owner to the site's -bounces address, otherwise # we'll get a mail loop if an owner's address bounces. - sender = Utils.get_site_email(mlist.host_name, 'bounces') + sender = mlist.getListAddress('bounces') lang = mlist.preferred_language UserNotification.__init__(self, recips, sender, subject, text, lang) # Hack the To header to look like it's going to the -owner address -- cgit v1.2.3 From 73fd31d3a6a9083bc7a3e782575ef581a0596af6 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 24 May 2017 16:04:00 -0700 Subject: Changed member_verbosity_threshold from a >= test to a strictly > test. --- Mailman/Utils.py | 4 ++-- NEWS | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 739def1d..75481563 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -1391,7 +1391,7 @@ fact is returned.""" del recentMemberPostings[addr] if not mlist.isMember(email): return False - return (len(recentMemberPostings.get(email, [])) >= + return (len(recentMemberPostings.get(email, [])) > mlist.member_verbosity_threshold ) diff --git a/NEWS b/NEWS index 9c38b72e..7314432b 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,10 @@ Here is a history of user visible changes to Mailman. Bug fixes and other patches + - Changed member_verbosity_threshold from a >= test to a strictly > test + to avoid the issue of moderating every post when the threshold = 1. + (LP: #1693366) + - Subject prefixing has been improved to always have a space between the prefix and the subject even with non-ascii in the prefix. This will sometimes result in two spaces when the prefix is non-ascii but -- cgit v1.2.3 From f0950842497d8c8de6422f8fa94b2df398e9932a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 30 May 2017 13:41:30 -0700 Subject: Display only the list-owner address in the 'list run by' footer. --- Mailman/HTMLFormatter.py | 5 ++--- NEWS | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Mailman/HTMLFormatter.py b/Mailman/HTMLFormatter.py index 5fcce75b..2a3e08db 100644 --- a/Mailman/HTMLFormatter.py +++ b/Mailman/HTMLFormatter.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -40,8 +40,7 @@ COMMASPACE = ', ' class HTMLFormatter: def GetMailmanFooter(self): - ownertext = COMMASPACE.join([Utils.ObscureEmail(a, 1) - for a in self.owner]) + ownertext = Utils.ObscureEmail(self.GetOwnerEmail(), 1) # Remove the .Format() when htmlformat conversion is done. realname = self.real_name hostname = self.host_name diff --git a/NEWS b/NEWS index 7314432b..ed14ae8b 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,9 @@ Here is a history of user visible changes to Mailman. Bug fixes and other patches + - The 'list run by' addresses in web page footers are now just the + list-owner address. (LP: #1694384) + - Changed member_verbosity_threshold from a >= test to a strictly > test to avoid the issue of moderating every post when the threshold = 1. (LP: #1693366) -- cgit v1.2.3 From 8638f2ca443344a5971ff7c415707384e6ebae13 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 30 May 2017 15:06:15 -0700 Subject: Added list-owner@virtual.domain addresses to virtual-mailman. --- Mailman/MTA/Postfix.py | 35 +++++++++++++++++++++++++++++------ NEWS | 3 +++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py index d18d850b..aed36bc4 100644 --- a/Mailman/MTA/Postfix.py +++ b/Mailman/MTA/Postfix.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2016 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2017 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -131,13 +131,21 @@ def _addvirtual(mlist, fp): # And the site list posting address. siteaddr = Utils.get_site_email(mlist.host_name) sitedest = Utils.ParseEmail(siteaddr)[0] + # And the site list -owner address. + siteowneraddr = Utils.get_site_email(mlist.host_name, extra='owner') + siteownerdest = Utils.ParseEmail(siteowneraddr)[0] if mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN: loopdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN sitedest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN - # If the site list's host_name is a virtual domain, adding it to the - # SITE ADDRESSES will duplicate the list posting entry, so comment it. - if _isvirtual(MailList(mm_cfg.MAILMAN_SITE_LIST, lock=False)): + siteownerdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN + # If the site list's host_name is a virtual domain, adding the list and + # owner addresses to the SITE ADDRESSES will duplicate the entries in the + # stanza for the list. Postfix doesn't like dups so we try to comment them + # here, but only for the actual site list domain. + if (MailList(mm_cfg.MAILMAN_SITE_LIST, lock=False).host_name.lower() == + hostname.lower()): siteaddr = '#' + siteaddr + siteowneraddr = '#' + siteowneraddr # Seek to the end of the text file, but if it's empty write the standard # disclaimer, and the loop catch address and site address. fp.seek(0, 2) @@ -156,11 +164,14 @@ def _addvirtual(mlist, fp): # LOOP ADDRESSES END # We also add the site list address in each virtual domain as that address -# is exposed on admin and listinfo overviews. +# is exposed on admin and listinfo overviews, and we add the site list-owner +# address as it is exposed in the list created email notice. + # SITE ADDRESSES START %s\t%s +%s\t%s # SITE ADDRESSES END -""" % (loopaddr, loopdest, siteaddr, sitedest) +""" % (loopaddr, loopdest, siteaddr, sitedest, siteowneraddr, siteownerdest) # The text file entries get a little extra info print >> fp, '# STANZA START:', listname print >> fp, '# CREATED:', time.ctime(time.time()) @@ -185,9 +196,20 @@ def _check_for_virtual_loopaddr(mlist, filename): loopdest = Utils.ParseEmail(loopaddr)[0] siteaddr = Utils.get_site_email(mlist.host_name) sitedest = Utils.ParseEmail(siteaddr)[0] + siteowneraddr = Utils.get_site_email(mlist.host_name, extra='owner') + siteownerdest = Utils.ParseEmail(siteowneraddr)[0] if mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN: loopdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN sitedest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN + siteownerdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN + # If the site list's host_name is a virtual domain, adding the list and + # owner addresses to the SITE ADDRESSES will duplicate the entries in the + # stanza for the list. Postfix doesn't like dups so we try to comment them + # here, but only for the actual site list domain. + if (MailList(mm_cfg.MAILMAN_SITE_LIST, lock=False).host_name.lower() == + mlist.host_name.lower()): + siteaddr = '#' + siteaddr + siteowneraddr = '#' + siteowneraddr infp = open(filename) omask = os.umask(007) try: @@ -237,6 +259,7 @@ def _check_for_virtual_loopaddr(mlist, filename): if line.startswith('# SITE ADDRESSES END'): # It hasn't print >> outfp, '%s\t%s' % (siteaddr, sitedest) + print >> outfp, '%s\t%s' % (siteowneraddr, siteownerdest) outfp.write(line) break elif line.startswith(siteaddr) or line.startswith('#' + siteaddr): diff --git a/NEWS b/NEWS index ed14ae8b..b6c84275 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,9 @@ Here is a history of user visible changes to Mailman. Bug fixes and other patches + - The list-owner@virtual.domain addresses are now added to virtual-mailman + as they are exposed in 'list created' emails. (LP: 1694384) + - The 'list run by' addresses in web page footers are now just the list-owner address. (LP: #1694384) -- cgit v1.2.3 From a6669234ed864cadd85fdaf3f8cc86e442bdc30f Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 2 Jun 2017 15:28:01 -0700 Subject: Bumped branch version to: 2.1.24 --- Mailman/Version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mailman/Version.py b/Mailman/Version.py index 22fa59be..48fea21d 100644 --- a/Mailman/Version.py +++ b/Mailman/Version.py @@ -16,7 +16,7 @@ # USA. # Mailman version -VERSION = '2.1.23' +VERSION = '2.1.24' # And as a hex number in the manner of PY_VERSION_HEX ALPHA = 0xa @@ -28,7 +28,7 @@ FINAL = 0xf MAJOR_REV = 2 MINOR_REV = 1 -MICRO_REV = 23 +MICRO_REV = 24 REL_LEVEL = FINAL # at most 15 beta releases! REL_SERIAL = 0 -- cgit v1.2.3