How to increase maximum size of the message in mailman
Hi Team,
I am currently running Mailman 3 with version 3.3.1 and in-built
postfix version 2.10.1-6 on RHEL 7.5 with PostgreSQL 11.7 version with default values. I am almost running 2200 lists with 128 GB RAM and 24 Cores on a single VM and on which all the mailman 3 components are running. I have been running this setup in production for the past 2 years and 6 months.
I have recently encountered a scenario where a user sent mail
with a PPT attachment to one of the lists on the said mailman server. The mail is received by postfix on the mailman server and is handed over to mailman at *0.0.0.0:8024 <http://0.0.0.0:8024>.*
But the /var/log/maillog says the below error during the above
hand shake.
*status=bounced (host 0.0.0.0[0.0.0.0] said: 552 Error: Too much mail data*
I have browsed google for understanding and fixing the issue.
During which I encountered the information given by Mr. Mark Sapio at https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/G.... But I could not fix the issue as it is mentioned the default size limit is 33554432.
I request someone to suggest where I can customize the value 33554432 and put a higher value or can be configured without any limit. I have configured message_size_limit as 100MB at postfix level. I would like to configure, in fact, the same at mailman level too. But I don't understand where to edit.
I tried editing the variable DATA_SIZE_DEFAULT value in /var/lib/mailman/mailman/.tox/py36-nocov/lib/python3.6/site-packages/aiosmtpd/smtp.py file but unfortunately no luck.
So, could someone please help us in this regard ?
Also, please also let me know if there is any limitation specific for the attachments so that I can customize that too respectively.
Thanks & Regards, Shashi Kanth.K 9052671936
Shashikanth Komandoor writes:
But the /var/log/maillog says the below error during the above
hand shake.
*status=bounced (host 0.0.0.0[0.0.0.0] said: 552 Error: Too much mail data*
I have browsed google for understanding and fixing the issue.
During which I encountered the information given by Mr. Mark Sapio at https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/G.... But I could not fix the issue as it is mentioned the default size limit is 33554432.
There's no way to configure the LMTP server's message_size_limit in Mailman; this is a bug but I can't say when it will be fixed.
In mailman/src/mailman/runners/lmtp.py, class LMTPController, if you edit the line
server = LMTP(self.handler)
to
server = LMTP(self.handler, data_size_limit=100_000_000)
it should have the desired effect. (I think that if as suggested by your post you're using Python 3.6, you'll have to remove the underscores from "100_000_000"; that feature was added in 3.7.)
Unfortunately, any time you upgrade Mailman you'll have to edit it again (that's why I say this is a bug).
I do not understand why the approach you used of editing DATA_SIZE_DEFAULT in aiosmtpd/smtp.py didn't work. The only thing I can imagine is that you have multiple Python installations and the one you edited is not the one that Mailman is currently using, or the same issue for multiple Mailman installations each with their own venvs or whatever.
You also will have to configure Mailman. If you haven't done so already, the procedure is
- Sign into Postorius as owner of the list,
- click on the tab "Settings" in the middle of the header under the name of the list,
- click on "Message Acceptance" in the sidebar at the left, and
- set "Maximum message size" to 100000 (kb; no commas or periods).
Unlike the LMTP size setting above, this configuration will persist across Mailman upgrades.
Also, please also let me know if there is any limitation specific for the attachments so that I can customize that too respectively.
No.
Steve
On 8/31/21 7:06 AM, Stephen J. Turnbull wrote:
There's no way to configure the LMTP server's message_size_limit in Mailman; this is a bug but I can't say when it will be fixed.
There is no configuration option, but one can apply a patch like: --- a/src/mailman/runners/lmtp.py +++ b/src/mailman/runners/lmtp.py @@ -229,7 +229,7 @@ class LMTPHandler: class LMTPController(Controller): def factory(self): - server = LMTP(self.handler) + server = LMTP(self.handler, data_size_limit=999999999999) server.__ident__ = 'GNU Mailman LMTP runner 2.0' return server See https://aiosmtpd.readthedocs.io/en/latest/smtp.html#aiosmtpd.smtp.SMTP -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Mark Sapiro
-
Shashikanth Komandoor
-
Stephen J. Turnbull