Hello,
I have a question about how subscribed users are being detected, and how it is suppose to work.
-Assume you have a mailing list M within mailman where user A is not!! subscribed.
-Also assume you have a forum F connected to M through modules "listhandler" and "mailhandler" and mailman_manager.
Now the question is, what is the expected behavior if user A logs in to drupal and posts a topic or replies in forum M.
What happens on my system is that the forum posting still goes to the mailing list M (and because user A is not subscribed, the email causes an error response).
Is this correct or how is it suppose to work?
I have to add that I wrote and use smartlist_manager instead of mailman manager. So maybe there is something going on that I do not know about yet.
Thanks,
Ulf
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | listhandler_1.patch | 4.27 KB | ulf1 |
Comments
Comment #1
ulf1 commentedsyntax error. It should be
"Now the question is, what is the expected behavior if user A logs in to drupal and posts a topic or replies in forum F ?"
Comment #2
samuelet commentedListhandler can't know if a user is subscribed or not to a list, so any post will be sent as mail to the email list (then the list manager , in the next stage, will manage it).
The only workaround i know is to assign a role to subscribed users and give the write permission them only on the forum F with some access module (forum_access or tac_lite).
This could require unmanageable manual syncronizations if your user subscriptions are managed directly by the list manager (via web interface or command line or whatelse).
It could be easyer if you are able to manage them inside drupal only, abstracting the list manager subscription process, but i don't know any modules to achieve this except for the mailman modules mailman_manager and User Mailman Register.
Comment #3
ulf1 commentedThanks for your detailed answer.
I created the smartlist_manager module which works internally similar to the mailman_manager module.
To get this working, I am thinking about something like a callback function that the list manager calls. Only if the function returns "true" the email will be forwarded to the list manager with the users email. If it returns false, it uses the "anon" email account.
Then mailman manager and smartlist_manager can implement the method to determine if a user is part of the mailing list or not. And of course the function should be able to handle admin and anonymous forum posts.
What do you think about this idea?
I am willing to provide some code/patch to make that work.
Cheers,
Ulf
Comment #4
philipnet commentedI think that idea sounds workable.
If you can provide some code and an idea of your setup (so that I can test it!) I'm willing to commit it.
Regards.
Phil.
Comment #5
samuelet commentedWell, it could be sufficent to know if a user is subscribed to a list before sending the post.
mailman_manager can do with _mailman_manager_get_subscriptions.
but it's not full reliable in this, i.e #351067: Unsubscribing via email not reflected in Mailman_Manager.
user_mailman_register is good for this as it can retrive the real status with _user_mailman_register_get_subscriptions.
Don't know about smartlist_manager.
Just an idea, pheraps the implementation could be done with hooks:
Before a user send a forum message, Listhandler could invoke an hook (using the forum id as argument) which retrives the forum post validation from external modules like those above mentioned.
Modules could make validation providing a configuration to assign mailing lists to forum (better in the listhandler configuration itself with form alteration) and the listhandler hook, which will check for user subscription status for the list assigned to the forum id passed by listhandler sending true/false to allow/deny the post.
Comment #6
ulf1 commentedI was also thinking down the line. with two differences:
I used the mailing list adress instead the forum id to pass to the hook, because the mailing list address is known to the mailman_manager and the listhandler. That way I do not need to alter the list handler configuration.
Secondly, the code allows posts to the forum, but before sending the post to the mailing list it verifies the user and if it does not exist it still sends the email, but uses the anonymous account.
Of course it would be perfect when there would be a configuration setting in listhandler to decide when the check is being done in list handler and what the outcome would be. I did not go down that path though, and the following solution works for me.
Besides the listhandler patch that I attached, here the code that I added to my smartlist_manager module to do the actual check if the user is subscribed to the mailing list. It could be added to mailman_manager as well:
Comment #7
cor3huis commentedComment #8
philipnet commentedHi,
The patch is for the smartlist_manager module.
I'm not sure what I need to review?
Comment #9
cor3huis commentedulf1 wrote two things in one line, maybe a little confusing:
That will be then http://drupal.org/files/issues/listhandler_1_0.patch
... for that nothing to do
Comment #10
philipnet commentedThanks for the clarity.
The patch has been applied and committed.
Or at least I believe it to be committed and I also believe that it will be in the next 6.x-1.x-dev release for Listhandler and I will be confirming that in 12 hours time ;) .
Comment #11
philipnet commentedSo that patch made it into the 'master' (aka HEAD) release, which was rebuilt overnight - but that wasn't the latest version of Listhandler :( .
So I've re-added this patch to 6.x-1.x-dev and that will be out within the next 12 hours.