On 12/10/20 2:04 PM, Andreas Barth wrote:
- Mark Sapiro (mark@msapiro.net) [201210 22:51]:
On 12/10/20 11:51 AM, Andreas Barth wrote:
Hi,
I noticed that a mail to -subscribe for an already subscribed user doesn't get any response (about line 225 in mailman/src/mailman/app/subscriptions.py). Same but different for unsubscribe for users not on the list.
I tested and I see this, so there is a bug, but I don't know what the issue is.
Ok, if you consider this a bug it makes sense to fix it upstream and not just locally.
The code you point to should raise AlreadySubscribedError and <https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/commands/eml_membership.py#L110> should catch it and report, but this doesn't seem to be happening..
Actually I don't see where it should send the mail in the code you refered to, but I'm pretty new to mm3-code and the involved coding guidelines.
Ther code pointed to adds the error to results
and returns
ContinueProcessing.yes. The return is to mailman/runners/command.py
which is ultimately responsible for returning results
to the user in a
results of your email commands
message.
The issue is the code at <https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/app/subscriptions.py#L224> appears to not be executed as in my test at least, the workflow continued.
I would tend to add something along msg = UserNotification( self.mlist.owner_address, self.mlist.owner_address, subject, text, self.mlist.preferred_language) msg.send(self.mlist) (with appropriate subject, ...) before https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/app/subscriptio... but of course that could be the wrong approach (but as subscriptions.py is sending out mail at other places, that's my first idea).
Aside from the fact that this wouldn't work if that code isn't executed, sending that message at that point would not be appropriate if the subscription request originated from something other than an email command. I.e., if it's a web subscribe, the error should be reported in the web response, not in an email to the user who may not even be the one originating the request.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan