Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core
Commits:
6f9d2db5 by Abhilash Raj at 2019-11-25T03:21:55Z
Make sure posfix_vmap files have two distinct columns.
Make sure that the vmap files has two distinct domain, even for long domain
names. The extra length added to the domain and list name is bumped to
14 = len('unsubscribe-') + 2
- - - - -
997f383e by Abhilash Raj at 2019-11-25T04:12:59Z
Merge branch 'fix-vmap' into 'master'
Make sure posfix_vmap files have two distinct columns.
Closes #651
See merge request mailman/mailman!576
- - - - -
3 changed files:
- src/mailman/docs/NEWS.rst
- src/mailman/mta/postfix.py
- src/mailman/mta/tests/test_aliases.py
Changes:
=====================================
src/mailman/docs/NEWS.rst
=====================================
@@ -23,6 +23,8 @@ Bugs
subsequent to subscribing will no longer succeed. (Closes #642)
* Fixed an issue caused by the fix for #642 where email confirmation of a
banned subscription address would cause a shunted message. (Closes #643)
+* Fixed a bug where the ``postfix_vmap`` file would merge two columns for long
+ domain names. (Closes #651)
3.3.0 -- "Tom Sawyer"
=====================================
src/mailman/mta/postfix.py
=====================================
@@ -234,7 +234,7 @@ class LMTP:
for mlist in sorted(by_domain[domain], key=sort_key):
aliases = list(utility.destinations(mlist))
width = (max(len(alias) for alias in aliases) +
- len(mlist.mail_host) + 9)
+ len(mlist.mail_host) + 14)
for alias in aliases:
addr = '{}@{}'.format(alias, mlist.mail_host)
true_addr = self._decorate(
=====================================
src/mailman/mta/tests/test_aliases.py
=====================================
@@ -405,15 +405,15 @@ [email protected]
lmtp:[127.0.0.1]:9024
contents = _strip_header(fp.read())
self.assertMultiLineEqual(contents, """\
# Virtual mappings for the @example.org domain.
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
""")
def test_vmap_regex(self):
@@ -466,13 +466,38 @@ [email protected]
[email protected]
contents = _strip_header(fp.read())
self.assertMultiLineEqual(contents, """\
# Virtual mappings for the @example.org domain.
-/^other@example\\.org$/ [email protected]
-/^other-bounces(\\+.*)?@example\\.org$/ [email protected]
-/^other-confirm(\\+.*)?@example\\.org$/ [email protected]
-/^other-join@example\\.org$/ [email protected]
-/^other-leave@example\\.org$/ [email protected]
-/^other-owner@example\\.org$/ [email protected]
-/^other-request@example\\.org$/ [email protected]
-/^other-subscribe@example\\.org$/ [email protected]
-/^other-unsubscribe@example\\.org$/ [email protected]
+/^other@example\\.org$/ [email protected]
+/^other-bounces(\\+.*)?@example\\.org$/ [email protected]
+/^other-confirm(\\+.*)?@example\\.org$/ [email protected]
+/^other-join@example\\.org$/ [email protected]
+/^other-leave@example\\.org$/ [email protected]
+/^other-owner@example\\.org$/ [email protected]
+/^other-request@example\\.org$/ [email protected]
+/^other-subscribe@example\\.org$/ [email protected]
+/^other-unsubscribe@example\\.org$/ [email protected]
""")
+
+ def test_long_list_names(self):
+ getUtility(IDomainManager).add('grups.mailsandbox.xxxxxx.org',
+ alias_domain='mail-ng.xxxxxx.org')
+ create_list('[email protected]')
+ self.postfix.regenerate(self.tempdir)
+ # There are three files in this directory.
+ self.assertEqual(sorted(os.listdir(self.tempdir)),
+ ['postfix_domains', 'postfix_lmtp', 'postfix_vmap'])
+ # Make sure vmap files has two columns instead of one overflowing and
+ # merging to other.
+ with open(os.path.join(self.tempdir, 'postfix_vmap')) as fp:
+ contents = _strip_header(fp.read())
+ self.assertMultiLineEqual(contents, """\
+# Virtual mappings for the @grups.mailsandbox.xxxxxx.org domain.
[email protected] [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
+""") # noqa: E501
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/b5b13d65bbccf293dd791eba64cba2ab3f4b67ce...997f383ec310fa7f04b6114584d9f49b67d65eca
--
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/b5b13d65bbccf293dd791eba64cba2ab3f4b67ce...997f383ec310fa7f04b6114584d9f49b67d65eca
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org