Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm sending out an email using rules. I'm leaving the from field blank, so that it just uses the site-wide address.

For some reason it seems like Drupal is cutting characters off the from address. This is on my local dev machine so the email looks like this: admin@website.meeples

When the email is supposed to get sent, I simply get a message saying "Unable to send e-mail. Contact the site administrator if the problem persists." so I checked my syslog, and all the from headers say "someone@website.meep" and the email can't send because my machine can't resolve that domain.

What the hell? Why has it modified the from address? I've tried changing the site email to "admin@test.com" and when I do that nothing gets modified (IE I see admin@test.com in my syslog). So why is it changing my website.meeples domain?

share|improve this question
add comment

1 Answer 1

I tracked the problem down to the mimemail module.

In mimemail.inc there is a function called mimemail_headers which contains this:

  if (preg_match('/[a-z\d\-\.\+_]+@(?:[a-z\d\-]+\.)+[a-z\d]{2,4}/i', $from, $matches)) {
    $headers['Return-Path'] = "<$matches[0]>";
  }

The {2,4} at the end of the regex caused it to chop the les off of meeples. Changing it to + fixed the problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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