1 2 Previous Next 19 Replies Latest reply: Aug 27, 2013 5:12 AM by trilogy1000
drefinity Level 1 Level 1 (0 points)

Hi,

 

I am wondering if I can do the following with the OS X Server. I got multiple domains and have therefore multiple email accounts of each domain. As you can imagine its quite painfull to centralize them all. Now from what I understood is that you can configure OS X Server so that all emails will be downloaded to my local Server at home and I can just access my OS X Mail Server from all my devices via IMAP and get all mails from all accounts.

 

1. Is that possible at all?

2. If so can anyone point me in the direction of a Guide or some reading Material?

 

I saw that OS X Server is using dovecot but can't find much input as in how to configure it.

 

Thanks for your advise.


Regards,

André

  • 1. Re: How to setup multiple email accounts on OS X Server 10.8?
    UptimeJeff Level 4 Level 4 (3,390 points)

    Your post is a bit open ended....

     

    First thing - You need to decide if you want to use virtual domains or not.

     

    If

         bob@domain1.com

         bob@domain2.com

         bob@domain3.com

    all should be separate mailboxes, then you need virtual domains.

     

     

    If those 3 addresses can all go to the same mailbox, then you don't.

     

    If you don't need virtual domains, then don't use them... things are simpler without that feature.

    If thats the case, in the domain name field in Mail service, enter your primary domain.

    You'll then need to enter your other domains via command line.

     

    First, check your mail domain setting with:

    sudo serveradmin settings mail:postfix:mydomain

     

    Here is how you enter more than one domain:

    - Quit the Server app

    - Issue this with your domains between the quotes

    sudo serveradmin settings mail:postfix:mydomain = "domain1.com, domain2.com"

     

    - Restart postfix to activate your change

    sudo postfix reload

     

    If you open the Server app, you will notice both domains are now listed.

  • 2. Re: How to setup multiple email accounts on OS X Server 10.8?
    drefinity Level 1 Level 1 (0 points)

    Hi Jeff,

     

    thanks alot for your answer that gives me an idea what is missing. I guess the reason beeing that I wasn't so clear is that I wasn't sure what I can do. Maybe I haven't looked hard enough but thought the OS X Server Manual is not very detailed in explaining the what and how.

     

    If it is not too much to ask, can you explain or point me to a post/doc somewhere on the Net that shows me the advantage/disadvantage of both?

     

    I have around 20 domains all different types (.com, .ch, .org , .net) though all of them share some common names like (admin@, backup@, webmaster@) the also got indevidual names I use for special purposes to avoid SPAM or to distinguish better between Services. Say for example for my dropbox account I use an email prefix called (dropbox@) or for paypal I use (paypal@)... you get the idea.

     

    Now my issue is I am on the road alot and though I don't need to read every email I get I do think if I setup everyting the same way I will haven an administration advantage. Also I was wondering what OS X is capable of.

     

    So my initial idea was:

     

    1. point all domain email addresses to my OS X Server at home. (pop3 or imap)

    2. add some mail-boxes on my phone / macbook / ipad as I see fit

    3. add a single mail-box to share several domains such as all (admin@ + webmaster@)

     

    I hope that makes sense?

     

    I guess from what I understand I will have to use virtual domains, but I also get the hint that it is alot more work and complex?

     

    From the command-lines you posted it means I configure that in postfix rather than the Server App correct? Meaning any postfix Documentation applies here?

     

    Thanks again for you help.

  • 3. Re: How to setup multiple email accounts on OS X Server 10.8?
    UptimeJeff Level 4 Level 4 (3,390 points)

    This document explains a bit about that a virtual domain (virtual user) is and gives you an idea about how it works under the hood.

    http://downloads.topicdesk.com/docs/Making_Virtual_Mail_Users_in_OS_X_Server.pdf

    Its a bit different in 10.8, but the concepts are the same.

     

    With 10.8, standard postfix config applies except the location of the files is non-standard because Server is not an 'app' all config has moved to /Library.

    You'll find the config files at

    /Library/Server/Mail/Config/postfix

     

    Many settings can be changed via the 'serveradmin' command. Try to use that when a setting is available.

    Other settings need to be changed directly in the postfix/dovecot/amavis config files (all in /Library/Server/Mail/Config)

     

    Have you considered using plus addressing? Ultimately, its more flexible and would have you access to all of your special email addresses.

     

    joe+dropbox@domain.com

    joe+evernote@domain.com

    all of those would deliver to joe. +dropbox goes to a dropbox folder, +evernote to an evernote folder, and so on.

    It lets you create many unique addresses which are all acessible from on mailbox.

    Plus addressing does require that you enable it in master.cf

     

    Only you can decide if you require virtual domains for your mail... I try not to use them unless required.

     

    Jeff

  • 4. Re: How to setup multiple email accounts on OS X Server 10.8?
    drefinity Level 1 Level 1 (0 points)

    Hi Jeff,

     

    thanks again for all the input, much appriciated. I will have a read through the document to get an idea about how it works.

     

    I am not saying I want to use virtual domains, tbh I am looking for the best way and my current understanding of how I can do it with the possibilities is quite limited. I have not had much time yet spending with Email - Solutions so I am not drawn to any side yet. I prefer a solution that is easy to use and still scalable.

     

    I do like the sound of "plus addressing" and I will have a look at it as well. Is there a document or guide howto setup plus-addressing to give me an overview of what is needed?

     

    Thanks again,

    André

  • 5. Re: How to setup multiple email accounts on OS X Server 10.8?
    UptimeJeff Level 4 Level 4 (3,390 points)

    For ML Server, to enable plus addressing, edit:

     

    /Library/Server/Mail/Config/postfix/master.cf

     

     

    Find:

    # Dovecot
    #
    dovecot   unix  -       n       n       -       25      pipe
      flags=DRhu user=_dovecot:mail argv=/Applications/Server.app/Contents/ServerRoot/usr/libexec/dovecot/dovecot-lda -d ${user}
    # Use these settings to enable +addressing (user+mailbox@example.com)
    # flags=DRhu user=_dovecot:mail argv=/Applications/Server.app/Contents/ServerRoot/usr/libexec/dovecot/dovecot-lda -d ${user} -a ${recipient} -m ${extension}
    

     

    Change to:

    # Dovecot
    #
    dovecot   unix  -       n       n       -       25      pipe
    #  flags=DRhu user=_dovecot:mail argv=/Applications/Server.app/Contents/ServerRoot/usr/libexec/dovecot/dovecot-lda -d ${user}
    # Use these settings to enable +addressing (user+mailbox@example.com)
      flags=DRhu user=_dovecot:mail argv=/Applications/Server.app/Contents/ServerRoot/usr/libexec/dovecot/dovecot-lda -d ${user} -a ${recipient} -m ${extension}
    

     

    Note- you must have at least 1 space in front of 'flags' to denote it as an option of non-commented line above it (starting with dovecot).

     

    Then to active:

    sudo postfix reload
    

     

     

    Jeff

  • 6. Re: How to setup multiple email accounts on OS X Server 10.8?
    foofoodar Level 1 Level 1 (0 points)

    I am trying to setup 2 domain names, previously I just had the first domain name running and email server and everything worked great, since I applied this line

     

    sudo serveradmin settings mail:postfix:mydomain = "domain1.com, domain2.com"

     

    with my domain names in place I cannot send or recieve anything from either sever, when I try to telnet to test if port 25 is listening this is the response I get:

     

    mail. .com: nodename nor servname provided, or not known

     

    before with just one domain everytihng worked just fine, and if I remove the second domain name and take it back to one everything works again

     

    This is all running on OSX Server 10.8.3

     

    I have already tried restarting services and rebooting, but nothing is helping.

     

    Any ideas? Or am I just doing something completely wrong...

  • 7. Re: How to setup multiple email accounts on OS X Server 10.8?
    UptimeJeff Level 4 Level 4 (3,390 points)

    *** My Mistake ***

    I thought serveradmin would edit mydestinations properly but it doesn't.

     

    Do this to rerverse back to your working state

    sudo serveradmin settings "mail:postfix:mydomain = domain1.com"

     

    We'll use postconf to make this change

    Read current settings of my mydestination with:

    sudo postconf -c /Library/Server/Mail/Config/postfix/ mydestination
    

     

    Your results might look like:

    mydestination = $myhostname, localhost.$mydomain, $mydomain
    

     

    You'll want to add domain2 (notice the -e) to the end of the results from above and edit like so:

    sudo postconf -e -c /Library/Server/Mail/Config/postfix/ "mydestination = $myhostname, localhost.$mydomain, $mydomain, domain2.com"
    

     

     

    Then issue:

    sudo postfix reload
    

     

     

    That should do it

  • 8. Re: How to setup multiple email accounts on OS X Server 10.8?
    foofoodar Level 1 Level 1 (0 points)

    I tried the above steps but it is still giving me the same issues, everything works great until I edit mydestination with domain2.com, after I edited I went back and read the file and it shows

     

    mydestination = , localhost., , domain2.com

     

    I'm assuming it should look like this mydestination = $myhostname, localhost.$mydomain, $mydomain, domain2.com

     

    I do have my corrent domain in place but once again nothing is working and when I try to test the smtp port I get the same answer again

     

    mail. .com: nodename nor servname provided, or not known

     

    Any other thoughts? I don't think I'm doing anything wrong as I have reverted everything back and went through each step a couple more times with the same non-working end result.

  • 9. Re: How to setup multiple email accounts on OS X Server 10.8?
    foofoodar Level 1 Level 1 (0 points)

    I spoke too soon!

     

    Telnet is connecting to both mail servers, but this leads me to my next issue.

     

    Domain one I can send from, but when I reply back to it I get a bounce saying the message was blocked.

     

    Domain 2 I can also send from, but when I reply back I'm not getting a bounce or anything but it is still not coming through...any thoughts?

  • 10. Re: How to setup multiple email accounts on OS X Server 10.8?
    foofoodar Level 1 Level 1 (0 points)

    After a bit more work domain 2 was having a DNS issue with godaddy which is now fixed.

     

    Domain one is still bouncing saying relay access denied bc it was removed from mydestination and i'm not sure how to add it back with domain2 as well, and now doman 2 is bouncing e-mails saying

     

    Host or

    domain name not found. Name service error for name=server.com  ( I put server.com in instead of my actual name)

    type=AAAA: Host found but no data record of requested type

     

    I'm almost guessing this has something to do with my DNS server that I am running...

     

    Hopefully you can give me some ideas, as for now, I'll sleep on it.

     

    Thanks!

  • 11. Re: How to setup multiple email accounts on OS X Server 10.8?
    UptimeJeff Level 4 Level 4 (3,390 points)

    To help with DNS, I need to know your domain.. best thing is to post or send to me directly (contact info is in profile) the results of:

     

    sudo postconf -n  -c /Library/Server/Mail/Config/postfix/

  • 12. Re: How to setup multiple email accounts on OS X Server 10.8?
    foofoodar Level 1 Level 1 (0 points)

    E-mail sent, if you need anything else just reply back to it, and again thanks for all your help!

  • 13. Re: How to setup multiple email accounts on OS X Server 10.8?
    UptimeJeff Level 4 Level 4 (3,390 points)

    Assuming we just fixed the issue..the fix is to make sure that mydestination contains your domains.

     

    You can use postconf or edit main.cf directly.

     

    To edit direct:

    sudo pico /Library/Server/Mail/Config/postfix/main.cf
    

     

    scroll to bottom and find mydestination.

    It might look like this:

    mydestination = $myhostname, localhost.$mydomain, $mydomain
    

     

    $mydomain should already be set earlier in the file and would normally contain your primary domain (domain.com not mail.domain.com). So all you should need to do is add the secondary domain(s)

     

    Change to

     

    mydestination = $myhostname, localhost.$mydomain, $mydomain, seconddomain.com, thirddomain.com
    

     

    then restart postfix

    sudo postfix reload
    

     

     

    HTH

  • 14. Re: How to setup multiple email accounts on OS X Server 10.8?
    foofoodar Level 1 Level 1 (0 points)

    Thanks for all your help, this did get everything working,

1 2 Previous Next