Setting up a mail server with Dovecot and/or Postfix with virtual domains
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Setting up a mail server with Dovecot and/or Postfix with virtual domains
I installed Postfix, and later realized Dovecot was already installed. I believe they are both running.. simultaneously.. yet I haven't had any problems. Odd.
You may have already noticed that this is the first time I've set up a mail server. It's actually the first time I've had to set up a dedicated server on my own from scratch (it's a web server + mail server + nameserver + FTP server). Anyway, so far so good. I have it set up in such a way that my Linux users are e-mail accounts, i.e. to create a new e-mail address, all I have to do is set up a new Linux user.
However, that only pertains to my main domain name. I also have a few other domain names hosted as virtual domains on this server. How can I create e-mail accounts that are "at" (@) the other domains? I have the nameserver section already complete (MX records are good), I just need to know how to create the e-mail addresses for these other domains.
I installed Postfix, and later realized Dovecot was already installed. I believe they are both running.. simultaneously.. yet I haven't had any problems. Odd.
What's odd about that? One's an MTA, the other an imap/pop server. They are meant to run together.
Start by reading http://www.postfix.org/VIRTUAL_README.html and decide how fancy you want to get (key thinking points will be number of domains, number of users in each, etc.)
What's odd about that? One's an MTA, the other an imap/pop server. They are meant to run together.
Start by reading http://www.postfix.org/VIRTUAL_README.html and decide how fancy you want to get (key thinking points will be number of domains, number of users in each, etc.)
Oh, I figured they were essentially the same thing.
Link isn't working at the moment; I'll have to check it later. But essentially, I have about three domains that need e-mail addresses, and I'll only need about.. five or less addresses on each.
See the example given in the link titled "Postfix virtual MAILBOX example: separate domains, non-UNIX accounts"
Code:
10 /etc/postfix/vmailbox:
11 info@example.com example.com/info
12 sales@example.com example.com/sales/
13 # Comment out the entry below to implement a catch-all.
14 # @example.com example.com/catchall
15 ...virtual mailboxes for more domains...
where info@example.com is a virtual email address and its mailbox is in $virtual_mailbox_base/example.com/info.
Note you can have virtual aliases and whatnot as well (they show an alias example on lines 17/18
Important note - you would create this file (vmailbox) with a text editor, but you must execute "postmap /etc/postfix/vmailbox" for postfix to be able to use it as specified. Ditto for the virtual alias file (anything you see referred to with has: in main.cfexcept the main alias file which requires you run newaliases).
I have now added the following code to the files indicated (without the numbers to the left and filenames, of course). I am trying to create the e-mail addresses EMAILREMOVED and EMAILREMOVED for the joshforde.com virtual domain, hosted on my server whose main domain name is seedsoftime.net
I then typed the commands "postfix reload", "postmap /etc/postfix/vmailbox", and "postmap /etc/postfix/virtual" as indicated in the guide.
Of course.. I am not yet able to log in with my e-mail client, which isn't surprising as I haven't yet seen any place in configuration files to enter passwords for the two e-mail addresses I tried to create. What else am I missing / Where do I enter passwords?
Last edited by Josh1billion; 11-25-2008 at 04:38 PM.
First, I'd take those emails out of your post in cash they get harvested.
Nothing I don't think (you probably needed to do the postmapping prior to the reload). Send a message to one of those accounts and see if anything gets created in the relevant mailbox (are you wanting Maildir format?)
Maildir is basically where each message is a file in itself, whereas mbox is one big file with all the messages one after the other. I think most people prefer maildir, since it's less open to corruption, faster to perform certain actions on (such as delting a message) etc.
Doesn't really matter. The "/" at the end of the location is the giveaway.
One thing though, maildir uses 3 directories for each account (cur, new and tmp). The delivery probably creates these for a new account on first delivery, but it's possible you will get an error and need to create these manually.
Did you get any mail delivered? If not, "tail /var/log/maillog"
Nothing really changed since my last couple of replies.. I can't figure out how to create an e-mail address for the virtual domain. :/ Most of the information in the above link is beyond my comprehension. I'm surprised I was able to set up a everything I did so far (nameserver, FTP, virtual domain hosting, etc.) on this machine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.