how should I implement multiple domains for receiving emails to a list

Hello to all:
I think I have resolved almost all of my issues. Thank you for your coaching. You are all super heroes.
I have two domains: systemdatabase.ca, systemdatabase.homelinux.com
All my lists should be on both domains. So h@systemdatabase.ca is the same list as h@systemdatabase.homelinux.com. I found this was the mailman2 behaviour on my old CentOS 7 installation and I am accustomed to it.
I edited /opt/mailman/venv_mm/var/data/postfix_lmtp directly. Duplicated and edited all the lines. And compiled with postmap /opt/mailman/venv_mm/var/data/postfix_lmtp
I sent a test email. This appears to work.
Is this the best method to achieve this goal? What would you recommend?

On 4/15/25 16:51, Philip Bondi wrote:
I have two domains: systemdatabase.ca, systemdatabase.homelinux.com
All my lists should be on both domains. So h@systemdatabase.ca is the same list as h@systemdatabase.homelinux.com. I found this was the mailman2 behaviour on my old CentOS 7 installation and I am accustomed to it.
While Mailman 2.1 had some support for multiple domains, list names had to be globally unique because a given list name referred to that one list regardless of domain. Mailman 3 is different in that the domain is part of the list name so h@systemdatabase.ca and h@systemdatabase.homelinux.com are different lists.
I edited /opt/mailman/venv_mm/var/data/postfix_lmtp directly. Duplicated and edited all the lines. And compiled with postmap /opt/mailman/venv_mm/var/data/postfix_lmtp
I sent a test email. This appears to work.
Is this the best method to achieve this goal? What would you recommend?
If all you want is for mail to h@systemdatabase.ca or h@systemdatabase.homelinux.com to wind up at the same list, what you've done is OK, but whatever fqdn name your list is created as, it needs the other fqdn name added to it's Acceptable aliases setting, at least if Require Explicit Destination is Yes. The other issue is every time you start Mailman core it will implicitly run `mailman aliases` and overwrite your changes. I have a similar situation on one of the servers I support. The lists are all in a domain I'll call example.com, but we also want to allow mail to <list>@otherexample.com to reach the <list>@example.com list. We use this patch to add all those names. ``` --- a/src/mailman/mta/postfix.py +++ b/src/mailman/mta/postfix.py @@ -261,5 +261,10 @@ class LMTP: '{}@{}'.format(alias, mlist.true_mail_host)) line = VMAPTMPL.format(true_addr, width, addr) print(line, file=fp) + if mlist.true_mail_host == 'example.com': + true_addr = self._decorate( + '{}@{}'.format(alias, 'otherexample.com')) + line = VMAPTMPL.format(true_addr, width, addr) + print(line, file=fp) print(file=fp) return True ``` However, this only works because example.com has an alias domain. If that weren't the case, we would need something like this instead. ``` --- a/src/mailman/mta/aliases.py +++ b/src/mailman/mta/aliases.py @@ -43,9 +43,14 @@ class MailTransportAgentAliases: """See `IMailTransportAgentAliases`.""" # Always return yield mlist.posting_address + if mlist.mail_host == 'example.com': + yield '{}@otherexample.com'.format(mlist.list_name) for destination in sorted(SUBDESTINATIONS): yield '{}-{}@{}'.format( mlist.list_name, destination, mlist.mail_host) + if mlist.mail_host == 'example.com': + yield '{}-{}@{}'.format( + mlist.list_name, destination, 'otherexample.com') def destinations(self, mlist): """See `IMailTransportAgentAliases`.""" ``` Do not use both those patches. If your list domain has an alias domain, use only the first one and if not, only the second. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 4/15/25 18:30, Mark Sapiro wrote:
The other issue is every time you start Mailman core it will implicitly run
mailman aliases
and overwrite your changes.
Rather than patching as I suggested in the prior reply, a simpler solution is just to copy /opt/mailman/venv_mm/var/data/postfix_lmtp somewhere else and compile that with postmap and reference the copy in Postfix. Then you will only need to update it if you add or delete lists.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Mark Sapiro
-
Philip Bondi