/[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.9 Revision 1.12
41<p>The following packages are used in this setup: 41<p>The following packages are used in this setup:
42 42
43 apache, courier-imap, pam_mysql, postfix, mod_php, mod_ssl, phpmyadmin, squirrelmail, cyrus-sasl, mysql, php, and mailman.</p> 43 apache, courier-imap, pam_mysql, postfix, mod_php, mod_ssl, phpmyadmin, squirrelmail, cyrus-sasl, mysql, php, and mailman.</p>
44<p>Make sure to turn on the following USE variables in <path>/etc/make.conf</path> before compiling the packages: <c>USE=&quot;mysql imap libwww maildir sasl ssl&quot;</c>. Otherwise you will most likely have to recompile things to get the support you need for all the protocols. Further, it's a good idea to turn off any other mail and network variables, like ipv6.</p> 44<p>Make sure to turn on the following USE variables in <path>/etc/make.conf</path> before compiling the packages: <c>USE=&quot;mysql imap libwww maildir sasl ssl&quot;</c>. Otherwise you will most likely have to recompile things to get the support you need for all the protocols. Further, it's a good idea to turn off any other mail and network variables, like ipv6.</p>
45<impo>This howto was written for postfix-2.0.x. If you are using postfix &lt; 2 some of the variables in this document will be different. It is recommended that you upgrade. Some other packages included in this howto are version sensitive as well. You are advised to read the documentation included with packages if you run into issues with this.</impo> 45<impo>This howto was written for postfix-2.0.x. If you are using postfix &lt; 2 some of the variables in this document will be different. It is recommended that you upgrade. Some other packages included in this howto are version sensitive as well. You are advised to read the documentation included with packages if you run into issues with this.</impo>
46<impo>This document uses apache-1.3.x. Apache-2 has been marked stable in portage. However there are still a number of issues with php integration. Until php support in apache-2.0.x is marked stable, this guide will continue to use the 1.3.x version.</impo>
46<impo>You need a domain name to run a public mail server, or at least an MX record for a domain. Ideally you would have control of at least two domains to take advantage of your new virtual domain functionality.</impo> 47<impo>You need a domain name to run a public mail server, or at least an MX record for a domain. Ideally you would have control of at least two domains to take advantage of your new virtual domain functionality.</impo>
47<impo>Make sure <path>/etc/hostname</path> is set to the right hostname for your mail server. Verify your hostname is set correctly with <c>hostname</c>. Also verify that there are no conflicting entries in <path>/etc/hosts</path>.</impo> 48<impo>Make sure <path>/etc/hostname</path> is set to the right hostname for your mail server. Verify your hostname is set correctly with <c>hostname</c>. Also verify that there are no conflicting entries in <path>/etc/hosts</path>.</impo>
48<note>It is recommended that you read this entire document and familiarize yourself with all the steps before attempting the install. If you run into problems with any of the steps, check the troubleshooting guide at the end of this document. Also, not all the referenced packages are necessary, this set up is very flexible. For instance, if you do not desire a web interface, feel free to skip the squirrelmail section.</note> 49<note>It is recommended that you read this entire document and familiarize yourself with all the steps before attempting the install. If you run into problems with any of the steps, check the troubleshooting guide at the end of this document. Also, not all the referenced packages are necessary, this set up is very flexible. For instance, if you do not desire a web interface, feel free to skip the squirrelmail section.</note>
49</body> 50</body>
50</chapter> 51</chapter>
121<pre caption="Configuring and installing the cyrus-sasl ebuild" > 122<pre caption="Configuring and installing the cyrus-sasl ebuild" >
122 # <i>USE='-ldap -mysql' emerge cyrus-sasl</i> 123 # <i>USE='-ldap -mysql' emerge cyrus-sasl</i>
123<codenote>We don't have ldap and we're not using sasl's mysql capabilities </codenote> 124<codenote>We don't have ldap and we're not using sasl's mysql capabilities </codenote>
124<codenote>so we need to turn them off for this build.</codenote> 125<codenote>so we need to turn them off for this build.</codenote>
125</pre> 126</pre>
126<p>Next, edit <path>/var/lib/sasl2/smtp.conf</path>.</p> 127<p>Next, edit <path>/usr/lib/sasl2/smtp.conf</path>.</p>
127<pre caption="Starting sasl" > 128<pre caption="Starting sasl" >
128 # <i>nano -w /var/lib/sasl2/smtp.conf</i> 129 # <i>nano -w /usr/lib/sasl2/smtp.conf</i>
129 pwcheck_method: saslauthd 130 pwcheck_method: saslauthd
130 mech_list: LOGIN PLAIN 131 mech_list: LOGIN PLAIN
131<codenote>It's important to turn off auth mehtods we are not using.</codenote> 132<codenote>It's important to turn off auth mehtods we are not using.</codenote>
132<codenote>They cause problems for some mail clients.</codenote> 133<codenote>They cause problems for some mail clients.</codenote>
133 # <i>/etc/init.d/saslauthd start</i> 134 # <i>/etc/init.d/saslauthd start</i>
255<body> 256<body>
256<p>Next we're going to install and configure MySQL. You'll need the <uri link="http://kickasskungfu.com/~ken/genericmailsql.sql" >genericmailsql.sql</uri> dumpfile for this step.</p> 257<p>Next we're going to install and configure MySQL. You'll need the <uri link="http://kickasskungfu.com/~ken/genericmailsql.sql" >genericmailsql.sql</uri> dumpfile for this step.</p>
257<pre caption="Installing and configuring MySQL" > 258<pre caption="Installing and configuring MySQL" >
258 # <i>emerge mysql</i> 259 # <i>emerge mysql</i>
259 260
260 # <i>/usr/sbin/mysql_install_db</i> 261 # <i>/usr/bin/mysql_install_db</i>
261<codenote>After this command runs follow the onscreen directions</codenote> 262<codenote>After this command runs follow the onscreen directions</codenote>
262<codenote>for adding a root password with mysql,</codenote> 263<codenote>for adding a root password with mysql,</codenote>
263<codenote>not mysqladmin, otherwise your db will be wide open.</codenote> 264<codenote>not mysqladmin, otherwise your db will be wide open.</codenote>
264 265
265 # <i>/etc/init.d/mysql start</i> 266 # <i>/etc/init.d/mysql start</i>
266 # <i>mysqladmin -u root -p create mailsql</i> 267 # <i>mysqladmin -u root -p create mailsql</i>
267 # <i>mysql -u root -p --opt mailsql &lt; genericmailsql.sql</i> 268 # <i>mysql -u root -p mailsql &lt; genericmailsql.sql</i>
268 269
269 # <i>mysql -u root -p mysql</i> 270 # <i>mysql -u root -p mysql</i>
270 mysql> <i>GRANT SELECT,INSERT,UPDATE,DELETE</i> 271 mysql> <i>GRANT SELECT,INSERT,UPDATE,DELETE</i>
271 -> <i>ON mailsql.*</i> 272 -> <i>ON mailsql.*</i>
272 -> <i>TO mailsql@localhost</i> 273 -> <i>TO mailsql@localhost</i>
320<li>SSLCertificateFile /path/to/certs/new.cert.cert</li> 321<li>SSLCertificateFile /path/to/certs/new.cert.cert</li>
321<li>SSLCertificateKeyFile /path/to/certs/new.cert.key</li> 322<li>SSLCertificateKeyFile /path/to/certs/new.cert.key</li>
322</ul> 323</ul>
323</p> 324</p>
324<pre caption="Install Apache SSL certificates" > 325<pre caption="Install Apache SSL certificates" >
325 # <i>cp /usr/lib/ssl/misc/new.cert.cert /etc/apache/conf/ssl/</i> 326 # <i>cp /etc/ssl/misc/new.cert.cert /etc/apache/conf/ssl/</i>
326 # <i>cp /usr/lib/ssl/misc/new.cert.key /etc/apache/conf/ssl/</i> 327 # <i>cp /etc/ssl/misc/new.cert.key /etc/apache/conf/ssl/</i>
327 # <i>nano -w /etc/apache/conf/vhosts/ssl.default-vhost.conf</i> 328 # <i>nano -w /etc/apache/conf/vhosts/ssl.default-vhost.conf</i>
328<codenote>Change the following parameters</codenote> 329<codenote>Change the following parameters</codenote>
329 330
330 ServerName host.domain.name 331 ServerName host.domain.name
331 ServerAdmin your@email.address 332 ServerAdmin your@email.address
553</chapter> 554</chapter>
554<chapter> 555<chapter>
555<title>Mailman</title> 556<title>Mailman</title>
556<body> 557<body>
557<p>Last step: mailman. The new version of mailman has very nice virtual domain support, which is why I use it, not to mention it's really a great package. To get this package installed and working correctly for virtual domains is going to require a bit of hacking. I really recommend reading all of the mailman documentation, including README.POSTFIX.gz, to understand what's being done here.</p> 558<p>Last step: mailman. The new version of mailman has very nice virtual domain support, which is why I use it, not to mention it's really a great package. To get this package installed and working correctly for virtual domains is going to require a bit of hacking. I really recommend reading all of the mailman documentation, including README.POSTFIX.gz, to understand what's being done here.</p>
559<p>One further note, current versions of mailman install to /usr/local/mailman. If you're like me and wish to change the default install location, it can be overridden in the ebuild filoe by changing the INSTALLDIR variable.</p>
558<pre caption="/usr/portage/net-mail/mailman/mailman-$ver.ebuild"> 560<pre caption="/usr/portage/net-mail/mailman/mailman-$ver.ebuild">
559 # <i>nano -w /usr/portage/net-mail/mailman/mailman-$ver.ebuild</i> 561 # <i>nano -w /usr/portage/net-mail/mailman/mailman-$ver.ebuild</i>
560 MAILGID="280" 562 MAILGID="280"
561 <codenote>Set MAILGID to the mailman group instead of nobody</codenote> 563 <codenote>Set MAILGID to the mailman group instead of nobody</codenote>
562 <codenote>This is needed for postfix integration</codenote> 564 <codenote>This is needed for postfix integration</codenote>
563</pre> 565</pre>
564<pre> 566<pre>
565 # <i>emerge mailman</i> 567 # <i>emerge mailman</i>
566<codenote>This package is currently masked as well, so you'll need to unmask it or give </codenote> 568<codenote>This package is currently masked as well, so you'll need to unmask it or give </codenote>
567<codenote>emerge an explicit path to the ebuild. Once it's installed, follow the directions</codenote> 569<codenote>emerge an explicit path to the ebuild. Once it's installed, follow the directions</codenote>
568<codenote>in the README.gentoo.gz</codenote> 570<codenote>in the README.gentoo.gz *except* do not add your aliases to /etc/mail/aliases.</codenote>
571<codenote>We will instead be linking the entire alias db into postfix.</codenote>
569 572
570 # <i>zless /usr/share/doc/mailman-$ver/README.gentoo.gz</i> 573 # <i>zless /usr/share/doc/mailman-$ver/README.gentoo.gz</i>
574</pre>
575<pre caption="Setting defaults: Mailman/Defaults.py">
576 # <i> nano -w /var/mailman/Mailman/Defaults.py</i>
577<codenote>Change the values below to reflect your primary domain, virtuals will be set next.</codenote>
578 DEFAULT_EMAIL_HOST = 'domain.com'
579 DEFAULT_URL_HOST = 'www.domain.com'
571</pre> 580</pre>
572<pre caption="mailman config: mm_cfg.py"> 581<pre caption="mailman config: mm_cfg.py">
573 # <i>nano -w /var/mailman/Mailman/mm_cfg.py</i> 582 # <i>nano -w /var/mailman/Mailman/mm_cfg.py</i>
574 MTA = "Postfix" 583 MTA = "Postfix"
575 POSTFIX_STYLE_VIRTUAL_DOMAINS = ['virt-domain.com', 'virt.domain2.com'] 584 POSTFIX_STYLE_VIRTUAL_DOMAINS = ['virt-domain.com', 'virt.domain2.com']
625 virtual_alias_maps = 634 virtual_alias_maps =
626 hash:/var/mailman/data/virtual-mailman, 635 hash:/var/mailman/data/virtual-mailman,
627 mysql:/etc/postfix/mysql-virtual.cf 636 mysql:/etc/postfix/mysql-virtual.cf
628 <codenote>This adds mailman alias file support to postfix</codenote> 637 <codenote>This adds mailman alias file support to postfix</codenote>
629 <codenote>You may of course use the mysql tables for this,</codenote> 638 <codenote>You may of course use the mysql tables for this,</codenote>
630 <codenote>but I hate doing that by hand.</codenote> 639 <codenote>but I hate doing that by hand. Also, if you are not</codenote> <codenote>using virtual domains, adding the virtual alias maps</codenote>
640 <codenote>to postfix may cause problems, be warned.</codenote>
631</pre> 641</pre>
632<p> You should now be able to setup mailing lists for any domain on your box. Last note on this, make sure you run all mailman commands as the user mailman (<c>su mailman</c>) or else the permissions will be wrong and you'll have to fix them. Read the mailman doc's for more information on setting up and managing mailman lists.</p> 642<p> You should now be able to setup mailing lists for any domain on your box. Last note on this, make sure you run all mailman commands as the user mailman (<c>su mailman</c>) or else the permissions will be wrong and you'll have to fix them. Read the mailman doc's for more information on setting up and managing mailman lists.</p>
633</body> 643</body>
634</chapter> 644</chapter>
635<chapter> 645<chapter>

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20