| 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.35 2004/11/02 10:50:22 swift Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/virt-mail-howto.xml,v 1.36 2004/11/08 10:12:54 swift 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 with Postfix Guide</title> |
6 | <title>Virtual Mailhosting System with Postfix 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"> |
13 | <author title="Editor"> |
| 14 | <mail link="klasikahl@gentoo.org" >Zack Gilburd</mail> |
14 | <mail link="klasikahl@gentoo.org" >Zack Gilburd</mail> |
| 15 | </author> |
15 | </author> |
| 16 | <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> |
| 17 | <version>1.0.13</version> |
17 | <version>1.0.14</version> |
| 18 | <date>November 02, 2004</date> |
18 | <date>November 08, 2004</date> |
| 19 | <!-- |
19 | <!-- |
| 20 | |
20 | |
| 21 | Contents |
21 | Contents |
| 22 | |
22 | |
| 23 | I. Introduction |
23 | I. Introduction |
| 24 | II. Postfix Basics |
24 | II. Postfix Basics |
| 25 | III. Courier-imap |
25 | III. Courier-imap |
| 26 | IV. Cyrus-sasl |
26 | IV. Cyrus-sasl |
| 27 | V. SSL Certificates for Postfix and Apache |
27 | V. SSL Certificates for Postfix and Apache |
| 28 | VI. Adding SSL and SASL support to Postfix |
28 | VI. Adding SSL and SASL support to Postfix |
| 29 | VII. MySQL |
29 | VII. MySQL |
| 30 | VIII. Apache and phpMyAdmin |
30 | VIII. Apache and phpMyAdmin |
| 31 | IX. The vmail user |
31 | IX. The vmail user |
| 32 | X. Configuring MySQL Authentication and vhosts |
32 | X. Configuring MySQL Authentication and vhosts |
| 33 | XI. Squirrelmail |
33 | XI. Squirrelmail |
| … | |
… | |
| 121 | # <i>/etc/init.d/courier-imapd-ssl start</i> |
121 | # <i>/etc/init.d/courier-imapd-ssl start</i> |
| 122 | # <i>/etc/init.d/courier-pop3d start</i> |
122 | # <i>/etc/init.d/courier-pop3d start</i> |
| 123 | # <i>/etc/init.d/courier-pop3d-ssl start</i> |
123 | # <i>/etc/init.d/courier-pop3d-ssl start</i> |
| 124 | </pre> |
124 | </pre> |
| 125 | <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> |
125 | <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> |
| 126 | </body> |
126 | </body> |
| 127 | </section> |
127 | </section> |
| 128 | </chapter> |
128 | </chapter> |
| 129 | <chapter> |
129 | <chapter> |
| 130 | <title>Cyrus-sasl</title> |
130 | <title>Cyrus-sasl</title> |
| 131 | <section> |
131 | <section> |
| 132 | <body> |
132 | <body> |
| 133 | <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> |
133 | <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> |
| 134 | <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> |
134 | <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> |
| 135 | <pre caption="Configuring and installing the cyrus-sasl ebuild" > |
135 | <pre caption="Configuring and installing the cyrus-sasl ebuild" > |
| 136 | # <i>USE='-ldap -mysql' emerge cyrus-sasl</i> |
|
|
| 137 | <codenote>We don't have ldap and we're not using sasl's mysql capabilities </codenote> |
136 | <comment>(We don't have ldap and we're using sasl's mysql capabilities |
| 138 | <codenote>so we need to turn them off for this build.</codenote> |
137 | so we need to set the appropriate USE flags, but only if your USE flags |
|
|
138 | doesn't already contain the mysql USE flag and not the ldap one)</comment> |
|
|
139 | # <i>mkdir /etc/portage</i> |
|
|
140 | # <i>echo "dev-libs/cyrus-sasl -ldap mysql" >> /etc/portage/package.use</i> |
|
|
141 | # <i>emerge cyrus-sasl</i> |
| 139 | </pre> |
142 | </pre> |
| 140 | <p>Next, edit <path>/etc/sasl2/smtpd.conf</path>.</p> |
143 | <p>Next, edit <path>/etc/sasl2/smtpd.conf</path>.</p> |
| 141 | <pre caption="Starting sasl" > |
144 | <pre caption="Starting sasl" > |
| 142 | # <i>nano -w /etc/sasl2/smtpd.conf</i> |
145 | # <i>nano -w /etc/sasl2/smtpd.conf</i> |
| 143 | pwcheck_method: auxprop |
146 | pwcheck_method: auxprop |
| 144 | auxprop_plugin: sql |
147 | auxprop_plugin: sql |
| 145 | sql_engine: mysql |
148 | sql_engine: mysql |
| 146 | sql_hostnames: localhost |
149 | sql_hostnames: localhost |
| 147 | sql_user: mailsql |
150 | sql_user: mailsql |
| 148 | sql_passwd: <comment><password></comment> |
151 | sql_passwd: <comment><password></comment> |
| 149 | sql_database: mailsql |
152 | sql_database: mailsql |
| 150 | sql_select: select clear from users where email = '%u@%r' |
153 | sql_select: select clear from users where email = '%u@%r' |
| 151 | mech_list: plain login |
154 | mech_list: plain login |
| 152 | pwcheck_method: saslauthd |
155 | pwcheck_method: saslauthd |
| 153 | mech_list: LOGIN PLAIN |
156 | mech_list: LOGIN PLAIN |