The plus symbol ("+") is an allowed character in email usernames. There may be others not in the regex. Oh, yeah, underscores. I think the preg_match line should at least be:

preg_match('/[a-z0-9\-\.\+_]+@{1}[a-z0-9\-\.]+/i', $from, $matches);

One could make the argument for a more inclusive expressions like:

preg_match('/[^\s<]+@{1}[^\s\.]+\.[^\s>]+/i', $from, $matches);

But I'm not an expert and it may include more than it really should.

Files: 
CommentFileSizeAuthor
#1 mimemail-1301876-1.patch549 bytessgabe

Comments

sgabe’s picture

Title:Email regex in mimemail_headers missing at least one character» Regex in mimemail_headers strips allowed characters
Status:Active» Fixed
StatusFileSize
new549 bytes

The attached patch has been committed to both branches.

Status:Fixed» Closed (fixed)

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