Email alerts stopped working

Email alerts stopped working

by Joe Griffin -
Number of replies: 15
Apologies for cross-posting (I put this query in the General problems forum but it might be better here).

I have since yesterday stopped getting email alerts of posts to forums on two different course on my Moodle server (Moodle version 1.9.3). It does not matter how the forum is set up (all subscribed or optional subscription etc), still no alerts from any. Cron is running. The email alerts were working fine until yesterday and then stopped. I've read the forum faq and any other documentation and all settings are as described. No settings were changed by me since yesterday. Spam filter checked and not stopping emails from the server.

Any ideas?

Below is the latest cron output, I was expecting to see something about email in there? Maybe it got corrupted?

Thanks



Starting activity modules
Finished activity modules
Starting blocks
Processing cron function for search....Global searching is not enabled. Nothing performed by search.
done.
Finished blocks
Starting admin reports
Finished admin reports
Updating languages cache
Removing expired enrolments ...none found
Starting main gradebook job ...
done.
Running backups if required...
 Checking backup status...INACTIVE
Backup tasks finished.
Running auth crons if required...
...preventing stats to run, last execution was less than 20 hours ago.
Cron script completed correctly
Execution took 0.16242 seconds

Average of ratings: -
In reply to Joe Griffin

Re: Email alerts stopped working

by Joe Griffin -
Actually the problem is that email alerts of forum posts are irregular. Sometimes they work and other times they don't. Not a problem with spam as our spam filter is not blocking anything when I check and I have white listed the Moodle server email address.

I have two forums and the only difference is on the subscriptions. If would appear as though the problem occurs when every body is subscribed to a forum (no Subscription option e.g. 'Send me email copies of posts to this forum' is visible when composing a post) but not when they can choose (then the option whether or not to receive emails is visible on the Subscription drop down when posting or replying).

Not sure if this makes sense or if anybody has come across a similar situation.

I will submit a ticket but thought I'd raise the issue here first.

Thanks
In reply to Joe Griffin

Re: Email alerts stopped working

by Joe Griffin -
I'm not sure if anybody is following this but in case it helps here is the latest.

I have now got the email alerts working even when everbody is forced to subscribe. This was achieved by adding myself in the teacher role. The problem only manifests itself when I am just in the admin role. So is this a bug? Have I a admin role capability set incorrectly. Does Moodle assume that admins will not want email alerts when new posts are put in the forums.

I'll try reading the docs again, but if anybody can suggest anything...
In reply to Joe Griffin

Re: Email alerts stopped working

by John White -
Joe,

I have been following your posts, but hoping that others would spot the exact nature of your problem, and post accordingly. However maybe things are getting a bit clearer - to me at least.

This latter post suggests that you could be mixing actual faults with perceived ones, which will only muddy the waters.

You are right in observing that Admin User does not receive posts from forums where the these have forcesubscribe set to 1 (i.e. FORUM_FORCESUBSCRIBE). This is because the capability 'mod/forum:initialsubscriptions' is tested as the criteria to see who should get such posts, and this is NOT set in the Administrator Role. Indeed, if it was, you would get every message from every forum, without choice, and this could become impossible in a larger or growing site!

So in those courses where you wish to subscribe, and the forum subscriptions are forced, then assigning the Teacher role to yourself is about right, which would be less drastic than setting 'mod/forum:initialsubscriptions' to ALLOW for the Administrator role! Whereas in forums where they are not you can click the 'Subscribe to this forum' link.

Now, if this is cleared up, does this mean there are still issues to be resolved?

Regards,

John
Average of ratings: Useful (1)
In reply to John White

Re: Email alerts stopped working

by Joe Griffin -
John

Thanks a million that has cleared up the issue. I have read every admin capability, most more than once, but this aspect did not stand out in the docs page. Perhaps others, who are not as up to speed as myself on all consequencs of all capabilities might have had similar issues.

Anyway I have added a small edit to the docs pages to perhaps better explain this aspect of the initialsubscription capability. I think that the actual title "initialsubscription" does not do justice to what actually happens when this is set. It is not an intuitive name for the capability.

Any idea where I can suggest a change to capability title?

Joe
In reply to Joe Griffin

Re: Email alerts stopped working

by John White -
Joe,

Plainly you could something in the tracker.
But as the number of capabilities has increased with major upgrades, I would have a look as to whether there are new capabilities planned for Moodle 2.0 that might cover this.

The initialsubscription capability makes sense in its own right, that is, for those who have this capability set, in a given (course) context, then, when a forum is newly created with 'forcesubscribe' set to 'Yes, initially' then their name is added to the subscribers list (this is easily demonstrated). Its a slick trick for pre-loading the subscriptions to the forum, but still allowing users to later choose to opt out. Therefore users with this capability form a group of 'potential subscribers' for that forum.

As such, this 'capability' is not something the user can do, but something the user has done for them! Therefore users with this capability form a group of 'potential subscribers' to a forum, and its as a result of this that a forcesubscribed forum sends emails to these users.

