How to set up a mail server with multiple domains (12.04)












1















I'm the only user on my server, so the default install of postfix/dovecot has been fine until now. But I now have 4 domains and need an email address for each of them. I would like to be able to send/receive with them via pop3 with an email client.



I was following this decent guide until I got to the end and saw the note that it doesn't work in 12.04. I tried this "basic setup" guide which starts with the gem "I assume that you know what an MX record is." (Well no, that's why I need a guide.)



There are surprisingly few guides on how to do this. I understand the security risks; it's only me on the system. A non-flexible solution (where the email addresses are set in stone at the beginning) would even be ok with me, if it was simpler.










share|improve this question

























  • I understand what it is, just not what it should be. I set up my server's domain (A type) and subdomain (CNAME) so I do know how to set up a DNS record, if I know what I should be pointing it to.

    – felwithe
    Jul 5 '14 at 20:00











  • I'm in exactly the same situation. Do you remember what guide you finally followed, and if it all worked out for you could you please link to it here

    – thanks_in_advance
    Jul 21 '15 at 23:26











  • I never did, unfortunately.

    – felwithe
    Jul 22 '15 at 3:36
















1















I'm the only user on my server, so the default install of postfix/dovecot has been fine until now. But I now have 4 domains and need an email address for each of them. I would like to be able to send/receive with them via pop3 with an email client.



I was following this decent guide until I got to the end and saw the note that it doesn't work in 12.04. I tried this "basic setup" guide which starts with the gem "I assume that you know what an MX record is." (Well no, that's why I need a guide.)



There are surprisingly few guides on how to do this. I understand the security risks; it's only me on the system. A non-flexible solution (where the email addresses are set in stone at the beginning) would even be ok with me, if it was simpler.










share|improve this question

























  • I understand what it is, just not what it should be. I set up my server's domain (A type) and subdomain (CNAME) so I do know how to set up a DNS record, if I know what I should be pointing it to.

    – felwithe
    Jul 5 '14 at 20:00











  • I'm in exactly the same situation. Do you remember what guide you finally followed, and if it all worked out for you could you please link to it here

    – thanks_in_advance
    Jul 21 '15 at 23:26











  • I never did, unfortunately.

    – felwithe
    Jul 22 '15 at 3:36














1












1








1








I'm the only user on my server, so the default install of postfix/dovecot has been fine until now. But I now have 4 domains and need an email address for each of them. I would like to be able to send/receive with them via pop3 with an email client.



I was following this decent guide until I got to the end and saw the note that it doesn't work in 12.04. I tried this "basic setup" guide which starts with the gem "I assume that you know what an MX record is." (Well no, that's why I need a guide.)



There are surprisingly few guides on how to do this. I understand the security risks; it's only me on the system. A non-flexible solution (where the email addresses are set in stone at the beginning) would even be ok with me, if it was simpler.










share|improve this question
















I'm the only user on my server, so the default install of postfix/dovecot has been fine until now. But I now have 4 domains and need an email address for each of them. I would like to be able to send/receive with them via pop3 with an email client.



I was following this decent guide until I got to the end and saw the note that it doesn't work in 12.04. I tried this "basic setup" guide which starts with the gem "I assume that you know what an MX record is." (Well no, that's why I need a guide.)



There are surprisingly few guides on how to do this. I understand the security risks; it's only me on the system. A non-flexible solution (where the email addresses are set in stone at the beginning) would even be ok with me, if it was simpler.







12.04 email postfix dovecot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 5 '14 at 20:37







felwithe

















asked Jul 5 '14 at 19:56









felwithefelwithe

174414




174414













  • I understand what it is, just not what it should be. I set up my server's domain (A type) and subdomain (CNAME) so I do know how to set up a DNS record, if I know what I should be pointing it to.

    – felwithe
    Jul 5 '14 at 20:00











  • I'm in exactly the same situation. Do you remember what guide you finally followed, and if it all worked out for you could you please link to it here

    – thanks_in_advance
    Jul 21 '15 at 23:26











  • I never did, unfortunately.

    – felwithe
    Jul 22 '15 at 3:36



















  • I understand what it is, just not what it should be. I set up my server's domain (A type) and subdomain (CNAME) so I do know how to set up a DNS record, if I know what I should be pointing it to.

    – felwithe
    Jul 5 '14 at 20:00











  • I'm in exactly the same situation. Do you remember what guide you finally followed, and if it all worked out for you could you please link to it here

    – thanks_in_advance
    Jul 21 '15 at 23:26











  • I never did, unfortunately.

    – felwithe
    Jul 22 '15 at 3:36

















