/[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.56 Revision 1.57
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.56 2007/07/20 09:09:04 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/virt-mail-howto.xml,v 1.57 2007/07/23 15:44:42 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 7
24<abstract> 24<abstract>
25This document details how to create a virtual mailhosting system based upon 25This document details how to create a virtual mailhosting system based upon
26postfix, mysql, courier-imap, and cyrus-sasl. 26postfix, mysql, courier-imap, and cyrus-sasl.
27</abstract> 27</abstract>
28 28
29<version>1.4</version> 29<version>1.5</version>
30<date>2007-07-20</date> 30<date>2007-07-23</date>
31
32<!--
33Contents
34
35I. Introduction
36II. Postfix Basics
37III. Courier-imap
38IV. Cyrus-sasl
39V. SSL Certificates for Postfix and Apache
40VI. Adding SSL and SASL support to Postfix
41VII. MySQL
42VIII. Apache and phpMyAdmin
43IX. The vmail user
44X. Configuring MySQL Authentication and vhosts
45XI. Squirrelmail
46XII. Mailman
47XIII. Content Filtering and Anti-Virus
48XIV. Wrap Up
49XV. Troubleshooting
50-->
51 31
52<chapter> 32<chapter>
53<title>Introduction</title> 33<title>Introduction</title>
54<section> 34<section>
55<body> 35<body>
382# <i>postfix reload</i> 362# <i>postfix reload</i>
383</pre> 363</pre>
384 364
385<p> 365<p>
386Now we're going to verify that the config's we added were picked up by postfix. 366Now we're going to verify that the config's we added were picked up by postfix.
367For this we are going to use <c>telnet</c> (provided by for instance
368<c>net-misc/netkit-telnetd</c>) although you can also use <c>nc</c> (provided by
369<c>net-analyzer/netcat</c>):
387</p> 370</p>
388 371
389<pre caption="Verifying sasl and tls support"> 372<pre caption="Verifying sasl and tls support">
390# <i>telnet localhost 25</i> 373# <i>telnet localhost 25</i>
391 374
419</body> 402</body>
420</section> 403</section>
421</chapter> 404</chapter>
422 405
423<chapter> 406<chapter>
407<title>The vmail user</title>
408<section>
409<body>
410
411<p>
412Before we set up our virtual mailhosting environment, we create a functional
413user under which the virtual mailboxes will be hosted. For clarity's sake we
414will call this <e>vmail</e>:
415</p>
416
417<pre caption="Adding the vmail user">
418# <i>adduser -d /home/vmail -s /bin/false -m vmail</i>
419</pre>
420
421<p>
422So now you've set up the vmail account. You can create multiple accounts if you
423want (to keep some structure in your set of virtual mail accounts). The user id,
424group id and home dirs are referenced in the MySQL tables.
425</p>
426
427<p>
428Next to the user account we also need to create the location where the mailboxes
429will reside:
430</p>
431
432<pre caption="Creating mailboxes">
433# <i>mkdir /home/vmail/virt-domain.com/foo</i>
434# <i>chown -R vmail:vmail /home/vmail/virt-domain.com</i>
435# <i>maildirmake /home/vmail/virt-domain.com/foo/.maildir</i>
436</pre>
437
438</body>
439</section>
440</chapter>
441
442<chapter>
424<title>MySQL</title> 443<title>MySQL</title>
425<section> 444<section>
426<body> 445<body>
427 446
428<p> 447<p>
483 502
484<pre caption="user table sample"> 503<pre caption="user table sample">
485<comment>(Line wrapped for clarity.)</comment> 504<comment>(Line wrapped for clarity.)</comment>
486id email clear name uid gid homedir \ 505id email clear name uid gid homedir \
487 maildir quota postfix 506 maildir quota postfix
48810 foo@virt-bar.org $password realname virtid virtid /home/vmail \ 50710 foo@virt-domain.com $password realname virtid virtid /home/vmail \
489 /home/vmail/virt-bar.org/foo/.maildir/ y 508 /home/vmail/virt-domain.com/foo/.maildir/ y
49013 foo@bar.com $password realname localid localid /home/foo \ 50913 foo@bar.com $password realname localid localid /home/foo \
491 /home/foo/.maildir/ y 510 /home/foo/.maildir/ y
492</pre> 511</pre>
493 512
494<p> 513<p>
495The values of the <c>virtid</c> uid and gid should be those of the <c>vmail</c> 514The values of the <c>virtid</c> uid and gid should be those of the <c>vmail</c>
496user and group. 515user and group.
497</p> 516</p>
498 517
499<pre caption="transport table sample"> 518<pre caption="transport table sample">
500id domain destination 519id domain destination
5011 bar.com local: 5201 bar.com local:
5022 virt-bar.org virtual: 5212 virt-domain.com virtual:
503</pre> 522</pre>
504 523
505<pre caption="virtual table sample"> 524<pre caption="virtual table sample">
506id email destination 525id email destination
5073 root@virt-bar.org other@email.address 5263 root@virt-domain.com other@email.address
508</pre> 527</pre>
509 528
510</body> 529</body>
511</section> 530</section>
512</chapter> 531</chapter>
612accurate. For instance, make sure the local user's home dir exists and that the 631accurate. For instance, make sure the local user's home dir exists and that the
613correct uid/gid values are in place. The maildirs should be created 632correct uid/gid values are in place. The maildirs should be created
614automatically by postfix when the user receives their first email. So, in 633automatically by postfix when the user receives their first email. So, in
615general, it's a good idea to send a "Welcome" mail to a new user after you 634general, it's a good idea to send a "Welcome" mail to a new user after you
616setup their account to make sure the .maildir gets created. 635setup their account to make sure the .maildir gets created.
617</p>
618
619</body>
620</section>
621</chapter>
622
623<chapter>
624<title>The vmail user</title>
625<section>
626<body>
627
628<p>
629At this point you may be wondering what user and directory to use for virtual
630mail users, and rightly so. Let's set that up.
631</p>
632
633<pre caption="Adding the vmail user">
634# <i>adduser -d /home/vmail -s /bin/false -m vmail</i>
635</pre>
636
637<p>
638So now you've set up the vmail account. You can create multiple accounts if you
639want (to keep some structure in your set of virtual mail accounts). The user id,
640group id and home dirs are referenced in the MySQL tables.
641</p> 636</p>
642 637
643</body> 638</body>
644</section> 639</section>
645</chapter> 640</chapter>
739hosts = unix:/var/run/mysqld/mysqld.sock 734hosts = unix:/var/run/mysqld/mysqld.sock
740</pre> 735</pre>
741 736
742<pre caption="/etc/postfix/mysql-virtual-maps.cf"> 737<pre caption="/etc/postfix/mysql-virtual-maps.cf">
743# <i>nano -w /etc/postfix/mysql-virtual-maps.cf</i> 738# <i>nano -w /etc/postfix/mysql-virtual-maps.cf</i>
744#myql-virtual-maps.cf 739# mysql-virtual-maps.cf
745 740
746user = mailsql 741user = mailsql
747password = $password 742password = $password
748dbname = mailsql 743dbname = mailsql
749table = users 744table = users
794local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname 789local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname
795 790
796virtual_transport = virtual 791virtual_transport = virtual
797<comment>(The domains listed by the mydestination should not be listed in 792<comment>(The domains listed by the mydestination should not be listed in
798 the virtual_mailbox_domains parameter)</comment> 793 the virtual_mailbox_domains parameter)</comment>
799virtual_mailbox_domains = virt-bar.com, $other-virtual-domain.com 794virtual_mailbox_domains = virt-domain.com, $other-virtual-domain.com
800 795
801virtual_minimum_uid = 1000 796virtual_minimum_uid = 1000
802<comment>(Substitute $vmail-gid with the GID of the vmail group)</comment> 797<comment>(Substitute $vmail-gid with the GID of the vmail group)</comment>
803virtual_gid_maps = static:$vmail-gid 798virtual_gid_maps = static:$vmail-gid
804virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf 799virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
906<pre caption="And last but not least"> 901<pre caption="And last but not least">
907<comment>(Once that's finished, add your first list.)</comment> 902<comment>(Once that's finished, add your first list.)</comment>
908 903
909# <i>su mailman</i> 904# <i>su mailman</i>
910# <i>cd ~</i> 905# <i>cd ~</i>
911# <i>./bin/newlist test</i> 906# <i>./bin/newlist --urlhost='www.virt-domain.com' --emailhost='virt-domain.com' test</i>
912Enter the email of the person running the list: <i>your@email.address</i> 907Enter the email of the person running the list: <i>your@email.address</i>
913Initial test password: 908Initial test password:
914Hit enter to continue with test owner notification... 909Hit enter to continue with test owner notification...
915<comment>(Virtual domain lists may be specified with 910<comment>(Virtual domain lists may also be specified with
916list@domain.com style list names.)</comment> 911list@domain.com style list names.)</comment>
917# <i>./bin/genaliases</i> 912# <i>./bin/genaliases</i>
918<comment>(Now that your aliases have been generated, 913<comment>(Now that your aliases have been generated,
919verify that they were added successfully.)</comment> 914verify that they were added successfully.)</comment>
920 915
921# <i>nano -w data/aliases</i> 916# <i>nano -w data/aliases</i>
922# STANZA START: test 917# STANZA START: test
923# CREATED: 918# CREATED:
924test: "|/var/mailman/mail/mailman post test" 919test: "|/usr/local/mailman/mail/mailman post test"
925test-admin: "|/var/mailman/mail/mailman admin test" 920test-admin: "|/usr/local/mailman/mail/mailman admin test"
926test-bounces: "|/var/mailman/mail/mailman bounces test" 921test-bounces: "|/usr/local/mailman/mail/mailman bounces test"
927test-confirm: "|/var/mailman/mail/mailman confirm test" 922test-confirm: "|/usr/local/mailman/mail/mailman confirm test"
928test-join: "|/var/mailman/mail/mailman join test" 923test-join: "|/usr/local/mailman/mail/mailman join test"
929test-leave: "|/var/mailman/mail/mailman leave test" 924test-leave: "|/usr/local/mailman/mail/mailman leave test"
930test-owner: "|/var/mailman/mail/mailman owner test" 925test-owner: "|/usr/local/mailman/mail/mailman owner test"
931test-request: "|/var/mailman/mail/mailman request test" 926test-request: "|/usr/local/mailman/mail/mailman request test"
932test-subscribe: "|/var/mailman/mail/mailman subscribe test" 927test-subscribe: "|/usr/local/mailman/mail/mailman subscribe test"
933test-unsubscribe: "|/var/mailman/mail/mailman unsubscribe test" 928test-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe test"
934# STANZA END: test 929# STANZA END: test
935 930
936<comment>(Create the required mailman list)</comment> 931<comment>(Create the required mailman list)</comment>
937# <i>./bin/newlist mailman</i> 932# <i>./bin/newlist mailman</i>
938# <i>./bin/genaliases</i> 933# <i>./bin/genaliases</i>

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57

  ViewVC Help
Powered by ViewVC 1.1.20