Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30698

Message-ID causes mail problem when sending to more than one person (e.g. forum subscription)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2
    • Fix Version/s: 2.3
    • Component/s: Forum
    • Labels:
    • Environment:
      Moodle: Windows Server 2008 R2; MySQL DB;
      Mailserver: Linux SuSE postfix, mails dropped and picked up by POP3
    • Testing Instructions:
      Hide

      For this test you'll need 2 users and a course containing a forum. This test is easier if you turn down your forum maximum editing time to 1 minute (or you can check "mail now" when posting in the forum).

      Unless you have recently seen your Moodle send email please verify that your email sending is working. To do this check that a user's messaging preferences are set so that they receive email notifications for personal messages while both online and offline. Have another user message them within Moodle. Check that the email notification is received. This code is not affected by this bug fix. If it does not work your system is not configured correctly.

      Assuming that works, on to the test. You will need 2 users.

      Have a user subscribe to the forum (if they arent already). The subscription/unsubscription link appears in the Settings block while you are viewing the forum.

      Check that the user has their messaging preferences set to "email" while both online and offline for forum posts.

      As another user user post in the forum. Wait for your editing time to elapse. Run /admin/cron.php. Check that the subscribed user receives the notification email about the forum post.

      As the user who posted in the forum, post in the forum again replying to your previous post (the user is replying to themselves). Again, wait then run cron. The second notification email should be grouped by your email client.

      Show
      For this test you'll need 2 users and a course containing a forum. This test is easier if you turn down your forum maximum editing time to 1 minute (or you can check "mail now" when posting in the forum). Unless you have recently seen your Moodle send email please verify that your email sending is working. To do this check that a user's messaging preferences are set so that they receive email notifications for personal messages while both online and offline. Have another user message them within Moodle. Check that the email notification is received. This code is not affected by this bug fix. If it does not work your system is not configured correctly. Assuming that works, on to the test. You will need 2 users. Have a user subscribe to the forum (if they arent already). The subscription/unsubscription link appears in the Settings block while you are viewing the forum. Check that the user has their messaging preferences set to "email" while both online and offline for forum posts. As another user user post in the forum. Wait for your editing time to elapse. Run /admin/cron.php. Check that the subscribed user receives the notification email about the forum post. As the user who posted in the forum, post in the forum again replying to your previous post (the user is replying to themselves). Again, wait then run cron. The second notification email should be grouped by your email client.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-30698_multiple_emails

      Description

      I don't know if this is a mailserver-specific problem - so I've set it as an "Improvement".

      If a new forum post is written, every subscriber gets an e-mail. If more than one person has subscribed to the forum, only one of all e-mails arrive. The problem was, that the mailserver identified them as "duplicate" because of the same "message-ID". So only the first mail was delivered. Looking into the code, this was clear....:

      ../mod/forum/lib.php line 602 (v2.1.2): 'Message-ID: <moodlepost'.$post->id.'@'.$hostname.'>',

      The message-ID consists of the "post-ID"...
      To have individual message-IDs, I just put the "userto-ID" into it as well: 'Message-ID: <moodlepost'.$post->id.$userto->id.'@'.$hostname.'>',

      Now it works, every subscriber gets an e-mail.

      I wonder if the behaviour of our mailserver is normal, but maybe this hint can help others too...

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Jun/12