Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core
Commits:
469b0056 by Mark Sapiro at 2020-09-12T20:17:35-07:00
Fix gatenews to add original_size to msgdata.
- - - - -
71fac20a by Mark Sapiro at 2020-09-13T03:43:13+00:00
Merge branch 'nntp' into 'master'
Fix gatenews to add original_size to msgdata.
See merge request mailman/mailman!702
- - - - -
3 changed files:
- src/mailman/commands/cli_gatenews.py
- src/mailman/commands/tests/test_cli_gatenews.py
- src/mailman/docs/NEWS.rst
Changes:
=====================================
src/mailman/commands/cli_gatenews.py
=====================================
@@ -107,6 +107,7 @@ def poll_newsgroup(mlist, conn, first, last, glock):
inq = config.switchboards['in']
inq.enqueue(msg,
listid=mlist.list_id,
+ original_size=len(msg.as_bytes()),
fromusenet=True)
log.info('posted to list %s: %7d', listname, num)
except nntplib.NNTPError as e:
=====================================
src/mailman/commands/tests/test_cli_gatenews.py
=====================================
@@ -240,3 +240,11 @@ class Test_gatenews(TestCase):
'my.group:2'))
self.assertEqual(lines[3], 'Bad message')
self.assertTrue(lines[4].endswith('[email protected] watermark: 3'))
+
+ def test_original_size_in_msgdata(self):
+ with get_nntplib_nntp():
+ self._command.invoke(gatenews)
+ items = get_queue_messages('in', expected_count=1)
+ msgdata = items[0].msgdata
+ self.assertTrue(msgdata.get('original_size', False))
+ self.assertEqual(msgdata['original_size'], 184)
=====================================
src/mailman/docs/NEWS.rst
=====================================
@@ -43,6 +43,8 @@ Bugs
* Messages in digests now contain a ``Message: N`` header. (Closes #764)
* The LMTP runner will now add a ``Message-ID:`` header if missing.
(Closes #448 and #490)
+* The ``mailman gatenews`` command now adds ``original_size`` to the msgdata.
+ (Closes #762)
Command line
------------
View it on GitLab:
https://gitlab.com/mailman/mailman/-/compare/2a3a6ac912f2844194d95f4627b5b09eff9d24f0...71fac20aa6df548ebbbe71693dce328ac5ed692a
--
View it on GitLab:
https://gitlab.com/mailman/mailman/-/compare/2a3a6ac912f2844194d95f4627b5b09eff9d24f0...71fac20aa6df548ebbbe71693dce328ac5ed692a
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: [email protected]