This is not the only such permission that is used in more than one way (with possibly confusing semantics) but do you really want to deal with double the number of capabilities in every role???

All the best,

John
Average of ratings: Useful (1)
In reply to John White

Re: Email alerts stopped working

by Joe Griffin -
John

That explains the capability really well. I had (obviously) not realised. But then again when I set up a new forum I set the Force everyone to subscribe to NO. So my starting point is not necessarily as the designers of this function envisaged. Perhaps you might even add your description to the initialsubscription docs page? (I will happily cut and paste it if you like or put a link to your explanation as i think it is much clearer than the existing one).

And I most certainly would not want to see the number of capabilites increased, but maybe some need a bit more explaining thoughtful

Thanks again for the really, really helpful explanation.

Joe
In reply to Joe Griffin

Re: Email alerts stopped working

by John White -
Joe,

If you think that copying part of that text is useful (and I did repeat myself!) then by all means go ahead.

Can I add that my comments are not at all definitive, only that if I get hold of a 'new car' I can't help but fiddle with all the buttons to see what they do! And have a good poke around under the hood.

Regards,

John
In reply to John White

Re: Email alerts stopped working

by enrique fanjul -

I upgrade recently to 1.9.
Now the forum (with subscription forced for all) has stopped sending the emails, when I add a new posting.
Has any of you any idea about the reason for this, and how the problem could be solved?

I have seen your postings but I do not get to a clear idea of what should be done to solve the problem. I always post as a teacher, and the emails only arrive to the teacher account.

Thank you. Enrique

In reply to enrique fanjul

Re: Email alerts stopped working

by John White -
Enrique,

Go to...
Site Administration->Users->Permissions->Define Roles
Look at the Student Role and the capability 'mod/forum:initialsubscriptions' this should be set to ALLOW, as without it the student does not appear in the list of 'potential subscribers' that will be used to send emails when the forum is force-subscribed.
Perhaps this has not been set in the upgrade???

This may also be set to 'Allow' in the Teacher role with the same effect.

See if that fixes it.

Regards,

John
In reply to John White

Re: Email alerts stopped working

by enrique fanjul -

Thank you, John, but the problem (so strange) must be other.

I have checked and yes, it is set to ALLOW.

Regards,

Enrique

In reply to enrique fanjul

Re: Email alerts stopped working

by John White -
Enrique,

Just as a test, go into the same course, add a NEW forum, set force-subscribe to 'Yes, initially'.
Save the settings and enter the forum.
Click View/Edit Current Subscribers and look at who is on the list (IF ANY!)
Whoever is on this subscriber list will be the same people who get emails when you set the forum subscriptions to Yes, forever.

Is no-one listed? Go back to the course and look at Assign Roles. Who is there?

Report back again.

Regards,

John
Average of ratings: Useful (1)
In reply to John White

Re: Email alerts stopped working

by Eric Karnowski -
Hi John,

I've also been having the same problem, with a test course (which has one student and one teacher/admin). I thought I had the "Assign Roles" bit done correctly, but apparently not.

So when I fixed it and sent a test post, I got an email. Yay? No. It was from the course, but it was a test post from *hours* ago.

I've sent other test posts, marked as "send now", but none have come through.

I tried another without using the "send now"; close to an hour later, still none have come through.

The student is definitely subscribed, but it's still not working. Any other ideas?

Thank you!

Eric
In reply to Eric Karnowski

Re: Email alerts stopped working

by John White -
Eric,

Have you tried running the cron script manually so that you can more easily see the report?

...site.../admin/cron.php

You would be looking for
Processing module function forum_cron ...
Starting digest processing...
Cleaned old digest records
done.

And specifically the stuff in between those remarks, if any!

Regards,


John


Average of ratings: Useful (1)
In reply to John White

Re: Email alerts stopped working

by Eric Karnowski -
Bingo, that's the problem. OK, I'll check with someone here who understands this better than I do to set up the cron properly. Thank you *so much*.
In reply to John White

Re: Email alerts stopped working

by Rick Wilson -
John,

I am new to this forum or for that matter new to trying to track down issues with our website. I have been searching this forum and this seems to be the best place to pose this problem, but if this is improper please let me know the best course of action.

We have been using version 1.6.3 for a while and have starting taking advantage of the News emails and want to expand to using the forum email capability. Up until the last month or so everything has worked fine. Since that time the email notifications of successful backs has not been happening each time the back up is run (though I do get them occasionally -- back ups are running successfully). Also, it appears that our hosting service is treating many of the emails that are being sent as "spam". Some go through and others do not. (I suspect they don't have all of their machines with the same filters, thus sometimes I get lucky and the email gets through).

I have spoken with the hosting service and they say that the "from" in the email is <>, thus their spam filters are blocking the email from being sent. Sometimes they see a rejection (such as from gmail). We use the default php mail setting.

We have not changed anything (though I know we need to upgrade badly). Is there anything we can do to get a valid email address in the "from" portion?

Any help would be appreciated.

Rick Wilson