Accepts incoming emails for active mailboxes, even if password is expired

pull/200/head
Damien Martins 6 years ago
parent 9e4d64ef78
commit 78a461f07e

@ -37,7 +37,7 @@ All my tests are performed using $config['password_algorithm'] = 'md5-crypt';
Edit dovecot-mysql.conf file, and replace the user_query (and only this one) by this query:
user_query = SELECT concat('/var/vmail/', m.maildir) as home, concat('maildir:/var/vmail/', m.maildir) as mail, 20001 AS uid, 20001 AS gid, concat('dirsize:storage=', m.quota) AS quota, m.domain FROM mailbox m ,domain d WHERE d.domain = m.domain and m.username = 'tutu@eyetech-software.com' AND m.active = '1' and (m.password_expiry > now() or d.password_expiry = 0)
password_query = SELECT username as user, password, concat('/var/vmail/', maildir) as userdb_var, concat('maildir:/var/vmail/', maildir) as userdb_mail, 20001 as userdb_uid, 20001 as userdb_gid, m.domain FROM mailbox m, domain d where d.domain = m.domain and m.username = '%u' AND m.active = '1' AND (m.pw_expires_on > now() or d.password_expiration_value = 0)
Of course you may require to adapt the uid, gid, maildir and table to your setup

Loading…
Cancel
Save