/[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.58 Revision 1.59
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.58 2007/08/24 18:59:45 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/virt-mail-howto.xml,v 1.59 2008/05/21 19:39: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
8<author title="Author"> 8<author title="Author">
9 <mail link="antifa@gentoo.org">Ken Nowack</mail> 9 <mail link="antifa@gentoo.org">Ken Nowack</mail>
10</author> 10</author>
11<author title="Author"> 11<author title="Author">
12 <mail link="ezra@revoltltd.org">Ezra Gorman</mail> 12 <mail link="ezra@revoltltd.org">Ezra Gorman</mail>
13</author> 13</author>
14<author title="Editor"> 14<author title="Editor">
15 <mail link="klasikahl@gentoo.org">Zack Gilburd</mail> 15 <mail link="klasikahl@gentoo.org">Zack Gilburd</mail>
16</author> 16</author>
17<author title="Editor"> 17<author title="Editor">
58users that don't require shell accounts, has domain specific user names, can 58users that don't require shell accounts, has domain specific user names, can
59authenticate web, imap, smtp, and pop3 clients against a single database, 59authenticate web, imap, smtp, and pop3 clients against a single database,
60utilizes ssl for transport layer security, has a web interface, can handle 60utilizes ssl for transport layer security, has a web interface, can handle
61mailing lists for any domain on the machine, and is controlled by a nice, 61mailing lists for any domain on the machine, and is controlled by a nice,
62central and easy mysql database. 62central and easy mysql database.
63</p> 63</p>
64 64
65<p> 65<p>
66There are quite a variety of ways to go about setting up a virtual mailhosting 66There are quite a variety of ways to go about setting up a virtual mailhosting
67system. With so may options, another may be the best choice for your specific 67system. With so may options, another may be the best choice for your specific
68needs. Consider investigating <uri>http://www.qmail.org/</uri> and 68needs. Consider investigating <uri>http://www.qmail.org/</uri> and
69<uri>http://www.exim.org/</uri> to explore your options. 69<uri>http://www.exim.org/</uri> to explore your options.
70</p> 70</p>
71 71
72<p> 72<p>
73The following packages are used in this setup: apache, courier-imap, courier-authlib 73The following packages are used in this setup: apache, courier-imap,
74postfix, mod_php, phpmyadmin, squirrelmail, cyrus-sasl, mysql, php, and 74courier-authlib postfix, mod_php, phpmyadmin, squirrelmail, cyrus-sasl, mysql,
75mailman. 75php, and mailman.
76</p> 76</p>
77 77
78<p> 78<p>
79Make sure to turn on the following USE variables in <path>/etc/make.conf</path> 79Make sure to turn on the following USE variables in <path>/etc/make.conf</path>
80before compiling the packages: <c>USE="mysql imap libwww maildir 80before compiling the packages: <c>USE="mysql imap libwww maildir
81sasl ssl"</c>. Otherwise you will most likely have to recompile things to 81sasl ssl"</c>. Otherwise you will most likely have to recompile things to
82get the support you need for all the protocols. Further, it's a good idea to 82get the support you need for all the protocols. Further, it's a good idea to
83turn off any other mail and network variables, like ipv6. 83turn off any other mail and network variables, like ipv6.
84</p> 84</p>
85 85
86<impo> 86<impo>
87You need a domain name to run a public mail server, or at least an MX record 87You need a domain name to run a public mail server, or at least an MX record
88for a domain. Ideally you would have control of at least two domains to take 88for a domain. Ideally you would have control of at least two domains to take
89advantage of your new virtual domain functionality. 89advantage of your new virtual domain functionality.
90</impo> 90</impo>
152# 152#
153========================================================================== 153==========================================================================
154<comment>(Just add the "-v" after the smtpd in the following line)</comment> 154<comment>(Just add the "-v" after the smtpd in the following line)</comment>
155smtp inet n - n - - smtpd -v 155smtp inet n - n - - smtpd -v
156</pre> 156</pre>
157 157
158<p> 158<p>
159Next, edit <path>/etc/mail/aliases</path> to add your local aliases. There 159Next, edit <path>/etc/mail/aliases</path> to add your local aliases. There
160should at least be an alias for root like: <c>root: your@email.address</c>. 160should at least be an alias for root like: <c>root: your@email.address</c>.
161</p> 161</p>
162 162
163<pre caption="Starting postfix for the first time"> 163<pre caption="Starting postfix for the first time">
164# <i>/usr/bin/newaliases</i> 164# <i>/usr/bin/newaliases</i>
165<comment>(This will install the new aliases. You only need to do this 165<comment>(This will install the new aliases. You only need to do this
166when you update or install aliases.)</comment> 166when you update or install aliases.)</comment>
167 167
168# <i>/etc/init.d/postfix start</i> 168# <i>/etc/init.d/postfix start</i>
169</pre> 169</pre>
170 170
171<p> 171<p>
172Now that postfix is running, fire up your favorite console mail client and send 172Now that postfix is running, fire up your favorite console mail client and send
173yourself an email. I use <c>mutt</c> for all my console mail. Verify that 173yourself an email. I use <c>mutt</c> for all my console mail. Verify that
174postfix is delivering mail to local users, once that's done, we're on to the 174postfix is delivering mail to local users, once that's done, we're on to the
175next step. 175next step.
176</p> 176</p>
177 177
178<note> 178<note>
179I strongly recommend that you verify this basic postfix setup is functioning 179I strongly recommend that you verify this basic postfix setup is functioning
180before you progress to the next step of the howto. 180before you progress to the next step of the howto.
181</note> 181</note>
182 182
226get the rest of the system running. Again, please verify that what we've 226get the rest of the system running. Again, please verify that what we've
227installed already works before progressing. 227installed already works before progressing.
228</p> 228</p>
229 229
230</body> 230</body>
231</section> 231</section>
232</chapter> 232</chapter>
233 233
234<chapter> 234<chapter>
235<title>Cyrus-sasl</title> 235<title>Cyrus-sasl</title>
236<section> 236<section>
237<body> 237<body>
238 238
239<p> 239<p>
240Next we're going to install cyrus-sasl. Sasl is going to play the role of 240Next we're going to install cyrus-sasl. Sasl is going to play the role of
241actually passing your auth variables to courier-auth, which will in turn pass that 241actually passing your auth variables to courier-auth, which will in turn pass
242information to mysql for authentication of smtp users. For this howto, we'll 242that information to mysql for authentication of smtp users. For this howto,
243not even try to verify that sasl is working until mysql is set up and contains 243we'll not even try to verify that sasl is working until mysql is set up and
244a test user. Which is fine since we'll be authenticating against mysql in the 244contains a test user. Which is fine since we'll be authenticating against
245end anyway. 245mysql in the end anyway.
246</p> 246</p>
247 247
248<pre caption="Configuring and installing the cyrus-sasl ebuild"> 248<pre caption="Configuring and installing the cyrus-sasl ebuild">
249# <i>emerge cyrus-sasl</i> 249# <i>emerge cyrus-sasl</i>
250</pre> 250</pre>
251 251
252<p> 252<p>
253Next, edit <path>/etc/sasl2/smtpd.conf</path>. 253Next, edit <path>/etc/sasl2/smtpd.conf</path>.
254</p> 254</p>
255 255
256<pre caption="Starting sasl"> 256<pre caption="Starting sasl">
257# <i>nano -w /etc/sasl2/smtpd.conf</i> 257# <i>nano -w /etc/sasl2/smtpd.conf</i>
258mech_list: PLAIN LOGIN 258mech_list: PLAIN LOGIN
259pwcheck_method: saslauthd 259pwcheck_method: saslauthd
260# <i>nano -w /etc/conf.d/saslauthd</i> 260# <i>nano -w /etc/conf.d/saslauthd</i>
326 326
327smtpd_sasl_auth_enable = yes 327smtpd_sasl_auth_enable = yes
328smtpd_sasl2_auth_enable = yes 328smtpd_sasl2_auth_enable = yes
329smtpd_sasl_security_options = noanonymous 329smtpd_sasl_security_options = noanonymous
330broken_sasl_auth_clients = yes 330broken_sasl_auth_clients = yes
331smtpd_sasl_local_domain = 331smtpd_sasl_local_domain =
332 332
333<comment>(The broken_sasl_auth_clients option and the login auth method 333<comment>(The broken_sasl_auth_clients option and the login auth method
334are for outlook and outlook express only and are undocumented. 334are for outlook and outlook express only and are undocumented.
335Isn't having to hack software for stupid, broken, M$ BS great? 335Isn't having to hack software for stupid, broken, M$ BS great?
336smtpd_sasl_local_domain appends a domain name to clients using 336smtpd_sasl_local_domain appends a domain name to clients using
337smtp-auth. Make sure it's blank or your user names will get 337smtp-auth. Make sure it's blank or your user names will get
338mangled by postfix and be unable to auth.)</comment> 338mangled by postfix and be unable to auth.)</comment>
339 339
340smtpd_recipient_restrictions = 340smtpd_recipient_restrictions =
341 permit_sasl_authenticated, 341 permit_sasl_authenticated,
342 permit_mynetworks, 342 permit_mynetworks,
343 reject_unauth_destination 343 reject_unauth_destination
344
345 344
346<comment>(The next two options enable outgoing encryption.)</comment> 345<comment>(The next two options enable outgoing encryption.)</comment>
347smtp_use_tls = yes 346smtp_use_tls = yes
348smtp_tls_note_starttls_offer = yes 347smtp_tls_note_starttls_offer = yes
349smtpd_use_tls = yes 348smtpd_use_tls = yes
350#smtpd_tls_auth_only = yes 349#smtpd_tls_auth_only = yes
351smtpd_tls_key_file = /etc/postfix/newkey.pem 350smtpd_tls_key_file = /etc/postfix/newkey.pem
352smtpd_tls_cert_file = /etc/postfix/newcert.pem 351smtpd_tls_cert_file = /etc/postfix/newcert.pem
353smtpd_tls_CAfile = /etc/postfix/cacert.pem 352smtpd_tls_CAfile = /etc/postfix/cacert.pem
354smtpd_tls_loglevel = 3 353smtpd_tls_loglevel = 3
355smtpd_tls_received_header = yes 354smtpd_tls_received_header = yes
356smtpd_tls_session_cache_timeout = 3600s 355smtpd_tls_session_cache_timeout = 3600s
357tls_random_source = dev:/dev/urandom 356tls_random_source = dev:/dev/urandom
358 357
359<comment>(smtpd_tls_auth_only is commented out to ease testing the system. 358<comment>(smtpd_tls_auth_only is commented out to ease testing the system.
443<title>MySQL</title> 442<title>MySQL</title>
444<section> 443<section>
445<body> 444<body>
446 445
447<p> 446<p>
448Next we're going to install and configure MySQL. You'll need the <uri 447Next we're going to install and configure MySQL. You'll need the <uri
449link="http://www.gentoo.org/doc/en/files/genericmailsql.sql">genericmailsql.sql</uri> 448link="http://www.gentoo.org/doc/en/files/genericmailsql.sql">genericmailsql.sql</uri>
450dumpfile for this step. 449dumpfile for this step.
451</p> 450</p>
452 451
453<pre caption="Installing and configuring MySQL"> 452<pre caption="Installing and configuring MySQL">
454# <i>emerge mysql</i> 453# <i>emerge mysql</i>
455 454
456# <i>/usr/bin/mysql_install_db</i> 455# <i>/usr/bin/mysql_install_db</i>
457<comment>(After this command runs follow the onscreen directions 456<comment>(After this command runs follow the onscreen directions
458for adding a root password with mysql, otherwise your db will 457for adding a root password with mysql, otherwise your db will
459be wide open.)</comment> 458be wide open.)</comment>
460 459
461# <i>/etc/init.d/mysql start</i> 460# <i>/etc/init.d/mysql start</i>
462# <i>mysqladmin -u root -p create mailsql</i> 461# <i>mysqladmin -u root -p create mailsql</i>
463# <i>mysql -u root -p mailsql &lt; genericmailsql.sql</i> 462# <i>mysql -u root -p mailsql &lt; genericmailsql.sql</i>
464
465# <i>mysql -u root -p mysql</i> 463# <i>mysql -u root -p mysql</i>
466mysql> <i>GRANT SELECT,INSERT,UPDATE,DELETE</i> 464mysql> <i>GRANT SELECT,INSERT,UPDATE,DELETE</i>
467 -> <i>ON mailsql.*</i> 465 -> <i>ON mailsql.*</i>
468 -> <i>TO mailsql@localhost</i> 466 -> <i>TO mailsql@localhost</i>
469 -> <i>IDENTIFIED BY '$password';</i> 467 -> <i>IDENTIFIED BY '$password';</i>
470Query OK, 0 rows affected (0.02 sec) 468Query OK, 0 rows affected (0.02 sec)
471 469
472mysql> <i>FLUSH PRIVILEGES;</i> 470mysql> <i>FLUSH PRIVILEGES;</i>
473Query OK, 0 rows affected (0.00 sec) 471Query OK, 0 rows affected (0.00 sec)
474 472
475mysql> <i>quit</i> 473mysql> <i>quit</i>
476<comment>(Verify that the new mailsql user can connect to the mysql server.)</comment> 474<comment>(Verify that the new mailsql user can connect to the mysql server.)</comment>
477 475
478# <i>mysql -u mailsql -p mailsql</i> 476# <i>mysql -u mailsql -p mailsql</i>
479</pre> 477</pre>
480 478
481<p> 479<p>
482Your new database has default values and tables set up for two domains. The 480Your new database has default values and tables set up for two domains. The
483following tables are included: 481following tables are included:
484</p> 482</p>
485 483
486<ul> 484<ul>
487 <li>alias - local email alias and mailman alias information.</li> 485 <li>alias - local email alias and mailman alias information.</li>
488 <li>relocated - relocated user email address maps</li> 486 <li>relocated - relocated user email address maps</li>
489 <li> 487 <li>
490 transport - default mail transport information for all domains you are 488 transport - default mail transport information for all domains you are
491 hosting 489 hosting
492 </li> 490 </li>
493 <li>users - all user account information</li> 491 <li>users - all user account information</li>
494 <li>virtual - virtual domain email alias maps</li> 492 <li>virtual - virtual domain email alias maps</li>
495</ul> 493</ul>
496 494
497<pre caption="alias table sample"> 495<pre caption="alias table sample">
498id alias destination 496id alias destination
4991 root foo@bar.com 4971 root foo@bar.com
5002 postmaster foo@bar.com 4982 postmaster foo@bar.com
501</pre> 499</pre>
502 500
503<pre caption="user table sample"> 501<pre caption="user table sample">
504<comment>(Line wrapped for clarity.)</comment> 502<comment>(Line wrapped for clarity.)</comment>
505id email clear name uid gid homedir \ 503id email clear name uid gid homedir \
506 maildir quota postfix 504 maildir quota postfix
50710 foo@virt-domain.com $password realname virtid virtid /home/vmail \ 50510 foo@virt-domain.com $password realname virtid virtid /home/vmail \
508 /home/vmail/virt-domain.com/foo/.maildir/ y 506 /home/vmail/virt-domain.com/foo/.maildir/ y
50913 foo@bar.com $password realname localid localid /home/foo \ 50713 foo@bar.com $password realname localid localid /home/foo \
510 /home/foo/.maildir/ y 508 /home/foo/.maildir/ y
511</pre> 509</pre>
512 510
513<p> 511<p>
514The values of the <c>virtid</c> uid and gid should be those of the <c>vmail</c> 512The values of the <c>virtid</c> uid and gid should be those of the <c>vmail</c>
515user and group. 513user and group.
516</p> 514</p>
517 515
518<pre caption="transport table sample"> 516<pre caption="transport table sample">
519id domain destination 517id domain destination
5201 bar.com local: 5181 bar.com local:
5212 virt-domain.com virtual: 5192 virt-domain.com virtual:
522</pre> 520</pre>
523 521
524<pre caption="virtual table sample"> 522<pre caption="virtual table sample">
525id email destination 523id email destination
5263 root@virt-domain.com other@email.address 5243 root@virt-domain.com other@email.address
527</pre> 525</pre>
528 526
529</body> 527</body>
530</section> 528</section>
531</chapter> 529</chapter>
532 530
533<chapter> 531<chapter>
534<title>Apache and phpMyAdmin</title> 532<title>Apache and phpMyAdmin</title>
535<section> 533<section>
536<body> 534<body>
537 535
538<p> 536<p>
539Next we'll set up apache and add an interface to interact with the database 537Next we'll set up apache and add an interface to interact with the database
540more easily. 538more easily.
541</p> 539</p>
561 559
562<p> 560<p>
563Now we're going to install the Apache certificates we made previously. The 561Now we're going to install the Apache certificates we made previously. The
564Apache-SSL directives that you need to use the resulting cert are: 562Apache-SSL directives that you need to use the resulting cert are:
565</p> 563</p>
566 564
567<ul> 565<ul>
568 <li>SSLCertificateFile /path/to/certs/new.cert.cert</li> 566 <li>SSLCertificateFile /path/to/certs/new.cert.cert</li>
569 <li>SSLCertificateKeyFile /path/to/certs/new.cert.key</li> 567 <li>SSLCertificateKeyFile /path/to/certs/new.cert.key</li>
570</ul> 568</ul>
571 569
572<pre caption="Install Apache SSL certificates"> 570<pre caption="Install Apache SSL certificates">
573# <i>cp /etc/ssl/misc/new.cert.cert /etc/apache2/ssl/</i> 571# <i>cp /etc/ssl/misc/new.cert.cert /etc/apache2/ssl/</i>
574# <i>cp /etc/ssl/misc/new.cert.key /etc/apache2/ssl/</i> 572# <i>cp /etc/ssl/misc/new.cert.key /etc/apache2/ssl/</i>
575# <i>cd /etc/apache2/vhosts.d</i> 573# <i>cd /etc/apache2/vhosts.d</i>
576<comment>(Check if you have an ssl-vhost template already. 574<comment>(Check if you have an ssl-vhost template already.
577 Copy that one instead of the default_vhost if that is the case)</comment> 575 Copy that one instead of the default_vhost if that is the case)</comment>
578# <i>cp 00_default_vhost.conf ssl-vhost.conf</i> 576# <i>cp 00_default_vhost.conf ssl-vhost.conf</i>
579# <i>nano -w ssl-vhost.conf</i> 577# <i>nano -w ssl-vhost.conf</i>
580 578
581<comment>(Change the following parameters)</comment> 579<comment>(Change the following parameters)</comment>
582NameVirtualHost host.domain.name:443 580NameVirtualHost host.domain.name:443
583 581
584&lt;VirtualHost host.domain.name:443&gt; 582&lt;VirtualHost host.domain.name:443&gt;
585 ServerName host.domain.name 583 ServerName host.domain.name
586 ServerAdmin your@email.address 584 ServerAdmin your@email.address
587 585
588 DocumentRoot "/var/www/localhost/htdocs/phpmyadmin"; 586 DocumentRoot "/var/www/localhost/htdocs/phpmyadmin";
589 &lt;Directory "/var/www/localhost/htdocs/phpmyadmin"&gt; 587 &lt;Directory "/var/www/localhost/htdocs/phpmyadmin"&gt;
590 ... 588 ...
591 &lt;/Directory&gt; 589 &lt;/Directory&gt;
673# <i>/etc/init.d/courier-authlib restart</i> 671# <i>/etc/init.d/courier-authlib restart</i>
674# <i>/etc/init.d/saslauthd restart</i> 672# <i>/etc/init.d/saslauthd restart</i>
675</pre> 673</pre>
676 674
677<p> 675<p>
678We're almost there, I promise! Next, set up the rest of the necessary configs 676We're almost there, I promise! Next, set up the rest of the necessary configs
679for postfix to interract with the database for all its other transport needs. 677for postfix to interract with the database for all its other transport needs.
680Remember to replace each value with the name of your own user, user id, 678Remember to replace each value with the name of your own user, user id,
681password, alias, email address, and so on. 679password, alias, email address, and so on.
682</p> 680</p>
683 681
684<pre caption="/etc/postfix/mysql-aliases.cf"> 682<pre caption="/etc/postfix/mysql-aliases.cf">
685# <i>nano -w /etc/postfix/mysql-aliases.cf</i> 683# <i>nano -w /etc/postfix/mysql-aliases.cf</i>
686# mysql-aliases.cf 684# mysql-aliases.cf
687 685
688user = mailsql 686user = mailsql
689password = $password 687password = $password
690dbname = mailsql 688dbname = mailsql
691table = alias 689table = alias
692select_field = destination 690select_field = destination
693where_field = alias 691where_field = alias
694hosts = unix:/var/run/mysqld/mysqld.sock 692hosts = unix:/var/run/mysqld/mysqld.sock
695</pre> 693</pre>
696 694
697<pre caption="/etc/postfix/mysql-relocated.cf"> 695<pre caption="/etc/postfix/mysql-relocated.cf">
698# <i>nano -w /etc/postfix/mysql-relocated.cf</i> 696# <i>nano -w /etc/postfix/mysql-relocated.cf</i>
699# mysql-relocated.cf 697# mysql-relocated.cf
700 698
701user = mailsql 699user = mailsql
702password = $password 700password = $password
703dbname = mailsql 701dbname = mailsql
704table = relocated 702table = relocated
705select_field = destination 703select_field = destination
706where_field = email 704where_field = email
707hosts = unix:/var/run/mysqld/mysqld.sock 705hosts = unix:/var/run/mysqld/mysqld.sock
708</pre> 706</pre>
709 707
710<pre caption="/etc/postfix/mysql-transport.cf (optional)"> 708<pre caption="/etc/postfix/mysql-transport.cf (optional)">
711# <i>nano -w /etc/postfix/mysql-transport.cf</i> 709# <i>nano -w /etc/postfix/mysql-transport.cf</i>
712# mysql-transport.cf 710# mysql-transport.cf
713 711
714user = mailsql 712user = mailsql
715password = $password 713password = $password
716dbname = mailsql 714dbname = mailsql
717table = transport 715table = transport
718select_field = destination 716select_field = destination
719where_field = domain 717where_field = domain
720hosts = unix:/var/run/mysqld/mysqld.sock 718hosts = unix:/var/run/mysqld/mysqld.sock
721</pre> 719</pre>
722 720
723<pre caption="/etc/postfix/mysql-virtual-gid.cf (optional)"> 721<pre caption="/etc/postfix/mysql-virtual-gid.cf (optional)">
724# <i>nano -w /etc/postfix/mysql-virtual-gid.cf</i> 722# <i>nano -w /etc/postfix/mysql-virtual-gid.cf</i>
725# mysql-virtual-gid.cf 723# mysql-virtual-gid.cf
726 724
727user = mailsql 725user = mailsql
728password = $password 726password = $password
729dbname = mailsql 727dbname = mailsql
730table = users 728table = users
731select_field = gid 729select_field = gid
732where_field = email 730where_field = email
733additional_conditions = and postfix = 'y' 731additional_conditions = and postfix = 'y'
734hosts = unix:/var/run/mysqld/mysqld.sock 732hosts = unix:/var/run/mysqld/mysqld.sock
735</pre> 733</pre>
736 734
737<pre caption="/etc/postfix/mysql-virtual-maps.cf"> 735<pre caption="/etc/postfix/mysql-virtual-maps.cf">
738# <i>nano -w /etc/postfix/mysql-virtual-maps.cf</i> 736# <i>nano -w /etc/postfix/mysql-virtual-maps.cf</i>
739# mysql-virtual-maps.cf 737# mysql-virtual-maps.cf
740 738
741user = mailsql 739user = mailsql
742password = $password 740password = $password
743dbname = mailsql 741dbname = mailsql
744table = users 742table = users
745select_field = maildir 743select_field = maildir
746where_field = email 744where_field = email
747additional_conditions = and postfix = 'y' 745additional_conditions = and postfix = 'y'
748hosts = unix:/var/run/mysqld/mysqld.sock 746hosts = unix:/var/run/mysqld/mysqld.sock
749</pre> 747</pre>
750 748
751<pre caption="/etc/postfix/mysql-virtual-uid.cf (optional)"> 749<pre caption="/etc/postfix/mysql-virtual-uid.cf (optional)">
752# <i>nano -w /etc/postfix/mysql-virtual-uid.cf</i> 750# <i>nano -w /etc/postfix/mysql-virtual-uid.cf</i>
753# mysql-virtual-uid.cf 751# mysql-virtual-uid.cf
754 752
755user = mailsql 753user = mailsql
756password = $password 754password = $password
757dbname = mailsql 755dbname = mailsql
758table = users 756table = users
759select_field = uid 757select_field = uid
760where_field = email 758where_field = email
761additional_conditions = and postfix = 'y' 759additional_conditions = and postfix = 'y'
762hosts = unix:/var/run/mysqld/mysqld.sock 760hosts = unix:/var/run/mysqld/mysqld.sock
763</pre> 761</pre>
764 762
765<pre caption="/etc/postfix/mysql-virtual.cf"> 763<pre caption="/etc/postfix/mysql-virtual.cf">
766# <i>nano -w /etc/postfix/mysql-virtual.cf</i> 764# <i>nano -w /etc/postfix/mysql-virtual.cf</i>
767# mysql-virtual.cf 765# mysql-virtual.cf
768 766
769user = mailsql 767user = mailsql
770password = $password 768password = $password
771dbname = mailsql 769dbname = mailsql
772table = virtual 770table = virtual
773select_field = destination 771select_field = destination
774where_field = email 772where_field = email
775hosts = unix:/var/run/mysqld/mysqld.sock 773hosts = unix:/var/run/mysqld/mysqld.sock
776</pre> 774</pre>
777 775
778<p> 776<p>
779Lastly, edit <path>/etc/postfix/main.cf</path> one more time. 777Lastly, edit <path>/etc/postfix/main.cf</path> one more time.
780</p> 778</p>
781 779
782<pre caption="/etc/postfix/main.cf"> 780<pre caption="/etc/postfix/main.cf">
783# <i>nano -w /etc/postfix/main.cf</i> 781# <i>nano -w /etc/postfix/main.cf</i>
784<comment>(Ensure that there are no other alias_maps definitions)</comment> 782<comment>(Ensure that there are no other alias_maps definitions)</comment>
785alias_maps = mysql:/etc/postfix/mysql-aliases.cf 783alias_maps = mysql:/etc/postfix/mysql-aliases.cf
786relocated_maps = mysql:/etc/postfix/mysql-relocated.cf 784relocated_maps = mysql:/etc/postfix/mysql-relocated.cf
787 785
788local_transport = local 786local_transport = local
789local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname 787local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname
790 788
791virtual_transport = virtual 789virtual_transport = virtual
792<comment>(The domains listed by the mydestination should not be listed in 790<comment>(The domains listed by the mydestination should not be listed in
793 the virtual_mailbox_domains parameter)</comment> 791 the virtual_mailbox_domains parameter)</comment>
794virtual_mailbox_domains = virt-domain.com, $other-virtual-domain.com 792virtual_mailbox_domains = virt-domain.com, $other-virtual-domain.com
795 793
796virtual_minimum_uid = 1000 794virtual_minimum_uid = 1000
797<comment>(Substitute $vmail-gid with the GID of the vmail group)</comment> 795<comment>(Substitute $vmail-gid with the GID of the vmail group)</comment>
798virtual_gid_maps = static:$vmail-gid 796virtual_gid_maps = static:$vmail-gid
799virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf 797virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
800virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf 798virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf
801<comment>(Substitute $vmail-uid with the UID of the vmail user)</comment> 799<comment>(Substitute $vmail-uid with the UID of the vmail user)</comment>
802virtual_uid_maps = static:$vmail-uid 800virtual_uid_maps = static:$vmail-uid
803virtual_mailbox_base = / 801virtual_mailbox_base = /
804#virtual_mailbox_limit = 802#virtual_mailbox_limit =
805</pre> 803</pre>
806 804
807<p> 805<p>
880 878
881<pre caption="Install mailman"> 879<pre caption="Install mailman">
882# <i>emerge mailman</i> 880# <i>emerge mailman</i>
883</pre> 881</pre>
884 882
885<pre caption="Setting defaults: Mailman/Defaults.py"> 883<pre caption="Setting defaults: Mailman/Defaults.py">
886# <i> nano -w /usr/local/mailman/Mailman/Defaults.py</i> 884# <i> nano -w /usr/local/mailman/Mailman/Defaults.py</i>
887<comment>(Change the values below to reflect your primary domain, virtuals will be set next.)</comment> 885<comment>(Change the values below to reflect your primary domain, virtuals will be set next.)</comment>
888DEFAULT_EMAIL_HOST = 'domain.com' 886DEFAULT_EMAIL_HOST = 'domain.com'
889DEFAULT_URL_HOST = 'www.domain.com' 887DEFAULT_URL_HOST = 'www.domain.com'
890</pre> 888</pre>
891 889
892<pre caption="mailman config: mm_cfg.py"> 890<pre caption="mailman config: mm_cfg.py">
893# <i>nano -w /usr/local/mailman/Mailman/mm_cfg.py</i> 891# <i>nano -w /usr/local/mailman/Mailman/mm_cfg.py</i>
894MTA = "Postfix" 892MTA = "Postfix"
895POSTFIX_STYLE_VIRTUAL_DOMAINS = ['virt-domain.com', 'virt.domain2.com'] 893POSTFIX_STYLE_VIRTUAL_DOMAINS = ['virt-domain.com', 'virt.domain2.com']
896add_virtualhost('www.virt.domain.com', 'virt.domain.com') 894add_virtualhost('www.virt.domain.com', 'virt.domain.com')
897add_virtualhost('www.virt.domain2.com', 'virt.domain2.com') 895add_virtualhost('www.virt.domain2.com', 'virt.domain2.com')
898<comment>(This is required for your virtual domains for mailman to function.)</comment> 896<comment>(This is required for your virtual domains for mailman to function.)</comment>
899</pre> 897</pre>
900 898
901<pre caption="And last but not least"> 899<pre caption="And last but not least">
902<comment>(Once that's finished, add your first list.)</comment> 900<comment>(Once that's finished, add your first list.)</comment>
903 901
904# <i>su mailman</i> 902# <i>su mailman</i>
905# <i>cd ~</i> 903# <i>cd ~</i>
906# <i>./bin/newlist --urlhost='www.virt-domain.com' --emailhost='virt-domain.com' test</i> 904# <i>./bin/newlist --urlhost='www.virt-domain.com' --emailhost='virt-domain.com' test</i>
907Enter the email of the person running the list: <i>your@email.address</i> 905Enter the email of the person running the list: <i>your@email.address</i>
908Initial test password: 906Initial test password:
909Hit enter to continue with test owner notification... 907Hit enter to continue with test owner notification...
910<comment>(Virtual domain lists may also be specified with 908<comment>(Virtual domain lists may also be specified with
935<comment>(Return to the root user)</comment> 933<comment>(Return to the root user)</comment>
936# <i>exit</i> 934# <i>exit</i>
937 935
938# <i>/etc/init.d/mailman start</i> 936# <i>/etc/init.d/mailman start</i>
939# <i>rc-update add mailman default</i> 937# <i>rc-update add mailman default</i>
940<comment>(To start mailman at once and on every reboot.)</comment> 938<comment>(To start mailman at once and on every reboot.)</comment>
941</pre> 939</pre>
942 940
943<pre caption="Adding mailman alias support to postfix"> 941<pre caption="Adding mailman alias support to postfix">
944# <i>nano -w /etc/postfix/main.cf</i> 942# <i>nano -w /etc/postfix/main.cf</i>
945owner_request_special = no 943owner_request_special = no
946recipient_delimiter = + 944recipient_delimiter = +
947<comment>(Read README.POSTFIX.gz for details on this.)</comment> 945<comment>(Read README.POSTFIX.gz for details on this.)</comment>
948 946
949alias_maps = 947alias_maps =
950 hash:/usr/local/mailman/data/aliases, 948 hash:/usr/local/mailman/data/aliases,
951 mysql:/etc/postfix/mysql-aliases.cf 949 mysql:/etc/postfix/mysql-aliases.cf
952 950
953virtual_alias_maps = 951virtual_alias_maps =
954 hash:/usr/local/mailman/data/virtual-mailman, 952 hash:/usr/local/mailman/data/virtual-mailman,
955 mysql:/etc/postfix/mysql-virtual.cf 953 mysql:/etc/postfix/mysql-virtual.cf
956<comment>(This adds mailman alias file support to postfix 954<comment>(This adds mailman alias file support to postfix
957You may of course use the mysql tables for this, 955You may of course use the mysql tables for this,
958but I hate doing that by hand. Also, if you are not 956but I hate doing that by hand. Also, if you are not
959using virtual domains, adding the virtual alias maps 957using virtual domains, adding the virtual alias maps
960to postfix may cause problems, be warned.)</comment> 958to postfix may cause problems, be warned.)</comment>
961</pre> 959</pre>
962 960
963<p> 961<p>
964You should now be able to setup mailing lists for any domain on your box. Last 962You should now be able to setup mailing lists for any domain on your box. Last
965note on this, make sure you run all mailman commands as the user mailman (<c>su 963note on this, make sure you run all mailman commands as the user mailman (<c>su
966mailman</c>) or else the permissions will be wrong and you'll have to fix them. 964mailman</c>) or else the permissions will be wrong and you'll have to fix them.
967Read the mailman doc's for more information on setting up and managing mailman 965Read the mailman doc's for more information on setting up and managing mailman
968lists. 966lists.
969</p> 967</p>
970 968

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59

  ViewVC Help
Powered by ViewVC 1.1.20