bulger@baeri.org writes:
In the REST API, users/find is supposed to match on email or display_name (at least). When the user is linked to an address, that works. But when I unlink the address, the same query returns no results. If I get all users I can see that the user record still exists. Is there an inner join or some other kind of internal dependency at play here?
It's not "internal", it's explicit in the object database schema. User objects represent human or corporate users, and they "own" Address objects, where "own" means "the person who authenticates as this User can read mail at the mailbox described by this Address". Internally this conceptual relationship is represented in a RDBMS such as PostgreSQL by a one-many relation of Users to Addresses. When you unlink an Address from its User, that record is deleted from its table, and find will no longer work on the corresponding mailbox.
Display names have no such ownership, and so they may be duplicated across unrelated addresses, They won't find the unlinked User but they might find others.
Because the User is the object that is authenticated on the web, Mailman does not delete the User when all of its Addresses are removed. That would inconvenience the human user(s) in some cases (eg, fixing a typo in the only mailbox claimed by a User) and Mailman can't know when that is the case.
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan