Topic: Separate Account-Name for Login possible?

==== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu Server 12.04
- Related log if you're reporting an issue:

Currently I migrate an old Mailserver with Postfix and Cyrus to iRedMail with iRedAdminPro. In this old cyrus it was not possible to create Users/Accounts in form of "name@domain.com", only "name_domain_com" (Dot was the Separator in Cyrus for IMAP-Folders).

I have 1000+ Users in the old system and dont want them all to change their Account-Settings in their MUA´s.

Is there a way to have a separate Login-Name in iRedMail/iRedAdminPro? So Users can login both with "name@domain.com" and "name_domain_com" (for IMAP/POP3 and SMTP-Auth) ?


Re: Separate Account-Name for Login possible?

No idea yet, sorry. sad
iRedMail uses full email address as login username. Although it's able to use username part in email address as login username too, but it's just for one domain.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: Separate Account-Name for Login possible?

Thank you for the quick response!

But: I´m thinking on a custom solution:

How about creating a separate MySQL-Table (e-mail-address ---> alternative-login-name), and customize the sql-command for dovecot and smtp-auth (to let it ask for both login names). Maintenance for this separate Table will be only manually adjustable, not with iRedAdminPro. It is also clear that I have to be cautious on iRedMail-Updates.

Can you tell me which sql-commands have to be adjusted? Any help is greatly appreciated!

4 (edited by vmos 2014-02-13 03:00:57)

Re: Separate Account-Name for Login possible?

we were planning on doing this, but later abandoned it. The plan was to allow people to login with their email address OR the username they had from the old platform, we had those usernames in a separate column in the database called modusname. As i recall the tricky bit was getting dovecot to look at both columns. Here's the modified dovecot conf I have in my notes, I'm pretty sure this works

iterate_query = SELECT username AS user FROM mailbox
password_query = SELECT password FROM mailbox WHERE username='%u'  OR modusname='%u'  AND active='1'
#password_query = SELECT password FROM mailbox WHERE modusname='%u'  AND active='1'

user_query = SELECT \
    '%u' AS master_user, \
    CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
    CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
    OR mailbox.modusname='%u'\
#    AND mailbox.domain='%d' \
    AND mailbox.`enable%Ls%Lc`=1 \
    AND mailbox.domain=domain.domain \
    AND domain.backupmx=0 \
    AND domain.active=1 \
    AND mailbox.active=1

The other problem was the domain login mismatch. There's a feature in postfix which prevents you sending mail as a domain that you're not authenticated as. The quick fix is to turn it off, but that allows you to send mail as obama@whitehouse.gov if you feel like it. I don't think wefigured out a way around that before we dropped the whole plan

also, here's the modified query from /etc/postfix/mysql/sender_login_maps.cf

#query       = SELECT mailbox.username FROM mailbox WHERE mailbox.username='%s' OR  mailbox.modusname='%s' AND mailbox.enablesmtp=1 AND mailbox.active=1
#AND domain.backupmx=0 AND domain.active=1

but I don't remember that working particularly well


Re: Separate Account-Name for Login possible?

I´m not sure, bu maybe you need an IMAP (and SMTP) Proxy in front of your iredmail?


If this solves your problem, I´m interested in your success story. smile