EDIT original post to be more relevant of what the actual issue is, copied from comment #3:
i had the checkboxes to receive email notifications checked for various groups my user was following, but I was not receiving any mail.

OK, upon further debug, I have discovered what causes the email notifications to sometimes fail:
Length of Subject line. Less than 46 characters works fine, 47 char or longer bombs.

Original Post is below.
-------------------------------------------------------------------
i had the checkboxes to receive email notifications checked for various groups my user was following, but I was not receiving any mail. Solution: enable rules_ui and then move from "inactive" to "active" the appropriate rule: OG new content notification. Now I get email notifications as expected.

Seems to me that the rule should be enabled by default and/or enabled when somebody checks the box, or the checkbox should be greyed out until the rule is enabled?

thanks.

CommentFileSizeAuthor
#6 message_notify_error_log.png7.69 KBWebSinPat

Comments

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)

Commons Groups disables the OG notification rule because Commons instead uses Commons Notify & Commons Subscribe to handle notifications and emails.

Are you referring to the settings form at user/[uid/notification-settings?

WebSinPat’s picture

Title: email notification checkbox has no effect because the email rule is inactive » email notification not working via commons notify - Error sending e-mail
Version: 7.x-3.2 » 7.x-3.3
Category: feature » support
Status: Postponed (maintainer needs more info) » Active

I'm just now getting back to trying to debug this issue.

Thanks @ezra-g for your answer in #2. OK, so I disabled the OG notification rule, which then leaves me back where I started, which is that email notification do not work.

No notification emails are sent and instead i get error messages.
errors in the log file:
Could not send message using Email to user ID 8.
Error sending e-mail (from valid_webmaster_email@gmail.com to valid_user_email@gmail.com).
and this error gets printed to the screen:
Unable to send e-mail. Contact the site administrator if the problem persists.
I see one of each of these errors per user that is supposed to receive the email notification.

I am able to send other email from the site, like password resets, cron messages, and when I enable the OG notification Rule, I receive emails from the site when content is added or comments are made. And if I enable "message notify example" I receive emails when a comment is added with no errors.
But the notifications shipped with Commons Notify seems to only generate errors in the log file.

> Are you referring to the settings form at user/[uid]/notification-setting
Yes, the users' notification settings are to receive email notifications.

I got this same behavior in commons3.2 and am still experiencing it in 3.3.

(At the time I didn't respond because I didn't quite know what you meant, but now many months later of working with commons I think i get what you are saying. So rules should not necessary and instead email notification is done based on a couple of message types at admin/structure/messages and I'm guessing some code in Commons Notify & Subscribe that handles the sending out of the mail, and maybe flags fit in somewhere too to determine if a user is following or not and if the user wants notifications or not. I'm not totally sure the workflow and how everything fits together. Therefore I'm not sure how to debug my email notifications not working.)

WebSinPat’s picture

OK, upon further debug, I have discovered what causes the email notifications to sometimes fail:
Length of Subject line. Less than 46 characters works fine, 47 char or longer bombs.

I suspect it's somewhere in message_notify rather than specific to commons_notify per my bug report at #1993196: Email notifications are not sent when subject exceeds 46 characters

ezra-g’s picture

Title: email notification not working via commons notify - Error sending e-mail » Email notifications are not sent when subject exceeds 46 characters

Interesting bug here - Re-titling to include the symptom here.

WebSinPat’s picture

Ooops, my last comment #3 referenced this same issue rather than one I meant, the one in the message_subscribe queue: #1993194: No email notification if subject exceed 46 characters: "Could not send message using Email to user ID"
There several other people report having the same problem, and I posted the workaround I am using. But not much progress on figuring out the underlying problem.

WebSinPat’s picture

Version: 7.x-3.3 » 7.x-3.5
Category: Support request » Bug report
Issue summary: View changes
StatusFileSize
new7.69 KB

update: I can reproduce on out of the box fresh install of commons 3.5

not too much to it iirc,
- set up a few groups
- post some content
- go to admin's notification settings and enable them
- post a new post in a group that admin follows and has notifications turned on

no email is sent and the error messages appears in the log file.
screenshot the php error messages

lightsurge’s picture

drupal_mail_send in 6.x chunked subjects with non-ASCII characters that were more than 46 characters long. It seems that some setups don't like the manner of chunking with "\n". #300387: drupal_mail_send with long UTF-8 subject puts \n to subject line, the mail() function won't send it then.

I had a quick look at mail.inc but couldn't quickly see if this was still happening, but if it is, something like the solution in #3 in above issue might help you.

lightsurge’s picture

lightsurge’s picture

The patch in #300387: drupal_mail_send with long UTF-8 subject puts \n to subject line, the mail() function won't send it then. is actually for 7.x (thought was 6.x) so you might be able to manually apply it.

Might be better to look at your setup, though, since that patch has not had much luck getting into core in the last 5+ years ;-)

https://drupal.org/comment/985929#comment-985929

WebSinPat’s picture

thanks @lightsurge. I would never have found that solution myself. Now having a better idea the problem, I will get with my host about it, as well as trying out the patch/suggestions in that thread.

ezra-g’s picture

Status: Active » Needs review

Thanks for that issue reference, lightsurge! Marking as review. Could folks who are experiencing the issue here please review the patch at https://drupal.org/comment/985929#comment-985929 and report back on whether that resolves the issue reported here? If so, that seems like a reasonable patch to include in Commons.

WebSinPat’s picture

the patch seems to work for me! allows messages with longer subject lines to be sent. two questions though:
1. the comment in #5 (and #6) https://drupal.org/comment/986218#comment-986218 gave me the impression they thought the approach in the patch was faulty, and removed safeguards for very very long lines. ? I know nothing about such things, but wonder before it's committed to commons.
2. I do not run into this problem with the long subject lines for emails sent from other parts of my drupal site (e.g webforms, new account notifications, etc) but I do for the messages from message_subscribe. So I wonder what is being done differently in those modules as far as creating the email message and if a solution lies therein?

If my questions are not on point then
TLDR: yes the patch in #3 of #300387: drupal_mail_send with long UTF-8 subject puts \n to subject line, the mail() function won't send it then. is working for me.

ezra-g’s picture

Status: Needs review » Postponed

I marked #1993194: No email notification if subject exceed 46 characters: "Could not send message using Email to user ID" as a duplicate of this issue.

Based on the "needs work" status and reasoning in #300387: drupal_mail_send with long UTF-8 subject puts \n to subject line, the mail() function won't send it then. and the fact that this error occurs for a subset of users, I believe the proper approach to fixing this for affected users in Commons is to resolve the problem as it appears in Drupal Core (or Message Subscribe, if we can demonstrate it's not actually a core bug).

As a result, I'm marking this issue as "postponed."

mattsmith3’s picture

I'm having the same issue, just trying to test this distro for a client demo.

Doesn't look like this has been touched in 6 months?

We're on 3.16 now, not sure if I should update the status?

hansfn’s picture

Version: 7.x-3.5 » 7.x-3.17

Yes, this is still an issue since it hasn't been fixed in Drupal Core. I guess we can update the version number to reflect that we still have a problem ;-)