1

Let's assume I know nothing about mailservers or Linux/Ubuntu.

I want to set up a mail server that will easily allow me to add emails with different domains and connect with various email clients via pop/imap.

What is the best way to set this up? I believe I have postfix running, but that's as much as I know. :/ I'm a noob at this. :)

1 Answer 1

1

Postfix will allow you to deliver emails to different domains, and to send emails. You should install something like Dovecot or Courier to handle the pop/IMAP.

Read the Ubuntu documentation for postfix here. Important things to pay attention to are the type of inbox (maildir vs mbox) and your authentication (Dovecot SASL vs Cyrus SASL; flat file vs sql db).

You'll want to use the Postfix virtual mailbox delivery agent to deliver mail from separate domains to non-system accounts. Here is an example configuration to add to your main.cf file (/etc/postfix/main.cf) for the domain "example.com":

virtual_mailbox_domains = example.com ...more domains...
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_alias_maps = hash:/etc/postfix/virtual

In the third line there's virtual_mailbox_maps =. This is the file that holds the mapping between the email address and where the email is stored. You'll need to add the following to your vmailbox file (/etc/postfix/vmailbox):

[email protected] example.com/info
[email protected] example.com/sales/
# Comment out the entry below to implement a catch-all.
# @example.com example.com/catchall
...virtual mailboxes for more domains...

In the seventh line of main.cf there's a line with virtual_alias_maps = that maps the alias names you might use. Add the following to your virtual file (/etc/postfix/virtual):

[email protected] postmaster

4
  • I'm having a hard time understanding how to add emails and such. Jun 14, 2011 at 19:55
  • There's a lot to learn in running your own email server. You should read the documentation and then come back and ask your specific questions. I don't use a GUI for postfix, so I don't know how much use I can be there. I've edited my answer to provide an example of virtual mailboxes so that you don't have to map each email address to a system user. That should help guide you.
    – Chris Ting
    Jun 14, 2011 at 20:16
  • Would it be a good idea to use a GUI and if so what are some good ones? (Helpful edit) Jun 14, 2011 at 20:19
  • A GUI would be helpful to teach you most of what goes into a Postfix setup. At some point, you'll learn to do this through the configuration files for maximum control. Go here for a list of useful GUI tools: debianhelp.co.uk/postfixweb.htm
    – Chris Ting
    Jun 14, 2011 at 20:26

Not the answer you're looking for? Browse other questions tagged .