Changing default language for lists
How can I change the default language for lists (and other defaults)? I changed it in mailman-core but Postorius overrides these core defaults with a patch.
I am using the docker version of maxking
Wessel
Wessel Kraaij writes:
How can I change the default language for lists (and other defaults)? I changed it in mailman-core but Postorius overrides these core defaults with a patch.
You need to be more specific about what you did, what you expect to happen in various cases, and what you mean by "patch".
Specifically, what language do you want as default, how did you spell it in mailman.cfg, have you checked that there are no list-specific settings (that override the default), is the problem in distributed posts, in Mailman-generated notifications, or in web pages? Specifically which part of posts, notifications, or web pages have unexpected languages? What language are they supposed to be, and what language(s) do you see?
For context, here is how language setting works:
In mailman.cfg (usually located at /etc/mailman3/mailman.cfg), there
is a default_language variable in the [mailman] section (hardcoded
to "en" if not overridden). This can be overridden on a per-list
basis, usually configured using Postorius. Postorius has read-only
access to the default_language setting, I believe, but I am not aware
of any way for Postorius to set it.
The settings in Mailman core directly control which language's templates and gettext substitutions are used in emails generated by Mailman and in footers and the like added to posts distributed by Mailman. In any given context, for each substitution, the list's language is checked for a translation, then the site's default language, then English is the fallback. You can end up with mixed languages if some contexts have not been translated.
Postorius and HyperKitty both use their own templates which are
separately provided in those packages. As far as I know they do not
have a default language setting of their own (although the Django
framework probably does, we don't use that). Instead, through the
mailmanclient library they read the current list's preferences (and
Postorius can change the list preference but not the site default),
and fetch templates and variable substitutions in the same way. It is
quite possible that the language you specified is missing the
translations you're looking for, or that the language code you
specified is not one that Mailman recognizes.
I am using the docker version of maxking
I don't think that matters, but Abhilash (maxking) is the only real expert on docker-mailman, and he's not following this list closely at this time. Check the docker-mailman documentation for the preferred method of communicating with him if it seems to be relevant.
Regards, Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
Hi, thanks for your response. I realize my question was underspecified.
What happened: I changed several defaults in mailman core (e.g. preferred language). However, Postorius (maxking version) initializes the defaults for new lists and overrides the core defaults using a PATCH call on the REST API.
With the aid of some gentle AI chatbot, I was able to fix the problem in Postorius, by patching the list.py file to read and apply defauls from the config file (in maxking's version that is setting_local.py).
I am talking about Dutch. Here is the code snippet that solved my issue
from django.conf import settings as django_settings for key, value in getattr(django_settings, 'DEFAULT_LIST_SETTINGS', {}).items(): list_settings[key] = value list_settings.save()
(added in list_new)
I added the following 'defaults' in my settings file: DEFAULT_LIST_SETTINGS = { 'preferred_language': 'nl', 'subscription_policy': 'confirm', 'default_member_action': 'defer', 'default_nonmember_action': 'hold', 'reply_goes_to_list': 'point_to_list', 'reply_to_address': '', 'max_message_size': 10240, 'anonymous_list': False, 'dmarc_mitigate_action': 'munge_from', 'collapse_alternatives': False, 'dmarc_mitigate_unconditionally': True, }
This way each new list is properly initiated.
Best regards,
Wessel
-----Oorspronkelijk bericht----- Van: Stephen J. Turnbull <steve@turnbull.jp> Verzonden: zaterdag 11 april 2026 19:25 Aan: Wessel Kraaij <wessel.kraaij@outlook.com> CC: mailman-users@mailman3.org Onderwerp: [MM3-users] Changing default language for lists
Wessel Kraaij writes:
How can I change the default language for lists (and other > defaults)? I changed it in mailman-core but Postorius overrides > these core defaults with a patch.
You need to be more specific about what you did, what you expect to happen in various cases, and what you mean by "patch".
Specifically, what language do you want as default, how did you spell it in mailman.cfg, have you checked that there are no list-specific settings (that override the default), is the problem in distributed posts, in Mailman- generated notifications, or in web pages? Specifically which part of posts, notifications, or web pages have unexpected languages? What language are they supposed to be, and what language(s) do you see?
For context, here is how language setting works:
In mailman.cfg (usually located at /etc/mailman3/mailman.cfg), there is a
default_languagevariable in the [mailman] section (hardcoded to "en" if not overridden). This can be overridden on a per-list basis, usually configured using Postorius. Postorius has read-only access to the default_language setting, I believe, but I am not aware of any way for Postorius to set it.The settings in Mailman core directly control which language's templates and gettext substitutions are used in emails generated by Mailman and in footers and the like added to posts distributed by Mailman. In any given context, for each substitution, the list's language is checked for a translation, then the site's default language, then English is the fallback. You can end up with mixed languages if some contexts have not been translated.
Postorius and HyperKitty both use their own templates which are separately provided in those packages. As far as I know they do not have a default language setting of their own (although the Django framework probably does, we don't use that). Instead, through the
mailmanclientlibrary they read the current list's preferences (and Postorius can change the list preference but not the site default), and fetch templates and variable substitutions in the same way. It is quite possible that the language you specified is missing the translations you're looking for, or that the language code you specified is not one that Mailman recognizes.I am using the docker version of maxking
I don't think that matters, but Abhilash (maxking) is the only real expert on docker-mailman, and he's not following this list closely at this time. Check the docker-mailman documentation for the preferred method of communicating with him if it seems to be relevant.
Regards, Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww w.siriusopensource.com%2F&data=05%7C02%7C%7Ca86b6a6a504d4285dc 8508de97ef499c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C6 39115251139974756%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGki OnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjo yfQ%3D%3D%7C0%7C%7C%7C&sdata=EBR2PY36Mm5nldbPpSwT%2FgEuIe CnuD6JqHUhGEE6GEM%3D&reserved=0 Software systems consulting in Europe, North America, and Japan
Wessel Kraaij writes:
I changed several defaults in mailman core (e.g. preferred language).
Do you mean "default_language"? There is no default "preferred language"; that's a list-specific setting.
And what do you mean by "changed in mailman core"? Settings in mailman.cfg? Source patches?
However, Postorius (maxking version) initializes the defaults for new lists and overrides the core defaults using a PATCH call on the REST API.
I don't understand why that would happen. The core defaults are the source of the initial values in the create list form. Specifically, when Postorius creates a list, it initializes a proxy object in mailmanclient, which talks REST API to Mailman core, which creates an actual MailingList object. This uses the defaults from the system_defaults object or default style if one is defined. This is reflected in Postorius's proxy MailingList, which is used to initialize values in the form presented to the administrator. Then they can change various aspects of the list's identity including preferred language from that form.
So if you have set default_language in the [mailman] section of mailman.cfg, you should get the desired initial preferred language for your lists.
As far as I know, this hasn't been reported before. It's not happening to most installations (and many of them do specify default_language). It's true that docker-mailman is not the most common configuration, but it does use stock mailman and postorius from PyPI. So I really don't understand why you have a problem if you are creating mailman.cfg correctly.
With the aid of some gentle AI chatbot,
Heaven preserve us from *all* AI chatbots, gentle or violent. All are sources of bad advice and annoyance to volunteer software maintainers.
You absolutely should not need to patch any code to do what you want to do with preferred_language.
Here is the code snippet [added to list_new in postorius/views/list.py] that solved my issue
This is a bad idea. You will have to remember to patch Postorius
again if you ever update it. Also, if for some reason you ever create
lists using the mailman create utility, mailman shell, or a REST
API client, these settings will not be applied to those lists.
I added the following 'defaults' in my settings file: DEFAULT_LIST_SETTINGS = { 'preferred_language': 'nl', 'subscription_policy': 'confirm', 'default_member_action': 'defer', 'default_nonmember_action': 'hold', 'reply_goes_to_list': 'point_to_list', 'reply_to_address': '', 'max_message_size': 10240, 'anonymous_list': False, 'dmarc_mitigate_action': 'munge_from', 'collapse_alternatives': False, 'dmarc_mitigate_unconditionally': True, }
Most of the settings above cannot currently be changed in mailman.cfg. However, you can create a plugin to do this without patching any sources. The example plugin <https://gitlab.com/mailman/example-mailman-plugin> shows how to create a trivial style (as well as several components you don't need). See documentation in https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/plugins/doc.... For examples of styles, see mailman/styles/default.py. To change the default style, edit (or add) the "default" setting in the "[styles]" section of mailman.cfg.
Regards, Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
Thanks Stephen,
I see your point. I am aware of the limitations of the patched list.py, but it is documented for myself (and uses the bind volume mechanism to persist). I lack the time to develop a plugin for my purposes. I basically want to set defaults my lists and this mechanism is simple and works. I am not sure how such a new plugin should be combined with my stack, perhaps an additional docker package. Seems overkill. Kudos to the mailman community that this software is still maintained.
Best regards,
Wessel
-----Oorspronkelijk bericht----- Van: Stephen J. Turnbull <steve@turnbull.jp> Verzonden: zondag 12 april 2026 19:42 Aan: Wessel Kraaij <wessel.kraaij@outlook.com> CC: mailman-users@mailman3.org Onderwerp: [MM3-users] Re: Changing default language for lists
Wessel Kraaij writes:
I changed several defaults in mailman core (e.g. preferred > language).
Do you mean "default_language"? There is no default "preferred language"; that's a list-specific setting.
And what do you mean by "changed in mailman core"? Settings in mailman.cfg? Source patches?
However, Postorius (maxking version) initializes the defaults for > new lists and overrides the core defaults using a PATCH call on the > REST API.
I don't understand why that would happen. The core defaults are the source of the initial values in the create list form. Specifically, when Postorius creates a list, it initializes a proxy object in mailmanclient, which talks REST API to Mailman core, which creates an actual MailingList object. This uses the defaults from the system_defaults object or default style if one is defined. This is reflected in Postorius's proxy MailingList, which is used to initialize values in the form presented to the administrator. Then they can change various aspects of the list's identity including preferred language from that form.
So if you have set default_language in the [mailman] section of mailman.cfg, you should get the desired initial preferred language for your lists.
As far as I know, this hasn't been reported before. It's not happening to most installations (and many of them do specify default_language). It's true that docker-mailman is not the most common configuration, but it does use stock mailman and postorius from PyPI. So I really don't understand why you have a problem if you are creating mailman.cfg correctly.
With the aid of some gentle AI chatbot,
Heaven preserve us from *all* AI chatbots, gentle or violent. All are sources of bad advice and annoyance to volunteer software maintainers.
You absolutely should not need to patch any code to do what you want to do with preferred_language.
Here is the code snippet [added to list_new in > postorius/views/list.py] that solved my issue
This is a bad idea. You will have to remember to patch Postorius again if you ever update it. Also, if for some reason you ever create lists using the
mailman createutility,mailman shell, or a REST API client, these settings will not be applied to those lists.I added the following 'defaults' in my settings file: DEFAULT_LIST_SETTINGS = { 'preferred_language': 'nl', 'subscription_policy': 'confirm', 'default_member_action': 'defer', 'default_nonmember_action': 'hold', 'reply_goes_to_list': 'point_to_list', 'reply_to_address': '', 'max_message_size': 10240, 'anonymous_list': False, 'dmarc_mitigate_action': 'munge_from', 'collapse_alternatives': False, 'dmarc_mitigate_unconditionally': True, }
Most of the settings above cannot currently be changed in mailman.cfg. However, you can create a plugin to do this without patching any sources. The example plugin <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit lab.com%2Fmailman%2Fexample-mailman- plugin&data=05%7C02%7C%7C4de498f0fbc14109513f08de98bada66%7C8 4df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C639116125477808558 %7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAu MDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C %7C%7C&sdata=qVKt2jUFxn7mHxRWi1%2FstTE18d6rbG4VNJPlPkYPP0I%3D &reserved=0> shows how to create a trivial style (as well as several components you don't need). See documentation in https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoc s.mailman3.org%2Fprojects%2Fmailman%2Fen%2Flatest%2Fsrc%2Fmailman %2Fplugins%2Fdocs%2Fintro.html&data=05%7C02%7C%7C4de498f0fbc141 09513f08de98bada66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0 %7C639116125477828811%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1 hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIl dUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=NUT4CJaIVuKuN08asfLm7Z6bn N7i0PI4TPOYccC5xgY%3D&reserved=0. For examples of styles, see mailman/styles/default.py. To change the default style, edit (or add) the "default" setting in the "[styles]" section of mailman.cfg.
Regards, Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww w.siriusopensource.com%2F&data=05%7C02%7C%7C4de498f0fbc1410951 3f08de98bada66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C6 39116125477844590%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGki OnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjo yfQ%3D%3D%7C0%7C%7C%7C&sdata=WkOqcCK3aQR1pAc79rzJKQN4%2B MR%2B7DbAmnUIx3z%2FDA4%3D&reserved=0 Software systems consulting in Europe, North America, and Japan
participants (2)
-
Stephen J. Turnbull -
Wessel Kraaij