LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-23-2008, 12:32 AM   #1
Josh1billion
Member
 
Registered: Sep 2005
Location: WI
Distribution: Fedora Core 9
Posts: 36

Rep: Reputation: 15
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.
 
Old 11-23-2008, 01:03 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by Josh1billion View Post
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.)
 
Old 11-23-2008, 03:35 AM   #3
Josh1billion
Member
 
Registered: Sep 2005
Location: WI
Distribution: Fedora Core 9
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday View Post
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.
 
Old 11-25-2008, 03:04 PM   #4
Josh1billion
Member
 
Registered: Sep 2005
Location: WI
Distribution: Fedora Core 9
Posts: 36

Original Poster
Rep: Reputation: 15
I took a look at that link and set up Postfix so that it recognizes my virtual domains (i.e. it will no longer reject e-mails sent to those domains).

But how do I now create e-mail addresses under those virtual domains?
 
Old 11-25-2008, 03:22 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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).
 
Old 11-25-2008, 04:13 PM   #6
Josh1billion
Member
 
Registered: Sep 2005
Location: WI
Distribution: Fedora Core 9
Posts: 36

Original Poster
Rep: Reputation: 15
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

Code:
     1 /etc/postfix/main.cf:
     2     virtual_mailbox_domains = joshforde.com
     3     virtual_mailbox_base = /var/mail/vhosts
     4     virtual_mailbox_maps = hash:/etc/postfix/vmailbox
     5     virtual_minimum_uid = 100
     6     virtual_uid_maps = static:5000
     7     virtual_gid_maps = static:5000
     8     virtual_alias_maps = hash:/etc/postfix/virtual
     9 
    10 /etc/postfix/vmailbox:
    11     EMAILREMOVED joshforde.com/admin/
    12     EMAILREMOVED joshforde.com/josh/
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.
 
Old 11-25-2008, 04:17 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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?)
 
Old 11-25-2008, 04:39 PM   #8
Josh1billion
Member
 
Registered: Sep 2005
Location: WI
Distribution: Fedora Core 9
Posts: 36

Original Poster
Rep: Reputation: 15
Thanks for the heads-up, I forgot about e-mail harvesting for a minute.

Quote:
Originally Posted by billymayday View Post
Send a message to one of those accounts and see if anything gets created in the relevant mailbox (are you wanting Maildir format?)
What is Maildir format?

EDIT:

I tried sending a test e-mail to the address, and it didn't work. Here's the message shown in Mozilla Thunderbird:

http://i35.tinypic.com/20fpbtz.png

Last edited by Josh1billion; 11-25-2008 at 04:45 PM.
 
Old 11-25-2008, 04:48 PM   #9
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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"
 
Old 11-26-2008, 08:32 PM   #10
Josh1billion
Member
 
Registered: Sep 2005
Location: WI
Distribution: Fedora Core 9
Posts: 36

Original Poster
Rep: Reputation: 15
...

This is all going over my head. >_< Server configuration is definitely not my thing.
 
Old 11-26-2008, 08:50 PM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Doesn't really matter - leave it as is.


How's it going otherwise?
 
Old 11-27-2008, 02:36 AM   #12
Josh1billion
Member
 
Registered: Sep 2005
Location: WI
Distribution: Fedora Core 9
Posts: 36

Original Poster
Rep: Reputation: 15
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.
 
Old 11-27-2008, 02:57 AM   #13
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you be specific? The example given seems pretty clear to me.

Rgds

BM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setup Mail Server with Postfix/Dovecot/SquirrelMail olddocks Linux - Server 2 03-24-2009 01:34 AM
LXer: Debian Mail Server Setup with Postfix + Dovecot + SASL + Squirrel Mail LXer Syndicated Linux News 0 03-12-2008 10:50 PM
How to configure procmail on postfix mail server using virtual domains? omar1984 Linux - Server 0 01-05-2007 05:55 AM
help setting up a pop3 server for virtual domains using qmail kumarsundaram Linux - Software 0 01-23-2006 07:06 PM
No Incoming postfix mail, virtual domains geokker Linux - Software 0 06-22-2004 06:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration