Setting Up Mail Server and Vitual Hosting

James Wilkinson james at westexe.demon.co.uk
Tue Feb 8 13:48:00 UTC 2005


Troyston Campano wrote:
> I am setting up server running Fedora which have multiple domain names
> pointed to the IP address of my server. I'd like to set up a single mail
> server that can be used by each domain for mail (pop3 or imap I guess). I'd
> like to set it up so that each domain can have mail accounts for their
> individual domains.
> 
> I'm a complete newbie when it comes to setting up a mail server and even
> more so trying to figure out the multiple domain names with one mail server.
> For apache I use Name-Based Virtual Hosting to have one web server managing
> multiple domains/web sites. Not sure how to do this with a mail server.

Well, I've never done the multiple domains bit, but since no-one else
has given any advice...

 * Install Postfix. If you're not used to a mail server, this is as good
   as any (and arguably better than Sendmail)

 * Configure it for one site. For a simple site, all you have to do is
   work through /etc/postfix/main.cf, which is *thoroughly* commented.
   Ask if you don't understand anything.

   You should need to set myhostname (to something that will resolve in
   DNS if you want to send mail to Red Hat), possibly mydomain,
   mydestination, eventually inet_interfaces (it would be a *very* good
   idea to leave this at localhost until you're happy that the server is
   working properly!). soft_bounce is a good idea at first...

   You may need to set mynetworks. *PLEASE* be careful with this: don't
   include anything that might be used for sending spam...

 * Then edit /etc/aliases to point usernames to the right places.

 * Read a lot, experiment a lot, and be sure that no-one can use the
   mail server for anything they shouldn't be doing...

 * Once you've got that working, read
   /usr/share/doc/postfix-2.1.5/README_FILES/VIRTUAL_README
   which explains the bit extra for having multiple domains with
   different users in each.

You may find it easier to give users Unix usernames unrelated to their
e-mail addresses, so bob at example.com goes to user bob1, and
bob at example.net goes to user bob2. That's what the alias table is all
about.

Hopefully, all your users will be local, and you can jut set mynetworks
to relay outgoing e-mail from them. (Again, *please* be careful about
this!)

If you *need* to act as a mailhost for remote users, then you *will*
need to authenticate them. The SASL_README gives pointers.

Hope this helps,

James.
-- 
James Wilkinson       | "In these troubled times, it's always refreshing to
Exeter    Devon    UK | see a major company concentrating on vital issues.
E-mail address: james | It would be even more refreshing if Compaq tried it
@westexe.demon.co.uk  | for once."  -- The Inquirer




More information about the users mailing list