I installed the latest dev and got two like this in my inbox (the other one is george.foreman@example.com)

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  matt_edmunds@example.com
    retry time not reached for any host after a long failure period

------ This is a copy of the message, including all the headers. ------

Return-path: <lisa.rex@acquia.com>
Received: from ec2-184-72-135-217.compute-1.amazonaws.com ([184.72.135.217] helo=free-1804.devcloud.hosting.acquia.com)
        by acquiamail2.acquia.com with esmtp (Exim 4.71)
        (envelope-from <lisa.rex@acquia.com>)
        id 1TeZxJ-0001va-GF
        for matt_edmunds@example.com; Fri, 30 Nov 2012 23:25:13 +0000
Received: from lrex by free-1804.devcloud.hosting.acquia.com with local (Exim 4.71)
        (envelope-from <lisa.rex@acquia.com>)
        id 1TeZxE-00028N-7n
        for matt_edmunds@example.com; Fri, 30 Nov 2012 23:25:08 +0000
Date: Fri, 30 Nov 2012 23:25:08 +0000
Message-Id: <E1TeZxE-00028N-7n@free-1804.devcloud.hosting.acquia.com>
To: matt_edmunds@example.com
Subject:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8Bit
X-Mailer: Drupal
Sender: lisa.rex@acquia.com
From: lisa.rex@acquia.com
CommentFileSizeAuthor
#4 no_mail_demo_users-1855548-4.patch551 bytesmmilano

Comments

lisarex’s picture

Mr. Nx’s picture

I get those messages everytime i comment on any contents. I think it is the fault of the invalid e-mail address provided for the test users whom the system tries to inform of new activity on their subscribed contents via e-mail.

EDIT:
Yes, i tried and tested by allocating real email addresses to the default test users and the return mails appears no more.

e-mail notifications by default shall be disabled to avoid those system generated messages

ezra-g’s picture

Title: Upon installation, 2 returned emails appear (default content) » Prevent Demo users from receiving emails from the site
Priority: Normal » Major

Bumping to major and re-titling to reflect the action item here.

Thanks for the report!

We could exclude these users from receiving emails by implementing hook_message_subscribe_get_subscribers_alter().

However, this feels like code that's pretty specialized to sites that have demo content.

It's worth considering creating a commons_demo_content() module, moving our bit from commons_install() to a hook_install() function for that module and implementing hook_message_subscribe_get_subscribers_alter().

mmilano’s picture

StatusFileSize
new551 bytes

Since example.com is an officially reserved domain for testing/documentation anyway, what do you think about this approach?

It would also support a case where a test user @example.com got added later.

/**
 * Implements hook_mail_alter();
 */
function commons_misc_mail_alter(&$message) {
  if (strstr($message['to'], '@') == '@example.com') {
    $message['send'] = FALSE;
  }
}

I understand where you're coming from as far as a separate demo module though.

mmilano’s picture

Status: Active » Needs review
ezra-g’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lisarex’s picture

Issue tags: +user experience

Tagging with 'user experience' to track usability studies

ezra-g’s picture

Version: » 7.x-3.x-dev

Restoring 7.x-3.x version property.