1 (edited by nicola.braccia 2015-12-21 19:18:30)

Topic: Error manage user account with dot

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

Hi, after the last upgrade of iredadmin-pro all the "normal" admin can't manage all user that present a dot inside the MailAddress (i.e.: firstname.lastname@example.com).

For this reason, when we try to open the url "https://mail.example.com/iredadmin/prof … xample.com" appear a PERMISSION_DENIED error.

Global admins don't present this issue.

Related log

[Mon Dec 21 09:29:07.895217 2015] [wsgi:error] [pid 22804] PERMISSION_DENIED (2) raised in @require_domain_access, triggered in module: controllers.sql.user.py, function: GET()

thanks

----

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

2

Re: Error manage user account with dot

Sorry about this trouble. i will try to reproduce this issue today and come back with a fix.

3

Re: Error manage user account with dot

Confirmed, it's bug in the latest iRedAdmin-Pro. Here's patch to fix it:

diff -r d98625ecf02e libs/iredutils.py
--- a/libs/iredutils.py    Fri Dec 18 23:19:58 2015 +0800
+++ b/libs/iredutils.py    Mon Dec 21 19:55:26 2015 +0800
@@ -61,7 +61,7 @@
 
     # Not contain invalid characters and match regular expression
     if not set(s) & set(r'~!#$%^&*()\/ ') \
-       and re.compile(regxes.email, re.IGNORECASE).match(s):
+       and re.compile(r'^' + regxes.email + r'$', re.IGNORECASE).match(s):
         return True
 
     return False
@@ -72,7 +72,7 @@
     if len(set(s) & set('~!#$%^&*()+\\/\ ')) > 0 or '.' not in s:
         return False
 
-    comp_domain = re.compile(regxes.domain, re.IGNORECASE)
+    comp_domain = re.compile(r'^' + regxes.domain + r'$', re.IGNORECASE)
     if comp_domain.match(s):
         return True
     else:

if you're not familiar with patch, i can mail you a patched version. Please contact us: http://www.iredmail.org/contact.html

4

Re: Error manage user account with dot

The patch work!!! Thank you