Moving lists to different server and domain
Hi,
I want to move all my lists to another server. While I am doing that, I also want to change all lists from listname@domain.tld to listname@lists.domain.tld
How would I best go about this? Will I have issues with the archives of the lists when the domain changes?
Thanks in advance, Julain
On Thu, Oct 29, 2026 at 12:41 PM Julian Kippels <kippels@hhu.de> wrote:
Hi,
I want to move all my lists to another server. While I am doing that, I also want to change all lists from listname@domain.tld to listname@lists.domain.tld
How would I best go about this? Will I have issues with the archives of the lists when the domain changes?
Thanks in advance, Julain
Allow me to first ask: what is the reason for wanting to use lists.domain.tld? Is it to split mail routing away from the main domain’s MX?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
Am 29.10.26 um 12:25 schrieb Washington Odhiambo:
On Thu, Oct 29, 2026 at 12:41 PM Julian Kippels <kippels@hhu.de <mailto:kippels@hhu.de>> wrote:
Hi, I want to move all my lists to another server. While I am doing that, I also want to change all lists from listname@domain.tld to listname@lists.domain.tld How would I best go about this? Will I have issues with the archives of the lists when the domain changes? Thanks in advance, JulainAllow me to first ask: what is the reason for wanting to use lists.domain.tld? Is it to split mail routing away from the main domain’s MX?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart- questions.html <http://www.catb.org/~esr/faqs/smart-questions.html>]
Historically I had users and mailinglists mixed together in the same namespace. This has grown a bit out of control and is really complicating things on the identity management side of things. I would like to have a simple route defined on my mta that sends everything from the new domain over to the new server instead of having to look up everything in LDAP all the time.
Julian
On Thu, Oct 29, 2026 at 2:31 PM Julian Kippels <kippels@hhu.de> wrote:
Am 29.10.26 um 12:25 schrieb Washington Odhiambo:
On Thu, Oct 29, 2026 at 12:41 PM Julian Kippels <kippels@hhu.de <mailto:kippels@hhu.de>> wrote:
Hi, I want to move all my lists to another server. While I am doingthat, I
also want to change all lists from listname@domain.tld to listname@lists.domain.tld How would I best go about this? Will I have issues with the archivesof
the lists when the domain changes? Thanks in advance, JulainAllow me to first ask: what is the reason for wanting to use lists.domain.tld? Is it to split mail routing away from the main domain’s MX?
[snip]
Historically I had users and mailinglists mixed together in the same namespace. This has grown a bit out of control and is really complicating things on the identity management side of things. I would like to have a simple route defined on my mta that sends everything from the new domain over to the new server instead of having to look up everything in LDAP all the time.
Julian
You just threw me off the cliff with that LDAP bit. Anyway, here is the process (ignoring the LDAP bit):
I'd strongly suggest doing this as two separate steps: move the server first with nothing renamed, verify everything works, and only then change the domain. If something breaks, you'll know which step caused it.
- The server move (same domain)
Install the same versions of Mailman Core, Postorius and HyperKitty on the new server, then bring across:
- Both databases: the Core DB and the Django (mailman-web) DB.
- The Core var directory (list templates, held messages, queues, prototype archive).
- mailman.cfg, mailman-hyperkitty.cfg and settings.py. Keep SECRET_KEY, the HyperKitty api_key and the REST credentials unchanged.
- The full-text search index, or rebuild it afterwards with "mailman-web rebuild_index".
- Your web server vhost and MTA transport maps.
Run collectstatic/compress, test, then cut over DNS/MX. Upgrade versions only after the move works.
- The domain change
Mailman 3 has no supported way to rename a list or move it to another domain. Maybe there is, but not off the top of my head right now. The list address lives in Core (mail_host, list_id, plus subscriptions and templates keyed by list_id), in HyperKitty (the list name, which is also in every archive URL), and in the Django mail domain/site records.
You have roughly three options:
1 - Create new lists and re-import (the clean, supported route)
- Create the domain lists.domain.tld.
- Create the new lists and copy their settings (scriptable via REST or "mailman shell").
- Export members with "mailman members -o" and import them with "mailman addmembers" (or mass subscribe in Postorius with invites off).
- Export each archive as mbox and load it with: mailman-web hyperkitty_import -l listname@lists.domain.tld archive.mbox then rebuild the index.
To answer your question directly: your archives will be fine. Old archive URLs will change, but HyperKitty's message and thread hashes are derived from the Message-ID, so they stay the same after re-import. A single redirect in your web server maps old URLs to new ones, e.g. in nginx:
rewrite ^/archives/list/([^@/]+)@domain\.tld/(.*)$
/archives/list/$1@lists.domain.tld/$2 permanent;
Held messages, pending requests and per-member preferences (digest, nomail) won't carry over unless you script them, so clear moderation queues first.
2 - Rename in place via SQL Faster, but unsupported. You would update mail_host/list_id in Core, rename the template directories, then update the HyperKitty list name and the Django mail domain. It's easy to miss a reference, so only try this on a copy of the databases, and compare lists, rosters and archives before and after.
3 - Don't rename If the goal of lists.domain.tld is just to separate list mail routing from your main domain, MTA routing alone may get you there without touching the lists.
If you do change the domain:
- Set up MX, SPF, DKIM and DMARC records for lists.domain.tld, and check the PTR/HELO name on the new server.
- Keep listname@domain.tld forwarding to the new addresses for a few months.
- Warn subscribers that the List-Id is changing, since their mail filters keyed on it will stop matching.
- Check that accept_these_nonmembers and ban lists came across.
Hope that helps.
PS: You can always simulate things before the main shebang.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 2026-10-29 14:53:30 +0300 (+0300), Washington Odhiambo via Mailman-users wrote: [...]
2 - Rename in place via SQL
Faster, but unsupported. You would update mail_host/list_id in Core, rename the template directories, then update the HyperKitty list name and the Django mail domain.
It's easy to miss a reference, so only try this on a copy of the databases, and compare lists, rosters and archives before and after. [...]
Having done this (multiple times) in the past, I can confirm it's not for the faint of heart. I worked out the update queries on a copy of the production database, doing post-hoc database dumps and scanning them for remaining references to the old domain repeatedly until I finally tracked them all down and made sure they were covered by what I planned to run in production.
Don't forget to also rename/move files on disk related to the list you're rehoming, and of course you want to do all these things with services offline (presumably deferring inbound deliveries for the duration of the maintenance).
And it should go without saying, make sure you have good backups of everything!
-- Jeremy Stanley
Julian Kippels writes:
Historically I had users and mailinglists mixed together in the same namespace. This has grown a bit out of control and is really complicating things on the identity management side of things. I would like to have a simple route defined on my mta that sends everything from the new domain over to the new server instead of having to look up everything in LDAP all the time.
I'm not sure I understand this. I heartily approve of moving your Mailman instance to a separate host because Mailman, Django, and Python all present large attack surfaces. Isolating the system on a separate host makes a lot of sense.
But I'm not sure it's worth renaming the domain to lists.domain.tld if you already have list@domain.tld addresses that your users are used to. Especially if you use a convention like topic-list@domain.tld so users know whether something is a list or not.
These namespaces (lists and other addresses) should be disjoint, right? Then the question is how to handle conflicts. At routing time, I would just give mailing lists priority, and check for a mailing list first in the MX. It wouldn't be hard to hack an LDAP check for an existing non-Mailman address into the MailingList.create function, and a little more effort to handle that in the command line and Postorius list creation UIs. I can't speak to how to automate the creation of a non-Mailman email address, but similar SQL query should be scriptable for many common cases.
Unless you have a truly enormous number of lists (surely > 20,000, that's painful for other reasons, but not because it's costly to route), the Postfix table lookup is quite fast. This appears as just one rule in main.cf, and Mailman does the maintenance for you as lists are created and deleted.
And Mailman basically doesn't care what the name of the host it runs on is. It only cares that the SMTP RCPT TO match its own database list name and mail host at LMTP acceptance time. So you can move the processing to lists.domain.tld and Mailman won't notice.
If you still want to do the list renaming, we'll do what we can to help, but there's some risk, especially on the "annoying the subscribers" side. OTOH, I'm not sure that you save very much processing by simplifying the MX config to a domain check vs. a full address check, as long as you give Mailman addresses priority.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
Julian Kippels writes:
I want to move all my lists to another server.
This is conceptually straightforward as long as you keep the same posting addresses. Just move all the "files" (you probably want to do a dump and restore of the RDMBS rather than rsyncing the DB files). You should move *all* of the files in /etc/mailman3, not just the three Odhiambo listed. You probably have WGSI configuration files (eg, gunicorn.conf, uwsgi.ini), and may have include files for mailman.cfg and settings.py, as well as various localizations such as template files. You need to clean up all of the files related to mailman.cfg and settings.py for the domains.
That may not work as well as you would like if you are using distro packages rather than a virtualenv install from source, because unless you're a distro wizard you likely won't get the same versions of everything. But it's a pretty good bet.
While I am doing that, I also want to change all lists from listname@domain.tld to listname@lists.domain.tld
This is not easy in general. In principle, you "should" be able to just change the mail host entry in the database. You probably should *not* change the list ID entry. However, it is quite frequent to configure lists as subscribers to other lists. (I think I've seen them as other kinds of member, such as owner, as well.) This is done using the list's address as a string, not as a MailingList object, so you would need to change those by hand (unless you maintain aliases on domain.tld, but I think that's what you want to avoid).
In Mailman 2, there were a number of other possibilities, such as "sibling lists" (alternative lists to check for membership when a list is "members-only"). I don't recall which of these, if any, are implemented in Mailman 3, and I definitely don't recall if they are implemented via MailingList object, list ID, or by posting address.
Finally there are a couple of obscure options that use regexps to filter addresses. I don't think lists are among the use cases, but I can't promise.
How would I best go about this?
That depends on your users. See below for an example.
Will I have issues with the archives of the lists when the domain changes?
Is the archive server going to move as well? That's likely to annoy users who have bookmarks. (This is one reason why a lot of people like to have lists.domain.tld and archive.domain.tld.)
If you're not using HyperKitty, all bets are off -- you need to discuss with the maintainers of the archive software you use. For HyperKitty, I don't recall how it identifies lists. If it uses list ID, and you don't change it, you may be home free.
Otherwise, it's likely users will perceive a discontinuity post-move vs pre-move, such as broken threads. I'm not sure how HyperKitty handles threads that are continued on a different list.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
participants (4)
-
Jeremy Stanley -
Julian Kippels -
Stephen J. Turnbull -
Washington Odhiambo