Author Topic: Email for multiple domains  (Read 6510 times)

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« on: November 12, 2010, 01:59:06 AM »
I am very new to Roundcube and need some help. My company have a single mac mini with latest snow leopard that are hosting 2 domains (2 virtual domains). Lets call them domain1.com and domain2.com

We are using dyndns.org as the dns.

There are three users that needs email. Lets call them Chris, Ben and Percy.

We want to following email addresses.

chris@domain1.com
ben@domain1.com
percy@domain1.com

chris@domain2.com
ben@domain2.com
percy@domain2.com

I installed Mailserve Snow from Cutedgesystems to make things a little easier.

This is how we want it to work

We want to login with email address chris@domain1.com, ben@domain1.com and percy@domain1.com at domain1.com/roundcubemail.

We also want to login with email address chris@domain2.com, ben@domain2.com and percy@domain2.com at domain2.com/roundcubemail.

The problem right now is that ben for example see the same mailbox when he logs in at domain1.com/roundcubemail and domain2.com/roundcubemail. The same things is happening for chris and percy.

How should Roundcube be configured to work with multiple domains? It's nothing strange about what we want to do, just want our email to work on 2 domains.

Thanks in advance for your help.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Email for multiple domains
« Reply #1 on: November 12, 2010, 02:09:20 AM »
You just need to have different domains in $rcmail_config['username_domain'] for each copy of RoundCube then it should auto complete with witch ever domain there at.

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« Reply #2 on: November 12, 2010, 02:22:57 AM »
Thanks for your answer.

I edited mail.inc.php so the line now is $rcmail_config['username_domain'] = 'domain1.com'; I did the same thing for my other copy of roundcube.

I tried to login with ben@domain1.com/password at domain1.com/roundcubemail and I got Login failed.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Email for multiple domains
« Reply #3 on: November 12, 2010, 02:44:12 AM »
You should only have to login with "ben" when you set the username_domain but it sounds like you have a dovecot configuration problem.

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« Reply #4 on: November 12, 2010, 02:50:04 AM »
I tried to login with ben/password and that also gave me Login failed but...

I also have Squirrelmail installed and I can login with that. And I could login to Roundcube as well before I changed $rcmail_config['username_domain'] = ''; to $rcmail_config['username_domain'] = 'domain1.com';

Ok, can I run some tests to see where my configuration is wrong?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Email for multiple domains
« Reply #5 on: November 12, 2010, 08:15:55 AM »
Ok, maybe I'm confused on the problem, can you login both ben accounts from ether RoundCube install (with or without username_domain)?

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« Reply #6 on: November 12, 2010, 09:38:33 AM »
Yes I can login to both accounts with ben and my password like this.

url = domain1.com/roundcubemail
username = ben
password = password

url = domain2.com/roundcubemail
username = ben
password = password

This will take me to the same mailbox, very strange.

But I can only login if username_domain is like this.

$rcmail_config['username_domain'] = '';

As soon I set username_domain to domain1.com or domain2.com I get Login failed.
« Last Edit: November 12, 2010, 09:43:34 AM by vigour »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Email for multiple domains
« Reply #7 on: November 12, 2010, 10:00:55 AM »
How do you have the usernames setup in dovecot are you using @.com?

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« Reply #8 on: November 14, 2010, 10:16:02 AM »
I will try to explain how the username is set up. First 4 pictures from MailServe.






The manual for MailServe is located here:

MailServe for Snow Leopard

I hope that the pictures and the manual will make it a little clearer. I have talked to the guy that are building MailServe but his support is not very good. As soon I ask something he says, look in the manual.
« Last Edit: November 14, 2010, 10:27:03 AM by vigour »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Email for multiple domains
« Reply #9 on: November 14, 2010, 11:30:55 AM »
I don't know anything about MailServe and the documentation isn't that great, but to me it looks like its only setup with one account for ben, chris, and percy. It looks like kinda looks like MailServe can only setup/manage one domain worth of email accounts.

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« Reply #10 on: November 14, 2010, 12:27:01 PM »
I will show you the answer I got from the creator of MailServe.

Virtual Domains

Ordinarly, even if you receive mail for two domains - domainA.com and domainB.com, sales@domainA.com vill use the same mailbox as sales@domainB.com. But, using the Virtual Domains field, you can make things work a bit differently.

You need to create two separate user account on the server first, say, brendan and beekhim, respectively. Then make sure that the two domains, domainA.com and domainB.com, are listed in the Virtual Domains field. Then you can use the Virtual Domains Alias Mappings field to point sales@domainA.com to brendan's mailbox and sales@domainB.com to beekhim's mailbox, as shown below.


Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Email for multiple domains
« Reply #11 on: November 15, 2010, 10:45:01 AM »
That makes sense to me, have you tried setting it up that way?

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« Reply #12 on: November 15, 2010, 04:50:38 PM »
Yes I have tried to set it up that way but I am not sure if I am doing it the right way.

Ok, lets start.

I have 2 user accounts on my mac mini. What should I do next?

Offline vigour

  • Newbie
  • *
  • Posts: 8
Email for multiple domains
« Reply #13 on: November 16, 2010, 10:41:26 AM »
A little success.

First let me explain how my mac mini is set up.

We have a mac mini with latest OS X, we are not using Snow Leopard Server, just Snow Leopard. I have two accounts on the mac mini. Lets call them account1 and account2. I have two folders in the sites folder on account1 called domain1.com and domain2.com (virtual domains) I have dyndns.org as my dns server. I have roundcube installed at the following address on account1:

sites/domain1.com/roundcube

And also at this address on account1:

sites/domain2.com/roundcube

If I login to my mail at domain1.com/roundcube I see the same mailbox as domain2.com/roundcube

I now have two user accounts on my mac mini and the first time I sent email to my second email address the mail/devcote folder where created on account2. So far so good. Now I have two mail/devecote folders. One on each account.

But I still have the same mailbox so I am thinking. Must I point my email client to the right mailbox folder? Is that maybe the problem?

When I send email to my second address I do not receive any mail. I am pretty sure the mail is laying there in the mail/devcote folder on account2 just waiting for a mailclient to get it.

So the logical question is, how do I point squirrelmail or roundcube to a specific mailbox?


----------


UPDATE!

I checked inside the folder mail/devcote on account2 and yes, my mail is there. So the question is the same, how do I point roundcube to that folder?
« Last Edit: November 16, 2010, 11:22:18 AM by vigour »