I understand what it is, just not what it should be. I set up my server's domain (A type) and subdomain (CNAME) so I do know how to set up a DNS record, if I know what I should be pointing it to.

– felwithe
Jul 5 '14 at 20:00





I understand what it is, just not what it should be. I set up my server's domain (A type) and subdomain (CNAME) so I do know how to set up a DNS record, if I know what I should be pointing it to.

– felwithe
Jul 5 '14 at 20:00













I'm in exactly the same situation. Do you remember what guide you finally followed, and if it all worked out for you could you please link to it here

– thanks_in_advance
Jul 21 '15 at 23:26





I'm in exactly the same situation. Do you remember what guide you finally followed, and if it all worked out for you could you please link to it here

– thanks_in_advance
Jul 21 '15 at 23:26













I never did, unfortunately.

– felwithe
Jul 22 '15 at 3:36





I never did, unfortunately.

– felwithe
Jul 22 '15 at 3:36










1 Answer
1






active

oldest

votes


















0














You can use Virtual Mailboxes which can be used for multiple domains and then it's also easier to add other mailboxes, aliases and other future domains.



I'm running several Ubuntu LTS 12.04 servers with this configuration using Postfix/Dovecot with IMAPS - you can use pop if you want.



If this is for an external (Internet facing server) then you need to create or point your DNS records MX to your server and add the relevant host entries to your server and Postfix configuration. You need to provide more specifics about your scenario and setup so we can help you further.



Here are some tutorial guides on a mailserver setup that may help you:
https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin
https://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/



That first guide you refer to with the section that states does not work with 12.04 and above is referring to dovecot.conf file. Here is a sample file that works with 12.04 and I believe 14.04 - you WILL want to modify it to suit your server especially if on the Internet and not just an internal server:



auth default {
mechanisms = plain cram-md5

user = root
socket listen {
client {
# The client socket is generally safe to export to everyone. Typical use
# is to export it to your SMTP server so it can do SMTP AUTH lookups
# using it.
path = /var/spool/postfix/private/dovecot-auth
mode = 0660
user = postfix
group = postfix
}
}
}


base_dir = /var/run/dovecot/
info_log_path = /var/log/dovecot.info
log_path = /var/log/dovecot
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/home/vmail/%d/%n

passdb {
args = /etc/dovecot/passwd
driver = passwd-file
}


protocols = imap pop3
service auth {
executable = /usr/lib/dovecot/auth
user = root
}
service imap-login {
chroot = login
executable = /usr/lib/dovecot/imap-login
user = dovecot
}
service imap {
executable = /usr/lib/dovecot/imap
}
service pop3-login {
chroot = login
executable = /usr/lib/dovecot/pop3-login
user = dovecot
}
service pop3 {
executable = /usr/lib/dovecot/pop3
}

service imaps {
executable = /usr/lib/dovecot/imap
}

service pop3s {
executable = /usr/lib/dovecot/pop3
}

ssl = yes
ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key

userdb {
args = /etc/dovecot/users
driver = passwd-file
}

valid_chroot_dirs = /var/spool/vmail
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f492107%2fhow-to-set-up-a-mail-server-with-multiple-domains-12-04%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can use Virtual Mailboxes which can be used for multiple domains and then it's also easier to add other mailboxes, aliases and other future domains.



    I'm running several Ubuntu LTS 12.04 servers with this configuration using Postfix/Dovecot with IMAPS - you can use pop if you want.



    If this is for an external (Internet facing server) then you need to create or point your DNS records MX to your server and add the relevant host entries to your server and Postfix configuration. You need to provide more specifics about your scenario and setup so we can help you further.



    Here are some tutorial guides on a mailserver setup that may help you:
    https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin
    https://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/



    That first guide you refer to with the section that states does not work with 12.04 and above is referring to dovecot.conf file. Here is a sample file that works with 12.04 and I believe 14.04 - you WILL want to modify it to suit your server especially if on the Internet and not just an internal server:



    auth default {
    mechanisms = plain cram-md5

    user = root
    socket listen {
    client {
    # The client socket is generally safe to export to everyone. Typical use
    # is to export it to your SMTP server so it can do SMTP AUTH lookups
    # using it.
    path = /var/spool/postfix/private/dovecot-auth
    mode = 0660
    user = postfix
    group = postfix
    }
    }
    }


    base_dir = /var/run/dovecot/
    info_log_path = /var/log/dovecot.info
    log_path = /var/log/dovecot
    log_timestamp = "%Y-%m-%d %H:%M:%S "
    mail_location = maildir:/home/vmail/%d/%n

    passdb {
    args = /etc/dovecot/passwd
    driver = passwd-file
    }


    protocols = imap pop3
    service auth {
    executable = /usr/lib/dovecot/auth
    user = root
    }
    service imap-login {
    chroot = login
    executable = /usr/lib/dovecot/imap-login
    user = dovecot
    }
    service imap {
    executable = /usr/lib/dovecot/imap
    }
    service pop3-login {
    chroot = login
    executable = /usr/lib/dovecot/pop3-login
    user = dovecot
    }
    service pop3 {
    executable = /usr/lib/dovecot/pop3
    }

    service imaps {
    executable = /usr/lib/dovecot/imap
    }

    service pop3s {
    executable = /usr/lib/dovecot/pop3
    }

    ssl = yes
    ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
    ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key

    userdb {
    args = /etc/dovecot/users
    driver = passwd-file
    }

    valid_chroot_dirs = /var/spool/vmail
    protocol pop3 {
    pop3_uidl_format = %08Xu%08Xv
    }





    share|improve this answer




























      0














      You can use Virtual Mailboxes which can be used for multiple domains and then it's also easier to add other mailboxes, aliases and other future domains.



      I'm running several Ubuntu LTS 12.04 servers with this configuration using Postfix/Dovecot with IMAPS - you can use pop if you want.



      If this is for an external (Internet facing server) then you need to create or point your DNS records MX to your server and add the relevant host entries to your server and Postfix configuration. You need to provide more specifics about your scenario and setup so we can help you further.



      Here are some tutorial guides on a mailserver setup that may help you:
      https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin
      https://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/



      That first guide you refer to with the section that states does not work with 12.04 and above is referring to dovecot.conf file. Here is a sample file that works with 12.04 and I believe 14.04 - you WILL want to modify it to suit your server especially if on the Internet and not just an internal server:



      auth default {
      mechanisms = plain cram-md5

      user = root
      socket listen {
      client {
      # The client socket is generally safe to export to everyone. Typical use
      # is to export it to your SMTP server so it can do SMTP AUTH lookups
      # using it.
      path = /var/spool/postfix/private/dovecot-auth
      mode = 0660
      user = postfix
      group = postfix
      }
      }
      }


      base_dir = /var/run/dovecot/
      info_log_path = /var/log/dovecot.info
      log_path = /var/log/dovecot
      log_timestamp = "%Y-%m-%d %H:%M:%S "
      mail_location = maildir:/home/vmail/%d/%n

      passdb {
      args = /etc/dovecot/passwd
      driver = passwd-file
      }


      protocols = imap pop3
      service auth {
      executable = /usr/lib/dovecot/auth
      user = root
      }
      service imap-login {
      chroot = login
      executable = /usr/lib/dovecot/imap-login
      user = dovecot
      }
      service imap {
      executable = /usr/lib/dovecot/imap
      }
      service pop3-login {
      chroot = login
      executable = /usr/lib/dovecot/pop3-login
      user = dovecot
      }
      service pop3 {
      executable = /usr/lib/dovecot/pop3
      }

      service imaps {
      executable = /usr/lib/dovecot/imap
      }

      service pop3s {
      executable = /usr/lib/dovecot/pop3
      }

      ssl = yes
      ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
      ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key

      userdb {
      args = /etc/dovecot/users
      driver = passwd-file
      }

      valid_chroot_dirs = /var/spool/vmail
      protocol pop3 {
      pop3_uidl_format = %08Xu%08Xv
      }





      share|improve this answer


























        0












        0








        0







        You can use Virtual Mailboxes which can be used for multiple domains and then it's also easier to add other mailboxes, aliases and other future domains.



        I'm running several Ubuntu LTS 12.04 servers with this configuration using Postfix/Dovecot with IMAPS - you can use pop if you want.



        If this is for an external (Internet facing server) then you need to create or point your DNS records MX to your server and add the relevant host entries to your server and Postfix configuration. You need to provide more specifics about your scenario and setup so we can help you further.



        Here are some tutorial guides on a mailserver setup that may help you:
        https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin
        https://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/



        That first guide you refer to with the section that states does not work with 12.04 and above is referring to dovecot.conf file. Here is a sample file that works with 12.04 and I believe 14.04 - you WILL want to modify it to suit your server especially if on the Internet and not just an internal server:



        auth default {
        mechanisms = plain cram-md5

        user = root
        socket listen {
        client {
        # The client socket is generally safe to export to everyone. Typical use
        # is to export it to your SMTP server so it can do SMTP AUTH lookups
        # using it.
        path = /var/spool/postfix/private/dovecot-auth
        mode = 0660
        user = postfix
        group = postfix
        }
        }
        }


        base_dir = /var/run/dovecot/
        info_log_path = /var/log/dovecot.info
        log_path = /var/log/dovecot
        log_timestamp = "%Y-%m-%d %H:%M:%S "
        mail_location = maildir:/home/vmail/%d/%n

        passdb {
        args = /etc/dovecot/passwd
        driver = passwd-file
        }


        protocols = imap pop3
        service auth {
        executable = /usr/lib/dovecot/auth
        user = root
        }
        service imap-login {
        chroot = login
        executable = /usr/lib/dovecot/imap-login
        user = dovecot
        }
        service imap {
        executable = /usr/lib/dovecot/imap
        }
        service pop3-login {
        chroot = login
        executable = /usr/lib/dovecot/pop3-login
        user = dovecot
        }
        service pop3 {
        executable = /usr/lib/dovecot/pop3
        }

        service imaps {
        executable = /usr/lib/dovecot/imap
        }

        service pop3s {
        executable = /usr/lib/dovecot/pop3
        }

        ssl = yes
        ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
        ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key

        userdb {
        args = /etc/dovecot/users
        driver = passwd-file
        }

        valid_chroot_dirs = /var/spool/vmail
        protocol pop3 {
        pop3_uidl_format = %08Xu%08Xv
        }





        share|improve this answer













        You can use Virtual Mailboxes which can be used for multiple domains and then it's also easier to add other mailboxes, aliases and other future domains.



        I'm running several Ubuntu LTS 12.04 servers with this configuration using Postfix/Dovecot with IMAPS - you can use pop if you want.



        If this is for an external (Internet facing server) then you need to create or point your DNS records MX to your server and add the relevant host entries to your server and Postfix configuration. You need to provide more specifics about your scenario and setup so we can help you further.



        Here are some tutorial guides on a mailserver setup that may help you:
        https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin
        https://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/



        That first guide you refer to with the section that states does not work with 12.04 and above is referring to dovecot.conf file. Here is a sample file that works with 12.04 and I believe 14.04 - you WILL want to modify it to suit your server especially if on the Internet and not just an internal server:



        auth default {
        mechanisms = plain cram-md5

        user = root
        socket listen {
        client {
        # The client socket is generally safe to export to everyone. Typical use
        # is to export it to your SMTP server so it can do SMTP AUTH lookups
        # using it.
        path = /var/spool/postfix/private/dovecot-auth
        mode = 0660
        user = postfix
        group = postfix
        }
        }
        }


        base_dir = /var/run/dovecot/
        info_log_path = /var/log/dovecot.info
        log_path = /var/log/dovecot
        log_timestamp = "%Y-%m-%d %H:%M:%S "
        mail_location = maildir:/home/vmail/%d/%n

        passdb {
        args = /etc/dovecot/passwd
        driver = passwd-file
        }


        protocols = imap pop3
        service auth {
        executable = /usr/lib/dovecot/auth
        user = root
        }
        service imap-login {
        chroot = login
        executable = /usr/lib/dovecot/imap-login
        user = dovecot
        }
        service imap {
        executable = /usr/lib/dovecot/imap
        }
        service pop3-login {
        chroot = login
        executable = /usr/lib/dovecot/pop3-login
        user = dovecot
        }
        service pop3 {
        executable = /usr/lib/dovecot/pop3
        }

        service imaps {
        executable = /usr/lib/dovecot/imap
        }

        service pop3s {
        executable = /usr/lib/dovecot/pop3
        }

        ssl = yes
        ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
        ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key

        userdb {
        args = /etc/dovecot/users
        driver = passwd-file
        }

        valid_chroot_dirs = /var/spool/vmail
        protocol pop3 {
        pop3_uidl_format = %08Xu%08Xv
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 25 '14 at 2:58









        Keith PawsonKeith Pawson

        515




        515






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f492107%2fhow-to-set-up-a-mail-server-with-multiple-domains-12-04%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido