1

Topic: Can not login with accounts having '&' in email address

==== Required information ====
- iRedMail version (check /etc/iredmail-release):      v0.9.5-1
- Linux/BSD distribution name and version: Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes  v2.4.0 (MySQL)
- Related log if you're reporting an issue:
====

I have many email addresses with '&' character. Those were working well in SmarterMail. I have bulk created those emails in iRedMail.

But the problem is, user can't login with emails having '&' in address.
A exmaple email ID is

r&d@somedomain.tld

How to allow such users to login?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Can not login with accounts having '&' in email address

Try patch below:

diff -r 7db2210c0b5d libs/regxes.py
--- a/libs/regxes.py    Mon Jun 06 15:32:16 2016 +0800
+++ b/libs/regxes.py    Fri Jun 10 21:38:27 2016 +0800
@@ -8,7 +8,7 @@
 #   - `+`, `=` are used in SRS rewritten addresses.
 #   - `/` is sub-folder. e.g. 'john+lists/abc/def@domain.com' will create
 #     directory `lists` and its sub-folders `lists/abc/`, `lists/abc/def`.
-email = r'''[\w\-][\w\-\.\+\=\/]*@[\w\-][\w\-\.]*\.[a-zA-Z0-9\-]{2,15}'''
+email = r'''[\w\-][\w\-\.\+\=\/\&]*@[\w\-][\w\-\.]*\.[a-zA-Z0-9\-]{2,15}'''
 cmp_email = re.compile(email, re.IGNORECASE | re.DOTALL)
 
 # Wildcard sender address: 'user@*'

Not all mail servers like special characters, the common advice is avoiding using special characters to avoid possible mail rejection, and just use digital numbers, letters, '-', '.'.