9

I am making a forum website with email notifications. I need to test these email notifications locally. Ive only ever used MAMP so I dont have much experience setting up dev environments.

What's the easiest way to test Drupal's email notifications locally? Can the Acquia stack do this?

3 Answers 3

10

You can log the emails, which also brings some sanity to your inbox. Of cause there is a module for that (or two):

2
  • Thats a nice way round. Ideally id prefere emails to be sent but yourse is a close 2nd choice. Thanks
    – Evanss
    Feb 14, 2012 at 15:52
  • drupal.org/project/reroute_email is another module that will send the emails to a configured address rather than logging them.
    – gapple
    Feb 15, 2012 at 0:21
1

Try out Antix. It's easy to set up and works well to test out on a local Drupal install.

1

A bunch of solutions is documented in the Drupal Community Documentation: Managing Mail Handling for Development or Testing.

Personally I prefer a combination of a local Postfix mail server, the Reroute Email module, and rerouting to a local mailbox. This has the advantage that you don't have to go through the trouble of setting up your local host to successfully send to external e-mail addresses without being rejected as a possible spammer. How to set it up:

  1. Install postfix. The default configuration under Ubuntu will work for our purposes.
  2. Make sure your relevant php.ini is set up to use postfix by containing these two lines. Contrary to the comments there, these settings are not just used on Win32 systems.

    SMTP = localhost
    smtp_port = 25
    
  3. Install the Reroute Email module: drush dl reroute_email && drush en reroute-email.

  4. In the configuration settings for Reroute Email, set the target addres to your Linux username (such as matt, no @hostname.tld part here). These e-mails arrive in your local mailbox in /var/spool/ then.
  5. Set up Thunderbird to fetch these e-mails: Go to "Edit → Account Settings → Add Other Account… → Type: Unix Mailspool (Movemail)" and use these settings:
    • "E-Mail Address": again use your Linux username (such as matt) but determine your hostname (hostname command) and add it hostname behind in the format username@hostname.
    • "Your Name" and "Account Name": anything will work, this is just cosmetics.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.