FAQ
Hello,

I've been wanting 2 different mailing lists with the same
name, each on a different domain. This configuration
is not supported in the stock mailman (pre 3.0), but it occurs to
me that there is a workaround when the MTA is postfix.

It's a bit of a kludge, but I think it will work.
I'm interested in what the list thinks.

Note: I have not tested this. I've done a little
bit of testing on the outbound mail part, and it
seems to work. It happens
that the mail architecture in use is forwarding list traffic
to the mailman server, so the inbound translations are
handled by the forwarder and I don't need the
inbound mail part. I'm running Debian Etch.

First off, FWIW, in debian mailman comes integrated
out of the box with postfix so mailman automatically
maintains all it's aliases. This is done via a transport map
and postfix-to-mailman.py; any mail sent to the
box's "regular domain" is run through mailman.

The idea is to use postifx's canonical mapping
to re-write the email addresses on all inbound
list traffic to "secondary" domains to add
a "tag" to the user part of the address. And then
do the reverse to outbound list traffic. This
is best illustrated by way of example.

Suppose you want 2 lists, foo at example.com and
foo at example.net. The "regular" domain for the
box is example.com. Make two lists:
foo and foo-examplenet.

In /etc/postfix/main.cf put the lines:

recipient_canonical_maps = pcre:/etc/postfix/recipient_canonical_domains
sender_canonical_maps = pcre:/etc/postfix/sender_canonical_domains

In /etc/postfix/recipient_canonical_domains put:

/^foo(-.+)?@example.net$/ foo-examplenet${1}@example.com

In /etc/postfix/sender_canonical_domains put:

/^(.*)-examplenet(-(.*))@example.com$/ ${1]${2}@example.net

Mail that comes in as foo at example.net (or e.g.
foo-subscribe at example.net) is readdressed to foo-examplenet at example.com
(or foo-examplenet-subscribe at example.com). It's then delivered to
mailman's foo-examplenet list just like normal. Outbound mail sent
from the list comes from foo-examplenet at example.com but
all the addresses are rewritten so as to come from
foo at example.net.

I don't know whether rfc2369 headers are rewritten by
postfix's canonical mapping, I suppose it depends
on whether postfix is rfc2369 aware. Anyway, that's
simple enough to take care of with header_checks, pcre patterns
like those above, and the REPLACE action. I think this
would work on both inbound and outbound..., right?

The limitations are you can't have any email addresses
in @example.com that have '-examplenet' in the user
part, and you can't have any foo-.* user names in
@example.net (besides the mailing list.)

This seems a lot more straightforward to setup and
maintain than running multiple instances of mailman,
which is the only other solution I know of. All
that's needed for maintenance is to add a line
for any new lists to recipient_canonical_domains
and sender_canonical_domains and otherwise everything
works "as it should". If the "secondary" domains
have no users, only mailing lists, you can construct
a pcre that rewrites all inbound/outbound mail to/from
the domains and there's no work involved when adding
a mailing list.

Regards,

Karl <kop at meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

Search Discussions

  • Karl O. Pinc at Feb 10, 2009 at 2:01 pm

    On 02/09/2009 04:35:12 PM, Karl O. Pinc wrote:
    Hello,

    I've been wanting 2 different mailing lists with the same
    name, each on a different domain.
    The idea is to use postifx's canonical mapping
    to re-write the email addresses on all inbound
    list traffic to "secondary" domains to add
    a "tag" to the user part of the address. And then
    do the reverse to outbound list traffic.
    Where this fits into the postfix data flow can be
    seen in the diagrams at the Postfix Architecture Overview,
    http://www.postfix.org/OVERVIEW.html. It is the
    cleanup(8) daemon that rewrites addresses according to the
    canonical mappings.

    Karl <kop at meme.com>
    Free Software: "You don't pay back, you pay forward."
    -- Robert A. Heinlein

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedFeb 9, '09 at 10:35p
activeFeb 10, '09 at 2:01p
posts2
users1
websitelist.org

1 user in discussion

Karl O. Pinc: 2 posts

People

Translate

site design / logo © 2022 Grokbase