No option 'postmap_command' in section: 'postfix'
The documentation <https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.html> says that I need to create /path/to/postfix-mailman.cfg containing: [postfix] transport_file_type: regex
Then append the path to the [mta] section of mailman.cfg, viz:
[mta]incoming: mailman.mta.postfix.LMTPoutgoing: mailman.mta.deliver.deliverlmtp_host: mail.example.comlmtp_port: 8024smtp_host: mail.example.comsmtp_port: 25configuration: /path/to/postfix-mailman.cfg
That is exactly what I have done on my test platform, but I get the error below when creating a list. Perhaps I overlooked something?
(venv) lists% mailman create mylist@lists.wash.lan Traceback (most recent call last): File "/usr/local/lib/python3.9/configparser.py", line 789, in get value = d[option] File "/usr/local/lib/python3.9/collections/__init__.py", line 941, in __getitem__ return self.__missing__(key) # support subclasses that define __missing__ File "/usr/local/lib/python3.9/collections/__init__.py", line 933, in __missing__ raise KeyError(key) KeyError: 'postmap_command'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/venv/bin/mailman", line 33, in <module> sys.exit(load_entry_point('mailman==3.3.8', 'console_scripts', 'mailman')()) File "/opt/mailman/venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/opt/mailman/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/opt/mailman/venv/lib/python3.9/site-packages/mailman/bin/mailman.py", line 69, in invoke return super().invoke(ctx) File "/opt/mailman/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/mailman/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/opt/mailman/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/opt/mailman/venv/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "/opt/mailman/venv/lib/python3.9/site-packages/mailman/commands/cli_lists.py", line 188, in create mlist = create_list(fqdn_listname, owners) File "/opt/mailman/venv/lib/python3.9/site-packages/mailman/app/lifecycle.py", line 102, in create_list call_name(config.mta.incoming).create(mlist) File "/opt/mailman/venv/lib/python3.9/site-packages/mailman/utilities/modules.py", line 70, in call_name return named_callable(*args, **kws) File "/opt/mailman/venv/lib/python3.9/site-packages/mailman/mta/postfix.py", line 87, in __init__ self.postmap_command = mta_config.get('postfix', 'postmap_command') File "/usr/local/lib/python3.9/configparser.py", line 792, in get raise NoOptionError(option, section) configparser.NoOptionError: No option 'postmap_command' in section: 'postfix'
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 1/30/23 02:44, Odhiambo Washington wrote:
The documentation <https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.html> says that I need to create /path/to/postfix-mailman.cfg containing: [postfix] transport_file_type: regex
Then append the path to the [mta] section of mailman.cfg, viz:
[mta] ... configuration: /path/to/postfix-mailman.cfg
That is exactly what I have done on my test platform, but I get the error below when creating a list. Perhaps I overlooked something? ... "/opt/mailman/venv/lib/python3.9/site-packages/mailman/mta/postfix.py", line 87, in __init__ self.postmap_command = mta_config.get('postfix', 'postmap_command') File "/usr/local/lib/python3.9/configparser.py", line 792, in get raise NoOptionError(option, section) configparser.NoOptionError: No option 'postmap_command' in section: 'postfix'
This is a bug. Whether it is a bug in documention or code is not completely clear. Current code requires there be a `postmap_command:` setting in the [postfix] configuration even though it isn't used if `transport_file_type:` is set to regex. You can fix this in one of two ways. Either apply this patch ``` --- a/src/mailman/mta/postfix.py +++ b/src/mailman/mta/postfix.py @@ -84,9 +84,10 @@ class LMTP: def __init__(self): # Locate and read the Postfix specific configuration file. mta_config = external_configuration(config.mta.configuration) - self.postmap_command = mta_config.get('postfix', 'postmap_command') self.transport_file_type = mta_config.get( 'postfix', 'transport_file_type') + if self.transport_file_type == 'hash': + self.postmap_command = mta_config.get('postfix', 'postmap_command') def create(self, mlist): """See `IMailTransportAgentLifecycle`.""" ``` (watch for possible wrapped lines in above) or add postmap_command: unused to /path/to/postfix-mailman.cfg. Note however that hash tables for Postfix are more efficient than regex tables and the only reason we support regex tables is for a Docker container that doesn't have Postfix installed in the Mailman container. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Mon, Jan 30, 2023 at 8:35 PM Mark Sapiro <mark@msapiro.net> wrote:
On 1/30/23 02:44, Odhiambo Washington wrote:
The documentation < https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.ht...
says that I need to create /path/to/postfix-mailman.cfg containing: [postfix] transport_file_type: regex
Then append the path to the [mta] section of mailman.cfg, viz:
[mta] ... configuration: /path/to/postfix-mailman.cfg
That is exactly what I have done on my test platform, but I get the error below when creating a list. Perhaps I overlooked something? ... "/opt/mailman/venv/lib/python3.9/site-packages/mailman/mta/postfix.py", line 87, in __init__ self.postmap_command = mta_config.get('postfix', 'postmap_command') File "/usr/local/lib/python3.9/configparser.py", line 792, in get raise NoOptionError(option, section) configparser.NoOptionError: No option 'postmap_command' in section: 'postfix'
This is a bug. Whether it is a bug in documention or code is not completely clear. Current code requires there be a `postmap_command:` setting in the [postfix] configuration even though it isn't used if `transport_file_type:` is set to regex.
You can fix this in one of two ways. Either apply this patch ``` --- a/src/mailman/mta/postfix.py +++ b/src/mailman/mta/postfix.py @@ -84,9 +84,10 @@ class LMTP: def __init__(self): # Locate and read the Postfix specific configuration file. mta_config = external_configuration(config.mta.configuration) - self.postmap_command = mta_config.get('postfix', 'postmap_command') self.transport_file_type = mta_config.get( 'postfix', 'transport_file_type') + if self.transport_file_type == 'hash': + self.postmap_command = mta_config.get('postfix', 'postmap_command')
def create(self, mlist): """See `IMailTransportAgentLifecycle`.""" ``` (watch for possible wrapped lines in above) or add
postmap_command: unused
to /path/to/postfix-mailman.cfg.
Note however that hash tables for Postfix are more efficient than regex tables and the only reason we support regex tables is for a Docker container that doesn't have Postfix installed in the Mailman container.
So, if I understand this correctly, there is no need for the addition of this parameter: ``` configuration: /path/to/postfix-mailman.cfg ``` to the mta config block in mailman.cfg in a non-docker environment, or when only using hash tables?? -- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 1/30/23 09:46, Odhiambo Washington wrote:
So, if I understand this correctly, there is no need for the addition of this parameter:
configuration: /path/to/postfix-mailman.cfg
to the mta config block in mailman.cfg in a non-docker environment, or when only using hash tables??
Correct.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Mon, Jan 30, 2023 at 9:01 PM Mark Sapiro <mark@msapiro.net> wrote:
On 1/30/23 09:46, Odhiambo Washington wrote:
So, if I understand this correctly, there is no need for the addition of this parameter:
configuration: /path/to/postfix-mailman.cfg
to the mta config block in mailman.cfg in a non-docker environment, or
when
only using hash tables??
Correct.
Great.
So, since the creation of that file is prominent in the doco, maybe a note can be added to that effect?
Thank you.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 1/30/23 10:12, Odhiambo Washington wrote:
So, since the creation of that file is prominent in the doco, maybe a note can be added to that effect?
I'm looking at https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.ht... and my thought is at the paragraph
Regular Expression tables remove the additional dependency of having postmap command available to Mailman. If you want to use regexp or Regular Expression tables, then add the following to Postfix’s main.cf file:
add another section header
Regular Expression Tables
and change that text to
Regular Expression tables are less efficient than hash tables, but they
remove the additional dependency of having postmap
command available
to Mailman. If you want to use regexp
or Regular Expression tables,
then add the following to Postfix's main.cf
file
My thought is adding the section header makes it more clear that
everything down to the Postfix + Dovecot section is for Regular
Expression Tables and adding the less efficient
phrasing notes the
down side.
What do you think?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 1/30/23 11:43, Mark Sapiro wrote:
add another section header
Regular Expression Tables
and change that text to
Regular Expression tables are less efficient than hash tables, but they remove the additional dependency of having
postmap
command available to Mailman. If you want to useregexp
or Regular Expression tables, then add the following to Postfix'smain.cf
file
This is now done. https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.ht...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Tue, Jan 31, 2023 at 9:13 PM Mark Sapiro <mark@msapiro.net> wrote:
On 1/30/23 11:43, Mark Sapiro wrote:
add another section header
Regular Expression Tables
and change that text to
Regular Expression tables are less efficient than hash tables, but they remove the additional dependency of having
postmap
command available to Mailman. If you want to useregexp
or Regular Expression tables, then add the following to Postfix'smain.cf
fileThis is now done.
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.ht...
That is now quite clear, but I still have one question and this is cosmetic (because Postfix isn't my MTA of choice. You can ignore it if it feels like spoon-feeding a Postfix admin.
In the section:
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.html#postfix-dovecot
.. the Postfix admin had to figure out whether they are using hash or regex tables and modify accordingly, right?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
participants (2)
-
Mark Sapiro
-
Odhiambo Washington