mailman changeaddress: Address already exists; can't change
Hi,
We migrated ~100 lists from mailman2 to mailman3 (very nice!) including > 6000 distinct email addresses ("subscribers").
I would like to run the mailman changeaddress command to do a global change of email for a member that moved. But they have other subscriptions using their new email, so both the old and new address are migrated to mailman3 as distinct "members", which prevents the mailman changeaddress from making the change with error:
$ mailman changeaddress "EMAIL_1" "EMAIL_2" Usage: mailman changeaddress [OPTIONS] OLD_ADDRESS NEW_ADDRESS Try 'mailman changeaddress -h' for help.
Error: Address "EMAIL_2" already exists; can't change.
Is there a workaround?
Thanks, Joel
On 10/10/24 8:58 AM, joelbrownstein@computer.org wrote:
Hi,
We migrated ~100 lists from mailman2 to mailman3 (very nice!) including > 6000 distinct email addresses ("subscribers").
I would like to run the mailman changeaddress command to do a global change of email for a member that moved. But they have other subscriptions using their new email, so both the old and new address are migrated to mailman3 as distinct "members", which prevents the mailman changeaddress from making the change with error:
$ mailman changeaddress "EMAIL_1" "EMAIL_2" Usage: mailman changeaddress [OPTIONS] OLD_ADDRESS NEW_ADDRESS Try 'mailman changeaddress -h' for help.
Error: Address "EMAIL_2" already exists; can't change.
There is a major difference between MM 2.1 and MM 3 in this respect. In MM 2.1, a list member is an email address that bears no relation to any other member of this or any other list. In MM 3, there is a user which corresponds to a person which has one or more email addresses which can be members of lists with various roles.
What happened here is importing the MM 2.1 lists created a user for EMAIL_1 and subscribed it to some lists an created a separate user for EMAIL_2 subscribed the other lists. You can't change EMAIL_1 to EMAIL_2 because EMAIL_2 is already a separate user.
There are two ways to deal with this.
You can use mailman findmember EMAIL_1
to list all of EMAIL_1's
memberships and edit that to make a shell script that will do echo EMAIL_2|mailman addmembers -f - LISTNAME> to add EMAIL_2 to all of EMAIL_1's lists and then do
mailman delmambers -m EMAIL_1 --fromall`
You could do direct database manipulation. First get the id and user_id of the address table entries for email = EMAIL_1 and EMAIL_2. If we call them aid_1, uid_1, aid_2 and uid_2, do
UPDATE member SET address_id = aid_2, user_id = uid_2 WHERE address_id =
aid_1;
Caveat: I haven't done this. I think it should work, but no guarantees. Backup the database first in case of problems.
After doing either of the above, there will still be a user with address = EMAIL_1, but that user should have no subscriptions. You can delete that user via Postorius and if desired the remaining user with address EMAIL_2 could add EMAIL_1 as another address.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
joelbrownstein@computer.org
-
Mark Sapiro