| 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.50 2006/04/09 07:42:45 fox2mike Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/virt-mail-howto.xml,v 1.53 2006/09/04 08:49:44 nightmorph 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 | |
7 | |
| … | |
… | |
| 21 | <abstract> |
21 | <abstract> |
| 22 | This document details how to create a virtual mailhosting system based upon |
22 | This document details how to create a virtual mailhosting system based upon |
| 23 | postfix, mysql, courier-imap, and cyrus-sasl. |
23 | postfix, mysql, courier-imap, and cyrus-sasl. |
| 24 | </abstract> |
24 | </abstract> |
| 25 | |
25 | |
| 26 | <version>1.0.27</version> |
26 | <version>1.2</version> |
| 27 | <date>2006-04-09</date> |
27 | <date>2006-09-04</date> |
| 28 | |
28 | |
| 29 | <!-- |
29 | <!-- |
| 30 | Contents |
30 | Contents |
| 31 | |
31 | |
| 32 | I. Introduction |
32 | I. Introduction |
| … | |
… | |
| 50 | <title>Introduction</title> |
50 | <title>Introduction</title> |
| 51 | <section> |
51 | <section> |
| 52 | <body> |
52 | <body> |
| 53 | |
53 | |
| 54 | <p> |
54 | <p> |
| 55 | For most gentoo users, a simple mail client and fetchmail will do. However, if |
55 | For most Gentoo users, a simple mail client and fetchmail will do. However, if |
| 56 | you're hosting a domain with your system, you'll need a full blown MTA (Mail |
56 | you're hosting a domain with your system, you'll need a full blown MTA (Mail |
| 57 | Transfer Agent). And if you're hosting multiple domains, then you'll definitely |
57 | Transfer Agent). And if you're hosting multiple domains, then you'll definitely |
| 58 | need something more robust to handle all of the email for your users. This |
58 | need something more robust to handle all of the email for your users. This |
| 59 | system was designed to be an elegant solution to that problem. |
59 | system was designed to be an elegant solution to that problem. |
| 60 | </p> |
60 | </p> |
| … | |
… | |
| 120 | for a domain. Ideally you would have control of at least two domains to take |
120 | for a domain. Ideally you would have control of at least two domains to take |
| 121 | advantage of your new virtual domain functionality. |
121 | advantage of your new virtual domain functionality. |
| 122 | </impo> |
122 | </impo> |
| 123 | |
123 | |
| 124 | <impo> |
124 | <impo> |
| 125 | Make sure <path>/etc/hostname</path> is set to the right hostname for your mail |
125 | Make sure <path>/etc/conf.d/hostname</path> is set to the right hostname for |
| 126 | server. Verify your hostname is set correctly with <c>hostname</c>. Also |
126 | your mail server. You can apply any changes you make to this file by running |
| 127 | verify that there are no conflicting entries in <path>/etc/hosts</path>. |
127 | <c>/etc/init.d/hostname restart</c>. Verify your hostname is set correctly with |
|
|
128 | <c>hostname</c>. Also verify that there are no conflicting entries in |
|
|
129 | <path>/etc/hosts</path>. |
| 128 | </impo> |
130 | </impo> |
| 129 | |
131 | |
| 130 | <note> |
132 | <note> |
| 131 | It is recommended that you read this entire document and familiarize yourself |
133 | It is recommended that you read this entire document and familiarize yourself |
| 132 | with all the steps before attempting the install. If you run into problems with |
134 | with all the steps before attempting the install. If you run into problems with |
| … | |
… | |
| 154 | qmail, or you will surely have BIG problems. |
156 | qmail, or you will surely have BIG problems. |
| 155 | </warn> |
157 | </warn> |
| 156 | |
158 | |
| 157 | <p> |
159 | <p> |
| 158 | After postfix is installed, it's time to configure it. Change the following |
160 | After postfix is installed, it's time to configure it. Change the following |
| 159 | options in <path>/etc/postfix/main.cf</path>: |
161 | options in <path>/etc/postfix/main.cf</path>. Remember to replace |
|
|
162 | <c>$variables</c> with your own names. |
| 160 | </p> |
163 | </p> |
| 161 | |
164 | |
| 162 | <pre caption="/etc/postfix/main.cf"> |
165 | <pre caption="/etc/postfix/main.cf"> |
| 163 | myhostname = $host.domain.name |
166 | myhostname = $host.domain.name |
| 164 | mydomain = $domain.name |
167 | mydomain = $domain.name |
| … | |
… | |
| 541 | # <i>emerge apache mod_php phpmyadmin</i> |
544 | # <i>emerge apache mod_php phpmyadmin</i> |
| 542 | </pre> |
545 | </pre> |
| 543 | |
546 | |
| 544 | <p> |
547 | <p> |
| 545 | There are plenty of guides out there about how to set up apache with php. Like |
548 | There are plenty of guides out there about how to set up apache with php. Like |
| 546 | this one: <uri>http://www.linuxguruz.org/z.php?id=31</uri>. There are also |
549 | this one: <uri>http://www.linuxguruz.com/z.php?id=31</uri>. There are also |
| 547 | numerous posts on <uri>http://forums.gentoo.org</uri> detailing how to solve |
550 | numerous posts on <uri>http://forums.gentoo.org</uri> detailing how to solve |
| 548 | problems with the installation (search for 'apache php'). So, that said, I'm |
551 | problems with the installation (search for 'apache php'). So, that said, I'm |
| 549 | not going to cover it here. Set up the apache and php installs, then continue |
552 | not going to cover it here. Set up the apache and php installs, then continue |
| 550 | with this howto. Now, a word for the wise: .htaccess the directory that you put |
553 | with this howto. Now, a word for the wise: .htaccess the directory that you put |
| 551 | phpmyadmin in. If you do not do this, search engine spiders will come along and |
554 | phpmyadmin in. If you do not do this, search engine spiders will come along and |
| … | |
… | |
| 607 | Now enter the phpmyadmin page and browse the tables. You'll want to add in your |
610 | Now enter the phpmyadmin page and browse the tables. You'll want to add in your |
| 608 | local aliases, edit your user table to add a test user, and change your |
611 | local aliases, edit your user table to add a test user, and change your |
| 609 | transport table to add information about your domains. The default values |
612 | transport table to add information about your domains. The default values |
| 610 | supplied with the dumpfile should be a sufficient guide to what values need to |
613 | supplied with the dumpfile should be a sufficient guide to what values need to |
| 611 | go where. Make sure that if you put information in the database that it is |
614 | go where. Make sure that if you put information in the database that it is |
| 612 | accurate. For instance, make sure the local users home dir exists and that the |
615 | accurate. For instance, make sure the local user's home dir exists and that the |
| 613 | correct uid/gid values are in place. The maildirs should be created |
616 | correct uid/gid values are in place. The maildirs should be created |
| 614 | automatically by postfix when the user receives their first email. So, in |
617 | automatically by postfix when the user receives their first email. So, in |
| 615 | general, it's a good idea to send a "Welcome" mail to a new user |
618 | general, it's a good idea to send a "Welcome" mail to a new user after you |
| 616 | after you setup their account to make sure the .maildir gets created. |
619 | setup their account to make sure the .maildir gets created. |
| 617 | </p> |
620 | </p> |
| 618 | |
621 | |
| 619 | </body> |
622 | </body> |
| 620 | </section> |
623 | </section> |
| 621 | </chapter> |
624 | </chapter> |
| … | |
… | |
| 638 | # <i>chown vmail: /home/vmail</i> |
641 | # <i>chown vmail: /home/vmail</i> |
| 639 | </pre> |
642 | </pre> |
| 640 | |
643 | |
| 641 | <p> |
644 | <p> |
| 642 | So now when you're setting up vmail accounts, use the vmail uid, gid, and |
645 | So now when you're setting up vmail accounts, use the vmail uid, gid, and |
| 643 | homedir. When you're setting up local accounts, use that users uid, gid, and |
646 | homedir. When you're setting up local accounts, use that user's uid, gid, and |
| 644 | homedir. We've been meaning to create a php admin page for this setup but |
647 | homedir. We've been meaning to create a php admin page for this setup but |
| 645 | haven't gotten around to it yet, as phpmyadmin generally works fine for us. |
648 | haven't gotten around to it yet, as phpmyadmin generally works fine for us. |
| 646 | </p> |
649 | </p> |
| 647 | |
650 | |
| 648 | </body> |
651 | </body> |
| … | |
… | |
| 683 | # <i>/etc/init.d/courier-authlib restart</i> |
686 | # <i>/etc/init.d/courier-authlib restart</i> |
| 684 | # <i>/etc/init.d/saslauthd restart</i> |
687 | # <i>/etc/init.d/saslauthd restart</i> |
| 685 | </pre> |
688 | </pre> |
| 686 | |
689 | |
| 687 | <p> |
690 | <p> |
| 688 | We're almost there I promise! Next, set up the rest of the necessary config's |
691 | We're almost there, I promise! Next, set up the rest of the necessary configs |
| 689 | for postfix to interract with the database for all it's other transport needs. |
692 | for postfix to interract with the database for all its other transport needs. |
|
|
693 | Remember to replace each value with the name of your own user, user id, |
|
|
694 | password, alias, email address, and so on. |
| 690 | </p> |
695 | </p> |
| 691 | |
696 | |
| 692 | <pre caption="/etc/postfix/mysql-aliases.cf"> |
697 | <pre caption="/etc/postfix/mysql-aliases.cf"> |
| 693 | # <i>nano -w /etc/postfix/mysql-aliases.cf</i> |
698 | # <i>nano -w /etc/postfix/mysql-aliases.cf</i> |
| 694 | # mysql-aliases.cf |
699 | # mysql-aliases.cf |
| … | |
… | |
| 882 | documentation, including README.POSTFIX.gz, to understand what's being done |
887 | documentation, including README.POSTFIX.gz, to understand what's being done |
| 883 | here. |
888 | here. |
| 884 | </p> |
889 | </p> |
| 885 | |
890 | |
| 886 | <p> |
891 | <p> |
| 887 | One further note, current versions of mailman install to /usr/local/mailman. If |
892 | One further note, current versions of mailman install to |
| 888 | you're like me and wish to change the default install location, it can be |
893 | <path>/usr/local/mailman</path>. If you're like me and wish to change the |
| 889 | overridden in the ebuild file by changing the INSTALLDIR variable. |
894 | default install location, it can be overridden in the ebuild file by changing |
|
|
895 | the INSTALLDIR variable. |
| 890 | </p> |
896 | </p> |
| 891 | |
897 | |
| 892 | <pre caption="Install mailman"> |
898 | <pre caption="Install mailman"> |
| 893 | # <i>emerge mailman</i> |
899 | # <i>emerge mailman</i> |
| 894 | </pre> |
900 | </pre> |