1

Topic: Password max limit error

==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Ubuntu
====

After I've set up in settings.py password max charaster limit
iRedAdmin-Pro password generator in user creating page has a more charasters than max value.

min_passwd_lenght = 8
max_passwd_length = 16

Need a random password?  397sWB48ncZnGjjPDhJ

Error: Password is too long.

----

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

2

Re: Password max limit error

Looks like a bug in iRedAdmin-Pro, i will check this issue and come back to you later. Thanks for your feedback. smile

3

Re: Password max limit error

Hi labasus,

It's a bug in the latest iRedAdmin-Pro, you can fix it with below patch, or wait for next release of iRedAdmin-Pro. Thanks very much for your report.

diff -r d322fc82cccc libs/iredpwd.py
--- a/libs/iredpwd.py    Tue May 27 18:36:41 2014 +0800
+++ b/libs/iredpwd.py    Wed Jun 04 10:53:52 2014 +0800
@@ -85,15 +85,19 @@
     opts = []
     if settings.PASSWORD_HAS_LETTER:
         opts += random.choice(letters)
+        length -= 1
 
     if settings.PASSWORD_HAS_UPPERCASE:
         opts += random.choice(uppercases)
+        length -= 1
 
     if settings.PASSWORD_HAS_NUMBER:
         opts += random.choice(numbers)
+        length -= 1
 
     if settings.PASSWORD_HAS_SPECIAL_CHAR:
         opts += random.choice(settings.PASSWORD_SPECIAL_CHARACTERS)
+        length -= 1
 
     opts += list(iredutils.generate_random_strings(length))