Email sent using rules chops characters off email from address 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?
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'] = "&lt;$matches[0]&gt;";
  }


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