/[gentoo]/xml/htdocs/doc/en/virt-mail-howto.xml
Gentoo

Diff of /xml/htdocs/doc/en/virt-mail-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.16 Revision 1.17
1<?xml version = '1.0' encoding = 'UTF-8'?> 1<?xml version = '1.0' encoding = 'UTF-8'?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 3
4<guide link=" /doc/en/virt-mail-howto.xml" > 4<guide link=" /doc/en/virt-mail-howto.xml" >
5<title>Virtual Mailhosting System Guide</title> 5<title>Virtual Mailhosting System Guide</title>
6<author title="Author" > 6<author title="Author" >
7<mail link="antifa@gentoo.org" >Ken Nowack</mail> 7<mail link="antifa@gentoo.org" >Ken Nowack</mail>
8</author> 8</author>
9<author title="Author" > 9<author title="Author" >
10<mail link="ezra@revoltltd.org" >Ezra Gorman</mail> 10<mail link="ezra@revoltltd.org" >Ezra Gorman</mail>
11</author> 11</author>
12<abstract>This document details how to create a virtual mailhosting system based upon postfix, mysql, courier-imap, and cyrus-sasl. </abstract> 12<abstract>This document details how to create a virtual mailhosting system based upon postfix, mysql, courier-imap, and cyrus-sasl. </abstract>
13<version>1.0.2</version> 13<version>1.0.3</version>
14<date>7 Aug 2003</date> 14<date>October 23, 2003</date>
15<!-- 15<!--
16 16
17Contents 17Contents
18 18
19I. Introduction 19I. Introduction
20II. Postfix Basics 20II. Postfix Basics
21III. Courier-imap 21III. Courier-imap
22IV. Cyrus-sasl 22IV. Cyrus-sasl
23V. SSL Certificates for Postfix and Apache 23V. SSL Certificates for Postfix and Apache
24VI. Adding SSL and SASL support to Postfix 24VI. Adding SSL and SASL support to Postfix
25VII. MySQL 25VII. MySQL
26VIII. Apache and phpMyAdmin 26VIII. Apache and phpMyAdmin
27IX. The vmail user 27IX. The vmail user
28X. Configuring MySQL Authentication and vhosts 28X. Configuring MySQL Authentication and vhosts
29XI. Squirrelmail 29XI. Squirrelmail
30XII. Mailman 30XII. Mailman
31XIII. Content Filtering and Anti-Virus 31XIII. Content Filtering and Anti-Virus
32XIV. Wrap Up 32XIV. Wrap Up
33XV. Troubleshooting 33XV. Troubleshooting
34 34
35--><chapter> 35--><chapter>
36<title>Introduction</title> 36<title>Introduction</title>
37<body> 37<body>
38<p>For most gentoo users, a simple mail client and fetchmail will do. However, if you're hosting a domain with your system, you'll need a full blown MTA (Mail Transfer Agent). And if you're hosting multiple domains, then you'll definitely need something more robust to handle all of the email for your users. This system was designed to be an elegant solution to that problem.</p> 38<p>For most gentoo users, a simple mail client and fetchmail will do. However, if you're hosting a domain with your system, you'll need a full blown MTA (Mail Transfer Agent). And if you're hosting multiple domains, then you'll definitely need something more robust to handle all of the email for your users. This system was designed to be an elegant solution to that problem.</p>
39<p>A virtual mail system needs to be able to handle email for numerous domains with multiple users over a variety of interfaces. This presents some issues that must be dealt with. For instance, what if you have two users on different domains that want the same user name? If you are providing imap access and smtp-auth, how do combine the various authentication daemons into a single system? How do you provide security for the numerous components that comprise the system? How do you manage it all?</p> 39<p>A virtual mail system needs to be able to handle email for numerous domains with multiple users over a variety of interfaces. This presents some issues that must be dealt with. For instance, what if you have two users on different domains that want the same user name? If you are providing imap access and smtp-auth, how do combine the various authentication daemons into a single system? How do you provide security for the numerous components that comprise the system? How do you manage it all?</p>
40<p>This howto will show you how to set up with a mail system capable of handling mail for as many domains as your hardware can handle, supports virtual mail users that don't require shell accounts, has domain specific user names, can authenticate web, imap, smtp, and pop3 clients against a single database, utilizes ssl for transport layer security, has a web interface, can handle mailing lists for any domain on the machine, and is controlled by a nice, central and easy mysql database. </p> 40<p>This howto will show you how to set up with a mail system capable of handling mail for as many domains as your hardware can handle, supports virtual mail users that don't require shell accounts, has domain specific user names, can authenticate web, imap, smtp, and pop3 clients against a single database, utilizes ssl for transport layer security, has a web interface, can handle mailing lists for any domain on the machine, and is controlled by a nice, central and easy mysql database. </p>
41<p>There are quite a variety of ways to go about setting up a virtual mailhosting system. With so may options, another may be the best choice for your specific needs. Consider investigating <uri>http://www.qmail.org/</uri> and <uri>http://www.exim.org/</uri> to explore your options. </p> 41<p>There are quite a variety of ways to go about setting up a virtual mailhosting system. With so may options, another may be the best choice for your specific needs. Consider investigating <uri>http://www.qmail.org/</uri> and <uri>http://www.exim.org/</uri> to explore your options. </p>
42<p>The following packages are used in this setup: 42<p>The following packages are used in this setup:
43 43
44 apache, courier-imap, pam_mysql, postfix, mod_php, mod_ssl, phpmyadmin, squirrelmail, cyrus-sasl, mysql, php, and mailman.</p> 44 apache, courier-imap, pam_mysql, postfix, mod_php, phpmyadmin, squirrelmail, cyrus-sasl, mysql, php, and mailman.</p>
45<p>Make sure to turn on the following USE variables in <path>/etc/make.conf</path> before compiling the packages: <c>USE=&quot;mysql imap libwww maildir sasl ssl&quot;</c>. Otherwise you will most likely have to recompile things to get the support you need for all the protocols. Further, it's a good idea to turn off any other mail and network variables, like ipv6.</p> 45<p>Make sure to turn on the following USE variables in <path>/etc/make.conf</path> before compiling the packages: <c>USE=&quot;mysql imap libwww maildir sasl ssl&quot;</c>. Otherwise you will most likely have to recompile things to get the support you need for all the protocols. Further, it's a good idea to turn off any other mail and network variables, like ipv6.</p>
46<impo>This howto was written for postfix-2.0.x. If you are using postfix &lt; 2 some of the variables in this document will be different. It is recommended that you upgrade. Some other packages included in this howto are version sensitive as well. You are advised to read the documentation included with packages if you run into issues with this.</impo> 46<impo>This howto was written for postfix-2.0.x. If you are using postfix &lt; 2 some of the variables in this document will be different. It is recommended that you upgrade. Some other packages included in this howto are version sensitive as well. You are advised to read the documentation included with packages if you run into issues with this.</impo>
47<impo>This document uses apache-1.3.x. Apache-2 has been marked stable in portage. However there are still a number of issues with php integration. Until php support in apache-2.0.x is marked stable, this guide will continue to use the 1.3.x version.</impo> 47<impo>This document uses apache-1.3.x. Apache-2 has been marked stable in portage. However there are still a number of issues with php integration. Until php support in apache-2.0.x is marked stable, this guide will continue to use the 1.3.x version.</impo>
48<impo>You need a domain name to run a public mail server, or at least an MX record for a domain. Ideally you would have control of at least two domains to take advantage of your new virtual domain functionality.</impo> 48<impo>You need a domain name to run a public mail server, or at least an MX record for a domain. Ideally you would have control of at least two domains to take advantage of your new virtual domain functionality.</impo>
49<impo>Make sure <path>/etc/hostname</path> is set to the right hostname for your mail server. Verify your hostname is set correctly with <c>hostname</c>. Also verify that there are no conflicting entries in <path>/etc/hosts</path>.</impo> 49<impo>Make sure <path>/etc/hostname</path> is set to the right hostname for your mail server. Verify your hostname is set correctly with <c>hostname</c>. Also verify that there are no conflicting entries in <path>/etc/hosts</path>.</impo>
50<note>It is recommended that you read this entire document and familiarize yourself with all the steps before attempting the install. If you run into problems with any of the steps, check the troubleshooting guide at the end of this document. Also, not all the referenced packages are necessary, this set up is very flexible. For instance, if you do not desire a web interface, feel free to skip the squirrelmail section.</note> 50<note>It is recommended that you read this entire document and familiarize yourself with all the steps before attempting the install. If you run into problems with any of the steps, check the troubleshooting guide at the end of this document. Also, not all the referenced packages are necessary, this set up is very flexible. For instance, if you do not desire a web interface, feel free to skip the squirrelmail section.</note>
51</body> 51</body>
52</chapter> 52</chapter>
53<chapter> 53<chapter>
54<title>Postfix Basics</title> 54<title>Postfix Basics</title>
55<body> 55<body>
56<pre caption="Install postfix" ># <i>emerge postfix</i> 56<pre caption="Install postfix" ># <i>emerge postfix</i>
57</pre> 57</pre>
58<warn>Verify that you have not installed any other MTA, such as ssmtp, exim, or qmail, or you will surely have BIG problems.</warn> 58<warn>Verify that you have not installed any other MTA, such as ssmtp, exim, or qmail, or you will surely have BIG problems.</warn>
59<p>After postfix is installed, it's time to configure it. Change the following options in <path>/etc/postfix/main.cf</path>:</p> 59<p>After postfix is installed, it's time to configure it. Change the following options in <path>/etc/postfix/main.cf</path>:</p>
305id domain destination 305id domain destination
3061 bar.com local: 3061 bar.com local:
3072 virt-bar.org virtual: 3072 virt-bar.org virtual:
308</pre> 308</pre>
309<pre caption="virtual table sample" > 309<pre caption="virtual table sample" >
310id email destination 310id email destination
3113 root@virt-bar.org other@email.address 3113 root@virt-bar.org other@email.address
312</pre> 312</pre>
313</body> 313</body>
314</chapter> 314</chapter>
315<chapter> 315<chapter>
316<title>Apache and phpMyAdmin</title> 316<title>Apache and phpMyAdmin</title>
317<body> 317<body>
318<p>Next we'll set up apache and add an interface to interact with the database more easily. </p> 318<p>Next we'll set up apache and add an interface to interact with the database more easily. </p>
319<pre caption="Setting up apache and phpmyadmin" > 319<pre caption="Setting up apache and phpmyadmin" >
320# <i>emerge apache mod_php mod_ssl phpmyadmin</i> 320# <i>emerge apache mod_php phpmyadmin</i>
321</pre> 321</pre>
322<p>There are plenty of guides out there about how to set up apache with php. Like this one: <uri>http://www.linuxguruz.org/z.php?id=31</uri>. There are also numerous posts on <uri>http://forums.gentoo.org</uri> detailing how to solve problems with the installation (search for 'apache php'). So, that said, I'm not going to cover it here. Set up the apache and php installs, then continue with this howto. Now, a word for the wise: .htaccess the directory that you put phpmyadmin in. If you do not do this, search engine spiders will come along and index the page which in turn will mean that anyone will be able to find your phpmyadmin page via google and in turn be able to come change your database however they want which is <e>BAD!</e> There are many howtos on this including: <uri>http://docs.csoft.net/micro/black-htaccess.html</uri>.</p> 322<p>There are plenty of guides out there about how to set up apache with php. Like this one: <uri>http://www.linuxguruz.org/z.php?id=31</uri>. There are also numerous posts on <uri>http://forums.gentoo.org</uri> detailing how to solve problems with the installation (search for 'apache php'). So, that said, I'm not going to cover it here. Set up the apache and php installs, then continue with this howto. Now, a word for the wise: .htaccess the directory that you put phpmyadmin in. If you do not do this, search engine spiders will come along and index the page which in turn will mean that anyone will be able to find your phpmyadmin page via google and in turn be able to come change your database however they want which is <e>BAD!</e> There are many howtos on this including: <uri>http://docs.csoft.net/micro/black-htaccess.html</uri>.</p>
323<p>Now we're going to install the Apache certificates we made previously. The Apache-SSL directives that you need to use the resulting cert are: 323<p>Now we're going to install the Apache certificates we made previously. The Apache-SSL directives that you need to use the resulting cert are:
324 <ul> 324 <ul>
325<li>SSLCertificateFile /path/to/certs/new.cert.cert</li> 325<li>SSLCertificateFile /path/to/certs/new.cert.cert</li>
326<li>SSLCertificateKeyFile /path/to/certs/new.cert.key</li> 326<li>SSLCertificateKeyFile /path/to/certs/new.cert.key</li>
327</ul> 327</ul>
328</p> 328</p>
329<pre caption="Install Apache SSL certificates" > 329<pre caption="Install Apache SSL certificates" >
330# <i>cp /etc/ssl/misc/new.cert.cert /etc/apache/conf/ssl/</i> 330# <i>cp /etc/ssl/misc/new.cert.cert /etc/apache/conf/ssl/</i>
331# <i>cp /etc/ssl/misc/new.cert.key /etc/apache/conf/ssl/</i> 331# <i>cp /etc/ssl/misc/new.cert.key /etc/apache/conf/ssl/</i>
332# <i>nano -w /etc/apache/conf/vhosts/ssl.default-vhost.conf</i> 332# <i>nano -w /etc/apache/conf/vhosts/ssl.default-vhost.conf</i>
333<codenote>Change the following parameters</codenote> 333<codenote>Change the following parameters</codenote>
334 334
335ServerName host.domain.name 335ServerName host.domain.name

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20