Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1

    Post Separate Mailboxes For The Same User On Multiple Domains

    By default, e-mail users and e-mail aliases are shared across all domains on your VPS hosting account. This means that if you have two domains on your account, example.com and example.net, and you create an e-mail user called info, this e-mail user will receive e-mails sent to both info@example.com and info@example.net. Another way to think of this is that the Site Manager is indifferent to the domain name on incoming e-mail. In most cases, this is the desired behavior; many organizations have multiple domain names, all of which should direct e-mail messages to the appropriate user within the organization.

    In some cases, however, clients have distinctly separate domain names on the same WestHost account and wish to use the same e-mail user on more than one of the distinct domain names. This happens, for example, if info@foo.com and info@bar.com should be directed to completely separate organizations, but both foo.com and bar.com are on a single VPS hosting account. If you were to simply create a user called info in the Site Manager, this single e-mail user would receive messages send to both info@foo.com and info@bar.com.

    To separate the mail for info@foo.com from that for info@bar.com, follow the steps below. In this example, we're only using two e-mail addresses, but you can expand this to accommodate creating distinct mailboxes on any number of domains.
    1. If you already have an e-mail user in the Site Manager named info, delete it.
      .
    2. Create new e-mail user accounts in the Site Manager for each distinct address. Here we are creating info.foo and info.bar.
      .
    3. Using the online File Manager, an FTP client, or an SSH command line, edit the file /etc/mail/virtusertable on your VPS. This simple text file tells the sendmail server which e-mail address is associated with which e-mail user from the Site Manager. At the bottom of the file, you'll see something like this corresponding to the new e-mail users you just created in the Site Manager:
      Code:
      ...
      info.foo@bar.com    info.foo
      info.foo@foo.com    info.foo
      info.bar@bar.com    info.bar
      info.bar@foo.com    info.bar
    4. Edit this portion of the file such that info@foo.com points to the info.foo e-mail user and info@bar.com points to the info.bar e-mail user. This will result in something like this (note that the rest of the file remains unchanged, and there are fewer lines than previously):
      Code:
      ...
      info@foo.com        info.foo
      info@bar.com        info.bar
    5. Using the online File Manager or an SSH command line, execute the following command to apply your changes:
      Code:
      makemap -v hash /etc/mail/virtusertable.db < /etc/mail/virtusertable

    You now have separate mailboxes. Send a test message to each address and verify that it arrives in the correct e-mail user's mailbox.

    With a dedicated IP address, you can access the mail with Outlook, Mac Mail, Mozilla Thunderbird, or another e-mail client using the username info.foo or info.bar, as appropriate. With a shared IP address, the username will be info.foo@foo.com or info.bar@bar.com, as appropriate.
    Last edited by nventurella; 04-09-2009 at 10:31 PM. Reason: Please note the corrected makemap command in step 5!
    Nick Venturella
    WestHost Technical Support
    Contact Support: E-mail | Live Chat

    When you expect more from your Web host
    http://www.westhost.com/

  2. #2

    Thumbs up Email addresses for addon domains

    Thank you Nick for this simple and easy-to-follow guide. I had bookmarked this thread previously, but it seemed too alien for me (with no SSH experience).

    Your short, concise guide has made me realise that it's not complicated at all, and can be executed without SSH.

    Thanks

  3. #3
    Junior Member
    Join Date
    Apr 2009
    Location
    CA USA
    Posts
    2

    Default

    hi
    thanks for this and thanks to other posters on other threads concerning this issue.
    i followed the instructions above and every step of the way seems to verify as outlined. however, when i send an email to tld2.com it gets bounced back.
    "user@tld2.com
    No such person at this address"
    tld1.com accounts all work but the two accounts for tld2.com will not. i can log into the 2 accounts at tld2.com with thunderbird.
    any suggestions?
    thanks,
    d

  4. #4
    Junior Member
    Join Date
    Apr 2009
    Location
    CA USA
    Posts
    2

    Thumbs up Sorry, It Does Work

    nventurella,
    Firstly, thanks for taking the time to show me the errors in my ways, grin.
    nventurella's concise instructions do indeed work. my problem was the email account i was sending test emails from was on the same server the hosted accounts used to have the name servers pointed to. the problem about that was i hadn't deleted the accounts on the old server! so the email sever on the old server was bouncing back test emails sent to the accounts on the new server. follow?!?
    the simple solution was to delete the old accounts on the old server or send test emails from yahoo or whatever.
    thanks again! westhost's support team is great.
    d

  5. #5
    Junior Member
    Join Date
    Apr 2007
    Posts
    5

    Default

    Thanks for making this a sticky. I am in the process of moving some domains between accounts, and this is very useful.

    Frank

  6. #6
    Member
    Join Date
    May 2009
    Location
    Portland, OR
    Posts
    40

    Default

    I have set up the same-named account on two domains following the instructions above. I configured both RoundCube webmail and Entourage to log into one of the accounts, and I can send mail from that account in both places. But when I send email to that account, it never appears in the Inbox. It doesn't bounce back to the sender, it just seems to go nowhere. Can anyone help me with this?

  7. #7
    Member
    Join Date
    May 2009
    Location
    Portland, OR
    Posts
    40

    Default

    Quote Originally Posted by arlomedia View Post
    When I send email to that account, it never appears in the Inbox. It doesn't bounce back to the sender, it just seems to go nowhere. Can anyone help me with this?
    My test messages finally bounced back after 48 hours, so now I see what happened. A while back, I changed the primary domain name on my account, but the domain name listed in the MX record was not updated and still showed the old domain name. I updated that, and after a few hours for DNS propagation, my mail worked as expected. So -- the setup above seems to be fine.

  8. #8
    Junior Member
    Join Date
    Apr 2005
    Posts
    7

    Default

    I am trying to do something a tad different, which is to have
    foo@foo.com go to user foo
    bar@bar.com go to user bar
    and have users foo@bar.com and bar@foo.com bounce.

    I'm pretty sure I edited virtualusertable correctly (basically just remove foo@bar.com etc), did the makemap, and that looked OK, but things like foo@bar.com are still going to user foo.

    I assume I have to restart sendmail. If tried sendmail /restart I got an error that appears to be that I was not 'root'. I tried restarting my domain, but I don't know how partitioned things are. I couldn't find anything in the forums that helped with that.

    Any suggestions?

  9. #9
    Moderator wildjokerdesign's Avatar
    Join Date
    Jun 2003
    Location
    Kansas City Mo
    Posts
    5,720

    Default

    That should have done it for you. If you restart your VPS then it restarts everything on the account. You shouldn't need to restart sendmail. Double check your edits.
    Shawn
    Please remember your charity of choice: http://www.redcross.org

    Handy Links: wildjokerdesign.net | Plain Text Editors: EditPlus | Crimson

  10. #10
    Moderator wildjokerdesign's Avatar
    Join Date
    Jun 2003
    Location
    Kansas City Mo
    Posts
    5,720

    Default

    Just to confirm and give a visual, it should look like this;
    Code:
    foo@foo.com       foo
    bar@bar.com       bar
    Shawn
    Please remember your charity of choice: http://www.redcross.org

    Handy Links: wildjokerdesign.net | Plain Text Editors: EditPlus | Crimson

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •