Download & Extend

Regex in mimemail_headers strips allowed characters

Project:Mime Mail
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

Title:Email regex in mimemail_headers missing at least one character» Regex in mimemail_headers strips allowed characters
Status:active» fixed

The attached patch has been committed to both branches.

AttachmentSize
mimemail-1301876-1.patch 549 bytes

#2

Status:fixed» closed (fixed)

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

nobody click here