4

I am playing around with mailman3 and I've happened upon this problem: mailman3, the web interface as well as hyperkitty have been installed using mailman-bundler. I have added the prescribed postfix configuration to main.cf:

recipient_delimiter = +
unknown_local_recipient_reject_code = 550
owner_request_special = no
transport_maps = hash:/path/to/var/data/postfix_lmtp
local_recipient_maps = hash:/path/to/var/data/postfix_lmtp
relay_domains = hash:/path/to/var/data/postfix_domains

The listed files are world-readable so there should not be a permission problem. I can successfully create a domain/list via the web interface, but when I try to send mail to the list address the mail is rejected with the following message:

Recipient address rejected: User unknown in virtual mailbox table

This postfix installation normally uses a virtual_transport to deliver mail to dovecot. The corresponding configuration looks like this:

virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
local_recipient_maps = $virtual_mailbox_maps

This is based on the excellent NSA-proof your e-mail in 2 hours guide.

Now, this StackOverflow question claims that virtual_transport and transport_maps do not play nicely together, although I can't find anything in the postfix documentation that verifies this claim. The author has resolved their issue by just using transport_maps which does not seem to be an option for me.

Note that I also get a warning that the local_recipient_maps option from mailman3 overrides the earlier definition as part of the dovecot delivery. This can be solved by specifying both values on one line as such:

local_recipient_maps = $virtual_mailbox_maps hash:/path/to/var/data/postfix_lmtp

But that does not solve the problem. Does anyone have any ideas or experience in making this work? I realize that mailman3 is still considered new. That's why I'm playing with it.

Stephan Klein
  • 233
  • 1
  • 10

1 Answers1

4

I have figured this one out. Turns out the claims in the linked StackOverflow question were false. It is indeed possible to use virtual_transport and transport_maps together. My problem was the SQL query used to determine virtual_mailbox_maps would naturally only return 1 when the mailbox was defined in the database. As soon as that check failed, the message was rejected.

-- from: mysql-virtual-mailbox-maps.cf
query = SELECT 1 FROM virtual_users WHERE name = 'name = '%s'

Adding the mailman3 mapping to the virtual_mailbox_maps setting solved the issue for me. This is my working configuration:

virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf hash:/path/to/var/data/postfix_lmtp
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
local_recipient_maps = hash:/path/to/var/data/postfix_lmtp mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
transport_maps = hash:/path/to/var/data/postfix_lmtp

It sets up virtual_transport to default to dovecot but allows it to be overriden by transport_maps which maps the list addresses to the mailman local transport.

Stephan Klein
  • 233
  • 1
  • 10