1

Topic: Possible iRedMail without virtualusers / virtualdomains ?

Hello,

Currently I'm using iRedMail and everything work fine. But now, I got a new customer who already have a mail system. He come from sendmail and the system work like this:

Hi has the domains: example1.org, example2.org and example3.org. He creates the users:

user1, user2, user3 and user4.

So from users are created, they are available to: user1@example1.org, user1@example2.org, user1@example3.org ... etc.

All domains match to the same user.

If i install iRedMail by default, the users account will pass to be "user1" to "user1@domain.tld".
I need keep same infraestructure, so the server migration will be transparent to the final user. He has to be able to log in only with "user1".

Is there anyway to do this with iRedMail ?

Mayble with aliases, matching real mail address "user1@example3.org" to the account "user1" ?

Thanks and regards.==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

----

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

2

Re: Possible iRedMail without virtualusers / virtualdomains ?

Sysdebian wrote:

Mayble with aliases, matching real mail address "user1@example3.org" to the account "user1" ?

It's easy with domain alias, not user alias.

  • Create first mail domain: example1.org.

  • Add domain alias to example1.org: example2.org, example3.org.

  • Create new users: user1. It's available with 3 mail addresses: user1@example1.org, user1@example2.org, user1@example3.org.

  • Create more users if you want.

How to add domain alias manually:

  • For OpenLDAP backend, just add "domainAliasName=example2.org" and "domainAliasName=example3.org" in domain object "domainName=example1.org".

  • For MySQL backend, add records in table "vmail.alias_domain". For example,

mysql> USE vmail;
mysql> INSERT INTO alias_domain (alias_domain, target_domain) VALUES ('example2.org', 'example1.org'), ('example3.org', 'example1.org');

That's all.

You can easily manage domain aliases with iRedAdmin-Pro - official web-based iRedMail admin panel. Screenshot for your reference:
http://screenshots.iredmail.googlecode.com/hg/iredadmin/domain_profile_alias.png

3 (edited by Sysdebian 2011-09-28 15:53:32)

Re: Possible iRedMail without virtualusers / virtualdomains ?

ZhangHuangbin wrote:

[*]Create new users: user1. It's available with 3 mail addresses: user1@example1.org, user1@example2.org, user1@example3.org.[/*]
[*]Create more users if you want.[/*]

Thanks ZhangHuangbin, thats what i need.

Last question, the users login will be "user1" or "user1@main_domain.tld" ?

Regards.

4

Re: Possible iRedMail without virtualusers / virtualdomains ?

Sysdebian wrote:

the users login will be "user1" or "user1@main_domain.tld" ?

Please always use user@main_domain.ltd.

5

Re: Possible iRedMail without virtualusers / virtualdomains ?

ZhangHuangbin wrote:
Sysdebian wrote:

the users login will be "user1" or "user1@main_domain.tld" ?

Please always use user@main_domain.ltd.

But these is the big problem.
The customer need the same login and password, so i have to keep same form, without @main_domain.ltd. Is there any way to get this ? Maybe changing in the bd the usernames ?

Regards.==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

6

Re: Possible iRedMail without virtualusers / virtualdomains ?

It's possible too, but it requires some addition changes.

- In Dovecot config file, /etc/dovecot.conf, set "auth_default_realm = main_domain.ltd". Then user can login with username "user1", "user2" directly. Dovecot will append "@main_domain.ltd" automatically.
- In Postfix, you should hard-code domain name in some LDAP/MySQL query files under /etc/postfix/ldap/ or /etc/postfix/mysql/. for example, you have below setting in /etc/postfix/mysql/sender_login_maps.cf:

query       = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' [...OMIT OTHERS HERE...]

You have to replace '%s' with '%u@main_domain.ltd' here.

Reference:
- http://www.postfix.org/ldap_table.5.html
- http://www.postfix.org/mysql_table.5.html
- http://wiki.dovecot.org/MainConfig (Search "auth_default_realm" in this page)

Personally, i recommend to use full email address as username on client side IF POSSIBLE.

7

Re: Possible iRedMail without virtualusers / virtualdomains ?

ZhangHuangbin wrote:

Personally, i recommend to use full email address as username on client side IF POSSIBLE.

ZhanHuangbin, thank a lot for your support.
I'm with you, but the customer have lot of users around the world and the migration will be very difficult, so we have to do this.
I'm going to try your instruction and I'll tell you when it will be ready.

Regards.

8 (edited by Sysdebian 2012-01-27 17:09:24)

Re: Possible iRedMail without virtualusers / virtualdomains ?

Hello,

I'm working with this topic and I have found a problem.

I have installed iredmail 0.7.4 in Debian Squeeze.

I have setup a primary domain. Just for test I send a mail to one domain which doesn't exist still in the server, i got this in logs:

Jan 27 09:30:07 mailserver postfix/smtpd[26416]: NOQUEUE: reject: RCPT from otherserver[]: 554 5.7.1 <www@domain2.com>: Relay access denied; from=<sys@sender.com> to=<www@domain2.com> proto=ESMTP helo=<domainsender>

Everything is correct because domain2.com still doesn's exist in the server.
Now i add  alias for the main domain just like you tell me:

mysql> USE vmail;
mysql> INSERT INTO alias_domain (alias_domain, target_domain) VALUES ('domain2.com', 'domain1.com'), ('domain3.com', 'domain1.com');

I still don't get mails but now the error is this:

Jan 27 10:07:10 mailserver postfix/smtpd[27046]: connect from domainsender[]
Jan 27 10:07:10 mailserver postfix-policyd: rcpt=2, greylist=new, host=ipser (domainsender), from=sys@sender.com, to=www@domain2.com, size=3724
Jan 27 10:07:10 mailserver postfix/smtpd[27046]: NOQUEUE: reject: RCPT from domainsender[]: 450 4.7.1 <www@domain2.com>: Recipient address rejected: Policy Rejection- Please try later.; from=<sys@sender.com> to=<www@domain2.com> proto=ESMTP helo=<domainsender>
Jan 27 10:07:10 mailserver postfix/smtpd[27046]: disconnect from domainsender[]

Any idea ?

Thanks and regards.

9

Re: Possible iRedMail without virtualusers / virtualdomains ?

It was greylist.

Best regards.