Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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. :)

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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):

info@example.com example.com/info
sales@example.com 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):

postmaster@example.com postmaster

share|improve this answer
    
I'm having a hard time understanding how to add emails and such. –  Kevin Brown Jun 14 '11 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 '11 at 20:16
    
Would it be a good idea to use a GUI and if so what are some good ones? (Helpful edit) –  Kevin Brown Jun 14 '11 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 '11 at 20:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.