Mailman3 is wrongly display name a list member
All,
I got an issue with one subscriber (multiple lists).
When I subscribe 'A' <a@foo.com>, Mailman3 changes it to 'B' <a@foo.com>.
I went into Django and added the name 'B' to the subscriber's account (the name was empty).
I then unsubscribed <a@foo.com> from the lists and resubscribed 'A' <a@foo.com>.
The subscription again lists as 'B' <a@foo.com>.
This brings up a previous discussion of display names on this list, but I have not been able to find any solution to the need to change Mailman3's display names for a subscriber. It is beyond weird that unsubscribing, setting the account display name and resubscribing the member fishes back up the old and wrong display name.
What can I do to help this member?
Yours,
Allan
Allan Hansen writes:
When I subscribe 'A' <a@foo.com>, Mailman3 changes it to 'B' <a@foo.com>.
If I recall correctly, this issue occurs because Subscription objects have no display name attribute, but User and Address objects do.
First, the advice part:
What can I do to help this member?
Unfortunately the mailman command line utility doesn't seem to allow changing the display name. The REST interface does, though. I think just starting Python 3 on the Mailman host as the Mailman user (we recommend "mailman" but Debian prefers "list", YMMV) and typing
from mailman.testing.documentation import dump_json dump_json('http://localhost:8001/3.1/addresses/a@foo.com', ... method='PATCH', data={'display_name': 'A'})
should do what you want. Note the numbers "8001" (Mailman core's REST port) and "3.1" (the API version) may be different on your system, I'm assuming the default install of a recent Mailman release.
See https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/r... for information about accessing the REST API and https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/a... for a few more details on the update process.
On to the rants, if you care.
I went into Django and added the name 'B' to the subscriber's account (the name was empty).
I then unsubscribed <a@foo.com> from the lists and resubscribed 'A' <a@foo.com>.
The subscription again lists as 'B' <a@foo.com>.
Does the user need to have different display names for different addresses? (I don't think it's possible to have different display names for the same address on different lists because there's no display name at all for Subscription objects.)
If the answer is "no", the correct thing to do is to set the desired display name on the user's account.
If the answer is "yes", there doesn't seem to be any way to do this with current Postorius/HyperKitty. Postorius doesn't expose the display name anywhere that I can see, and HyperKitty only manages the account's "real name".
This brings up a previous discussion of display names on this list, but I have not been able to find any solution to the need to change Mailman3's display names for a subscriber. It is beyond weird that unsubscribing, setting the account display name and resubscribing the member fishes back up the old and wrong display name.
Unless you explained what you did incorrectly this is not weird, it's the expected result. You set "B" in the account, that's what's going to show up as the display name.
It is not obvious that a new subscription should change an existing display name for a user or an address, given that there is no way to set a list-specific display name. It could go either way, and for the user I would definitely not change it, for the address I tend to agree that a new subscription should not change the address's display name. I agree that it's weird that neither Postorius nor HyperKitty seems to expose a way to set Address display names, though.
If you want a new subscription to set the display name for an address, the workaround would be to delete the address, then reconfirm the address, and resubscribe the address to all the relevant lists.
Thank youi, Stephen.
Oops. When I wrote below that I set the name 'B' in the account, I did describe it wrongly. Sorry. The member just wants one name, 'A' for all her subsriptions. Somehow the 'B' got into the system when we upgraded from Mailman 2 to Mailman 3.
I removed the address from all the lists, set the account display name to 'A' in Django, verified that she was not subscribed to any list at all, and then resubscribed her again as 'A'. In other words, no 'B' anywhere - straight 'A's. Nevertheless, the new subscriptions still show up as 'B'.
Now, for the workaround:
" If you want a new subscription to set the display name for an address, the workaround would be to delete the address, then reconfirm the address, and resubscribe the address to all the relevant lists."
I modified the above workflow to:
Removed the address from all the lists. Set the account display name to 'A' in Django. Verify that she is not subscribed to any list at all. Deleted the email address in Django (under 'Email addresses'). Resubscribed her as 'A'. In other words, no 'B' anywhere - straight 'A's. Nevertheless, the new subscriptions still has 'B' when I list it in Postorius.
Further: When I search for 'Email addresses' in Django's list of emails (by account or email), it no longer exists. When I search under 'Users' (by account or email), it exists with 'A' as the display (which she entered when she created the account).
Then since the email does not exist, under 'Email addresses' in Django, I go to 'Add email address', enter her account name and address. This gives and error: 'Select a valid choice. That choice is not one of the available choices.' I get this error no matter which 'Save...' button I press.
I then tried to get into REST as per your advice here:
" I think just starting Python 3 on the Mailman host as the Mailman user (we recommend "mailman" but Debian prefers "list", YMMV) and typing
from mailman.testing.documentation import dump_json dump_json('http://localhost:8001/3.1/addresses/a@foo.com', ... method='PATCH', data={'display_name': 'A'}) "
I get this, after setting myself up as user mailman (which works when entering mailman commands):
mailman@list:~/scripts$ python3 Python 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
from mailman.testing.documentation import dump_json Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'mailman'
Looking around, I found mailman related stuff in /opt/mailman/mm and a file called 'mailman' in opt/mailman/mm/bin but hesitated editing your command above to: /opt/mailman/mm/mailman.testing.documentation (I don't want to mess up my system).
So no go...
Sorry for ranting. __
Please:
- Always use the display name and email set up in the account everywhere.
- Allow the member to change her display name using the account UI.
- Allow the member to change her address and apply the new address to all list subscriptions.
Yours,
Allan
On 1/11/22, 7:20 , "Stephen J. Turnbull" <stephenjturnbull@gmail.com> wrote:
Allan Hansen writes:
> When I subscribe 'A' <a@foo.com>, Mailman3 changes it to 'B'
> <a@foo.com>.
If I recall correctly, this issue occurs because Subscription objects
have no display name attribute, but User and Address objects do.
First, the advice part:
> What can I do to help this member?
Unfortunately the mailman command line utility doesn't seem to allow
changing the display name. The REST interface does, though. I think
just starting Python 3 on the Mailman host as the Mailman user (we
recommend "mailman" but Debian prefers "list", YMMV) and typing
>>> from mailman.testing.documentation import dump_json
>>> dump_json('http://localhost:8001/3.1/addresses/a@foo.com',
... method='PATCH', data={'display_name': 'A'})
should do what you want. Note the numbers "8001" (Mailman core's REST
port) and "3.1" (the API version) may be different on your system, I'm
assuming the default install of a recent Mailman release.
See
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/rest.html#mailman-3-core-rest-api
for information about accessing the REST API and
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/addresses.html#updating
for a few more details on the update process.
On to the rants, if you care.
> I went into Django and added the name 'B' to the subscriber's
> account (the name was empty).
>
> I then unsubscribed <a@foo.com> from the lists and resubscribed 'A'
> <a@foo.com>.
>
> The subscription again lists as 'B' <a@foo.com>.
Does the user need to have different display names for different
addresses? (I don't think it's possible to have different display
names for the same address on different lists because there's no
display name at all for Subscription objects.)
If the answer is "no", the correct thing to do is to set the desired
display name on the user's account.
If the answer is "yes", there doesn't seem to be any way to do this
with current Postorius/HyperKitty. Postorius doesn't expose the
display name anywhere that I can see, and HyperKitty only manages the
account's "real name".
> This brings up a previous discussion of display names on this list,
> but I have not been able to find any solution to the need to change
> Mailman3's display names for a subscriber. It is beyond weird that
> unsubscribing, setting the account display name and resubscribing
> the member fishes back up the old and wrong display name.
Unless you explained what you did incorrectly this is not weird, it's
the expected result. You set "B" in the account, that's what's going
to show up as the display name.
It is not obvious that a new subscription should change an existing
display name for a user or an address, given that there is no way to
set a list-specific display name. It could go either way, and for the
user I would definitely not change it, for the address I tend to agree
that a new subscription should not change the address's display name.
I agree that it's weird that neither Postorius nor HyperKitty seems to
expose a way to set Address display names, though.
If you want a new subscription to set the display name for an address,
the workaround would be to delete the address, then reconfirm the
address, and resubscribe the address to all the relevant lists.
On 1/11/22 9:24 AM, Allan Hansen wrote:
Thank youi, Stephen.
Oops. When I wrote below that I set the name 'B' in the account, I did describe it wrongly. Sorry. The member just wants one name, 'A' for all her subsriptions. Somehow the 'B' got into the system when we upgraded from Mailman 2 to Mailman 3.
I removed the address from all the lists, set the account display name to 'A' in Django, verified that she was not subscribed to any list at all, and then resubscribed her again as 'A'. In other words, no 'B' anywhere - straight 'A's. Nevertheless, the new subscriptions still show up as 'B'.
A user has a user record and one or more address records. Each of these has a display name. Removing users from lists does not remove these records.
If you have recent Postorius, you should have a users
item at the top
of Postorius pages. Go there, find the user and click "Manage". You can
change Display Name there.
Otherwise, in mailman shell
for example
>>> usr = getUtility(IUserManager).get_user('user@example.com')
>>> usr.display_name = 'First Last'
>>> for adr in usr.addresses:
... adr.display_name = 'First Last'
...
>>> commit()
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thank you, Mark. I have Postorius Version 1.3.4 I see no 'Users' in Postorius, but I do see it in Django.
I'll assume that my Postorius is out of date and will take steps to update it.
Yours,
Allan
On 1/11/22, 10:38 , "Mark Sapiro" <mark@msapiro.net> wrote:
On 1/11/22 9:24 AM, Allan Hansen wrote:
> Thank youi, Stephen.
>
> Oops. When I wrote below that I set the name 'B' in the account, I did describe it wrongly. Sorry.
> The member just wants one name, 'A' for all her subsriptions. Somehow the 'B' got into the system when we upgraded from Mailman 2 to Mailman 3.
>
> I removed the address from all the lists, set the account display name to 'A' in Django, verified that she was not subscribed to any list at all, and then resubscribed her again as 'A'. In other words, no 'B' anywhere - straight 'A's.
> Nevertheless, the new subscriptions still show up as 'B'.
A user has a user record and one or more address records. Each of these
has a display name. Removing users from lists does not remove these records.
If you have recent Postorius, you should have a `users` item at the top
of Postorius pages. Go there, find the user and click "Manage". You can
change Display Name there.
Otherwise, in `mailman shell` for example
```
>>> usr = getUtility(IUserManager).get_user('user@example.com')
>>> usr.display_name = 'First Last'
>>> for adr in usr.addresses:
... adr.display_name = 'First Last'
...
>>> commit()
```
--
Mark Sapiro <mark@msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
_______________________________________________
Mailman-users mailing list -- mailman-users@mailman3.org
To unsubscribe send an email to mailman-users-leave@mailman3.org
https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
On 1/11/22 12:14 PM, Allan Hansen wrote:
Thank you, Mark. I have Postorius Version 1.3.4 I see no 'Users' in Postorius, but I do see it in Django.
Django will only affect the login to the web UI. Users
in Postorius
requires >= 1.3.6.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Allan Hansen
-
Mark Sapiro
-
Stephen J. Turnbull