| 1 | <?xml version = '1.0' encoding = 'UTF-8'?> |
1 | <?xml version = '1.0' encoding = 'UTF-8'?> |
| 2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/virt-mail-howto.xml,v 1.21 2003/12/07 18:21:26 pylon Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/virt-mail-howto.xml,v 1.22 2003/12/11 02:51:40 klasikahl Exp $ --> |
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 4 | |
4 | |
| 5 | <guide link=" /doc/en/virt-mail-howto.xml" > |
5 | <guide link=" /doc/en/virt-mail-howto.xml" > |
| 6 | <title>Virtual Mailhosting System Guide</title> |
6 | <title>Virtual Mailhosting System Guide</title> |
| 7 | <author title="Author" > |
7 | <author title="Author" > |
| 8 | <mail link="antifa@gentoo.org" >Ken Nowack</mail> |
8 | <mail link="antifa@gentoo.org" >Ken Nowack</mail> |
| 9 | </author> |
9 | </author> |
| 10 | <author title="Author" > |
10 | <author title="Author" > |
| 11 | <mail link="ezra@revoltltd.org" >Ezra Gorman</mail> |
11 | <mail link="ezra@revoltltd.org" >Ezra Gorman</mail> |
| 12 | </author> |
12 | </author> |
|
|
13 | <author title="Editor"> |
|
|
14 | <mail link="klasikahl@gentoo.org" >Zack Gilburd</mail> |
|
|
15 | </author> |
| 13 | <abstract>This document details how to create a virtual mailhosting system based upon postfix, mysql, courier-imap, and cyrus-sasl. </abstract> |
16 | <abstract>This document details how to create a virtual mailhosting system based upon postfix, mysql, courier-imap, and cyrus-sasl. </abstract> |
| 14 | <version>1.0.6</version> |
17 | <version>1.0.7</version> |
| 15 | <date>December 7, 2003</date> |
18 | <date>December 10, 2003</date> |
| 16 | <!-- |
19 | <!-- |
| 17 | |
20 | |
| 18 | Contents |
21 | Contents |
| 19 | |
22 | |
| 20 | I. Introduction |
23 | I. Introduction |
| 21 | II. Postfix Basics |
24 | II. Postfix Basics |
| 22 | III. Courier-imap |
25 | III. Courier-imap |
| 23 | IV. Cyrus-sasl |
26 | IV. Cyrus-sasl |
| 24 | V. SSL Certificates for Postfix and Apache |
27 | V. SSL Certificates for Postfix and Apache |
| 25 | VI. Adding SSL and SASL support to Postfix |
28 | VI. Adding SSL and SASL support to Postfix |
| 26 | VII. MySQL |
29 | VII. MySQL |
| 27 | VIII. Apache and phpMyAdmin |
30 | VIII. Apache and phpMyAdmin |
| 28 | IX. The vmail user |
31 | IX. The vmail user |
| 29 | X. Configuring MySQL Authentication and vhosts |
32 | X. Configuring MySQL Authentication and vhosts |
| 30 | XI. Squirrelmail |
33 | XI. Squirrelmail |
| … | |
… | |
| 114 | # <i>/etc/init.d/courier-pop3d-ssl start</i> |
117 | # <i>/etc/init.d/courier-pop3d-ssl start</i> |
| 115 | </pre> |
118 | </pre> |
| 116 | <p>Start up your favorite mail client and verify that all connections you've started work for receiving and sending mail. Now that the basics work, we're going to do a whole bunch of stuff at once to get the rest of the system running. Again, please verify that what we've installed already works before progressing.</p> |
119 | <p>Start up your favorite mail client and verify that all connections you've started work for receiving and sending mail. Now that the basics work, we're going to do a whole bunch of stuff at once to get the rest of the system running. Again, please verify that what we've installed already works before progressing.</p> |
| 117 | </body> |
120 | </body> |
| 118 | </chapter> |
121 | </chapter> |
| 119 | <chapter> |
122 | <chapter> |
| 120 | <title>Cyrus-sasl</title> |
123 | <title>Cyrus-sasl</title> |
| 121 | <body> |
124 | <body> |
| 122 | <p>Next we're going to install cyrus-sasl. Sasl is going to play the role of actually passing your auth variables to pam, which will in turn pass that information to mysql for authentication of smtp users. For this howto, we'll not even try to verify that sasl is working until mysql is set up and contains a test user. Which is fine since we'll be authenticating against mysql in the end anyway.</p> |
125 | <p>Next we're going to install cyrus-sasl. Sasl is going to play the role of actually passing your auth variables to pam, which will in turn pass that information to mysql for authentication of smtp users. For this howto, we'll not even try to verify that sasl is working until mysql is set up and contains a test user. Which is fine since we'll be authenticating against mysql in the end anyway.</p> |
| 123 | <note>Now for some reason, sasl will not play nicely with pam against the shadow file. I banged my head against this problem for, well, a long time. If anyone knows why sasl will not auth against the shadow file in its current gentoo incarnation, please <mail link="ken@kickasskungfu.com" >email me</mail> as I'd love to hear a solution to this.</note> |
126 | <note>Now for some reason, sasl will not play nicely with pam against the shadow file. I banged my head against this problem for, well, a long time. If anyone knows why sasl will not auth against the shadow file in its current gentoo incarnation, please <mail link="ken@kickasskungfu.com" >email me</mail> as I'd love to hear a solution to this.</note> |
| 124 | <pre caption="Configuring and installing the cyrus-sasl ebuild" > |
127 | <pre caption="Configuring and installing the cyrus-sasl ebuild" > |
| 125 | # <i>USE='-ldap -mysql' emerge cyrus-sasl</i> |
128 | # <i>USE='-ldap -mysql' emerge cyrus-sasl</i> |
| 126 | <codenote>We don't have ldap and we're not using sasl's mysql capabilities </codenote> |
129 | <codenote>We don't have ldap and we're not using sasl's mysql capabilities </codenote> |
| 127 | <codenote>so we need to turn them off for this build.</codenote> |
130 | <codenote>so we need to turn them off for this build.</codenote> |
| 128 | </pre> |
131 | </pre> |
| 129 | <p>Next, edit <path>/usr/lib/sasl2/smtp.conf</path>.</p> |
132 | <p>Next, edit <path>/usr/lib/sasl2/smtpd.conf</path>.</p> |
| 130 | <pre caption="Starting sasl" > |
133 | <pre caption="Starting sasl" > |
| 131 | # <i>nano -w /usr/lib/sasl2/smtp.conf</i> |
134 | # <i>nano -w /usr/lib/sasl2/smtpd.conf</i> |
| 132 | pwcheck_method: saslauthd |
135 | pwcheck_method: saslauthd |
| 133 | mech_list: LOGIN PLAIN |
136 | mech_list: LOGIN PLAIN |
| 134 | <codenote>It's important to turn off auth mehtods we are not using.</codenote> |
137 | <codenote>It's important to turn off auth mehtods we are not using.</codenote> |
| 135 | <codenote>They cause problems for some mail clients.</codenote> |
138 | <codenote>They cause problems for some mail clients.</codenote> |
| 136 | # <i>/etc/init.d/saslauthd start</i> |
139 | # <i>/etc/init.d/saslauthd start</i> |
| 137 | </pre> |
140 | </pre> |
| 138 | </body> |
141 | </body> |
| 139 | </chapter> |
142 | </chapter> |
| 140 | <chapter> |
143 | <chapter> |
| 141 | <title>SSL Certs for Postfix and Apache</title> |
144 | <title>SSL Certs for Postfix and Apache</title> |
| 142 | <body> |
145 | <body> |
| 143 | <p>Next we're going to make a set of ssl certificates for postfix and apache.</p> |
146 | <p>Next we're going to make a set of ssl certificates for postfix and apache.</p> |
| 144 | <pre> |
147 | <pre> |
| 145 | # <i>cd /etc/ssl/</i> |
148 | # <i>cd /etc/ssl/</i> |
| 146 | # <i>nano -w openssl.cnf</i> |
149 | # <i>nano -w openssl.cnf</i> |