Mailpress 5.0 Email Validation Bug
A couple weeks ago I received an email from a client of mine about a bug one of their clients was having using the Mailpress WordPress plugin and wanting to know if I could help. They’re an agency and I always want to make them happy so, even though I didn’t write Mailpress, I decided to dive in a see what was up. Plus, it’s always fun to contribute to open source projects and to get paid to do it is always a win-win.
Before getting into the bug I just want to say that I didn’t want to post it in this way; ideally there would be channels available to submit issues but Mailpress doesn’t exactly make that easy. Their site, while having links to the expected destinations like Community and Submitting a patch, doesn’t appear to be finished and those sections are essentially empty at the moment. The information to put this information out there very well might be in the site but, frankly, the thought of writing this post was less painful than digging through the site looking for info. Plus, this isn’t a security issue at all so there’s that. Ass == Covered.
The issue was that the email validation was returning false even when an email was valid, specifically if the email wasn’t entirely lowercase. The problem with that, in case it’s not clear, is that an email address doesn’t have to be lower case (at least in the name portion). For example the below two emails are valid and, in fact, different:
eric@example.com
Eric@example.com
They look similar and it’s not really advisable to do email addresses in that format but people do it that way and, technically, it is allowed so not sure why Mailpress doesn’t.
Mailpress would throw an error on the second email which was pissing of my client’s client and my client (sigh…). The fix is pretty stratightford and easy; just replace the regular expression in Mailpress with the working one I cribbed from Zaheer.
File: “/wp-content/plugins/mailpress/mp-admin/js/write.js”
219 | is_email : function(m) { var pattern = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; return pattern.test(m); }, |
With:
219 | is_email : function(m) { var pattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; return pattern.test(m); }, |
Hopefully, the issue doesn’t go deeper than the javascript validation but the above does allow for a working email validation script. Now we just need Mailpress to update their wonderful plugin with the fix…

Email
Twitter
You are unfortunately wrong, there is a very active community and the developer answers each and every email very quickly. I agree his web site needs help. However I am not surprised as he is very diligent in answering every email.
In more than just english, french too afaik. His name is Andre Renaut you can join the google group set upf or this purpose mailpress@googlegroups.com, sign up and I am sure Andre will appreciate your input.
Hi HIlary,
I think it’s sweet that you’re defending Mailpress on this point; more people should step up like you have.
I’ll check it.
Eric
Glad to see you contributing, we all benefit when the true spirit of sharing in the community is awakened.
Hi Hilary,
You made such a compelling argument that, unfortunately, isn’t backed up by reality. I posted the bug 2 days ago and there hasn’t even been a single response..
I maintain that mailpress is a ghetto.
Eric