E-mail login with alias domain change
May I suggest a option to allow mail users to authenticate using a domain alias too? So this way, if you have original domain "domain1.com", and a e-mail alias "domain2.com", the users can optionally send e-mails from "domain2.com"
Changes suggested in /etc/dovecot-sql.conf: (it's necessary to add a option in ISPConfig configuration to enable or not!)
user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = CONCAT ( SUBSTRING_INDEX('%u', '@', 1), (select mail_forwarding.destination FROM mail_forwarding where source = CONCAT ('@', SUBSTRING_INDEX('%u', '@', -1))))) AND `disable%Ls` = 'n' AND server_id = '1'
password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = CONCAT ( SUBSTRING_INDEX('%u', '@', 1), (select mail_forwarding.destination FROM mail_forwarding where source = CONCAT ('@', SUBSTRING_INDEX('%u', '@', -1))))) AND `disable%Ls` = 'n' AND server_id = '1'
Thanks!