[Workaround] r99 - trunk/etch

chaas at torf.workaround.org chaas at torf.workaround.org
Wed Apr 25 00:46:17 CEST 2007


Author: chaas
Date: 2007-04-25 00:46:16 +0200 (Wed, 25 Apr 2007)
New Revision: 99

Modified:
   trunk/etch/en.rest
Log:
New revision of Etch tutorial (pre-alpha!)


Modified: trunk/etch/en.rest
===================================================================
--- trunk/etch/en.rest	2007-04-24 19:08:00 UTC (rev 98)
+++ trunk/etch/en.rest	2007-04-24 22:46:16 UTC (rev 99)
@@ -40,32 +40,87 @@
 - receive and store emails for your users
 - let your users retrieve the email through IMAP and POP3 - even with SSL
   to encrypt to connection
-- relay email for your users if they are authenticated
-- offer a webmail interface to read emails in any browser
-- detect most spam emails and filter them out or tag them so the users can
-  filter them out themselves
+- receive and forward (relay) email for your users if they are authenticated
+- offer a webmail interface to read emails in a web browser
+- detect most spam emails and filter them out or tag them
 
-This document is not a simple copy-and-paste tutorial. Our intention is to
-make you understand the different components that you are using. We
-deliberately do not offer a script that will do all the setup automatically.
-But in the end you will have enough knowledge to debug problems yourself.
+This document is not a simple copy-and-paste tutorial. Our intention is to make
+you understand the different components that you are using. I deliberately do
+not offer a script that will do all the setup automatically. But in the end you
+will hopefully have enough knowledge to debug problems yourself. If you feel
+you need other people to help you please do not mail the authors directly but
+ask on the workaround-chitchat_ mailing list. Also please do not ask if you run
+anything else than Debian Etch. No, Ubuntu does not count as Debian because the
+package versions differ.
 
+The setup I describe here is not especially complicated but still needs to
+be done carefully. Do not use unless you have basic knowledge in...
 
+- MySQL (creating a database, granting access to users, SQL queries)
+- SMTP (what is is and what a basic SMTP dialog looks like)
+- POP3, IMAP (what they do and what the differences are)
+- basic Postfix configuration (understand the default settings in your
+  main.cf and have read through the *basic configuration* document)
+- Debian/Linux (general system administration, using a text editor,
+  reading log files)
+
+.. _workaround-chitchat:
+    http://workaround.org/cgi-bin/mailman/listinfo/workaround-chitchat
+
+
 Migrating from the Sarge Tutorial
 ===========================================================================
-Perhaps you have followed the former tutorial for Debian Sarge. These
-instructions should help you migrate to Etch without much pain.
-.. TODO: write this :)
+If you have followed the former tutorial for Debian Sarge then these
+instructions are supposed to help you migrate your existing ispmail server to
+Etch without too much pain. But you know how I love to throw everything away
+and try new components. :) So some parts have changed more than necessary:
 
+PostgreSQL
+----------
+The former tutorial used MySQL. Since this tutorial uses *views* which is a
+feature which is rather new to MySQL 5.0 I decided to change the server to
+PostgreSQL. If you want to stay with MySQL the setup should not be too
+different. But do not fear PostgreSQL. It is used in a lot of places
+everywhere, is as fast as MySQL and offers some interesting additional
+features. You may just be missing the *phpmyadmin* web interface to administer
+your database server. Try *pgadmin3* of *phppgadmin* as a replacement.
+Or even try the *psql* console with powerful TAB-completion.
 
+.. _PostgreSQL: http://www.postgresql.org/
+
+Normalized database tables
+--------------------------
+Formerly there was a lot of redundant information stored in the database.
+The domain name is stored in the *domains*, the *email_users* and the
+*email_forwardings* table - even multiple times. Normalized_ databases however
+store such information only once, give it a unique ID an pass the ID around.
+This reduces redundancy, speeds up database accesses (because you can compare
+indexable numbers instead of strings) and removing domains also removes
+all dependent information about virtual users of that domain and their
+email forwardings. So your database always stays in a consistant state.
+
+.. _Normalized: http://en.wikipedia.org/wiki/Database_normalization
+
+Dovecot
+-------
+Formerly I used Courier for POP3 and IMAP services. Several users have
+reported very positively on Dovecot. So Courier had to make room for
+Dovecot.
+
+.. TODO: write instructions on how to migrate
+        (including a database migration script)
+        (including pointer to etch's release notes and dist-upgrade)
+
+
 The Components
 ===========================================================================
 The configuration described here uses these components:
 
 - **Postfix** for receiving incoming emails from the internet and storing them
   to the users' mailboxes on the harddisk - or for receiving emails from your
-  users that should be sent out to the internet
+  users that should be sent out to the internet (relaying)
 - **Dovecot** to allow your users to get their emails into their email client
+  through POP3 and IMAP
 - **Squirrelmail** as a webmail interface (although any IMAP capable webmail
   interface will do)
 - **PostgreSQL** as the database system that stores information about your
@@ -80,7 +135,7 @@
 to rent domains and receive email on these domains. Have you ever wondered how
 they actually handle these thousands of domains? There is surely nobody
 entering all these domains and aliases into a *main.cf* configuration file
-manually. The solution are *virtual users*. 
+manually. The better solution deals with *virtual users*. 
 
 .. sidebar:: virtual_mailbox_maps
    
@@ -89,12 +144,11 @@
    is the email address and the right-hand side (RHS) is the location of
    the mailbox or maildir on your harddisk.
 
-Compared with
-*local users* (those who are listed in your /etc/passwd) Postfix can handle
-any number of *virtual users* on *virtual domains*. Virtual users cannot login
-and they have neither a user ID nor a home directory. But they can receive
-emails. So Postfix can work on a list of those virtual users and deliver
-emails to any directory you like. This would look like:
+Compared with *local users* (those who are listed in your /etc/passwd) Postfix
+can handle any number of *virtual users* on *virtual domains*. Virtual users
+cannot login and they have neither a user ID nor a home directory. But they can
+receive emails. So Postfix can work on a list of those virtual users and
+deliver emails to any directory you like. This would look like:
 
 ============ ========================
 Virtual user Virtual mailbox location
@@ -123,184 +177,18 @@
 ============== ========================
 
 So far the information could have been written into a text file. But you
-can imagine that this will become confusing 
+can imagine that this will become confusing quickly. Fortunately Postfix
+can also get this information from other sources like LDAP or SQL databases.
+So I am using SQL database tables here.
 
-information where their mailbox files are located on your harddisk. You can
-put all these users into a flat text file but the prettier way is to put
-them into a database table.
+You have now seen that a *mapping* assigns one value to another. If you
+query a database you need to tell Postfix which two columns you mean.
+keks
 
 ..
-   This is the old text of the Sarge tutorial:
+   This is the old text of the Sarge tutorial that hasn't been converted
+   to ReST yet:
 
-
-               <itemizedlist>
-                  <listitem>
-                     <para>Virtual domains</para>
-                     <para>
-                        In addition to your local domain (which is probably the domain
-                        that is configured in <emphasis>/etc/defaultdomain</emphasis>) you
-                        may receive email for other domains that are called virtual
-                        domains. There is no limitation on the number of domains you
-                        can receive email for. 
-                     </para>
-                  </listitem>
-                  <listitem>
-                     <para>Database lookups</para>
-                     <para>
-                        You do not need to store all the information about your users and
-                        valid email addresses in text files. Postfix supports database
-                        lookups to common DBMSs like MySQL or PostgreSQL. This approach
-                        is especially charming as you may write a web administration GUI
-                        to manage the database. You may even allow your users to take
-                        care of their email accounts themselves.
-                     </para>
-                  </listitem>
-               </itemizedlist>
-            </para>
-
-            <important>
-               The tutorial has been worked over and things have changed a little.
-               Although I have carefully tested the setup there may still be bugs in
-               this document. If in doubt please check out the <ulink
-               url="http://workaround.org/articles/ispmail-sarge/old/">previous
-               versions</ulink> of this document. If you find mistakes please mail
-               them to <ulink
-               url="mailto:workaround-chitchat at workaround.org">workaround-chitchat at workaround.org</ulink>.
-               If you are upgrading from a previous version of this tutorial please
-               follow the steps described in <xref linkend="migrating"/>.
-            </important>
-
-            <important>
-               This tutorial fits for Debian-Sarge. If you are running "Woody" you
-               need to read the <ulink
-               url="http://workaround.org/articles/ispmail/">Postfix 1.x
-               tutorial</ulink> instead.
-            </important>
-
-            <para>
-               This tutorial will introduce you to the basics of this kind of
-               configuration. If you carefully follow all the steps in this
-               document you will end up with a mail server that can handle
-               thousands of domains and user accounts. These are some features you
-               will get:
-
-               <itemizedlist>
-                  <listitem> POP3/IMAP access for your users </listitem>
-                  <listitem> Webmail access </listitem>
-                  <listitem> Virus scanning </listitem>
-                  <listitem> Spam prevention </listitem>
-                  <listitem> Secure mail relay access for road-warriors </listitem>
-                  <listitem> Easy domain administration </listitem>
-               </itemizedlist>
-            </para>
-
-            <para>
-               Although I will try to get you going quickly you will need to know
-               a few things already:
-               <itemizedlist>
-                  <listitem> MySQL (creating a database, granting access for users and how SQL queries look) </listitem>
-                  <listitem> SMTP, POP3, IMAP (I assume you have a basic knowledge of these protocols) </listitem>
-                  <listitem> Basic Postfix configuration (you should be familiar with the 'main.cf' configuration file) </listitem>
-                  <listitem> Debian/Linux (you should know basic system administration tasks like installing software or editing text files) </listitem>
-               </itemizedlist>
-            </para>
-
-         </abstract>
-         <revhistory> 
-            <revision> 
-               <date>2004-07-22</date> 
-               <revremark>
-                  Complete rewrite. Beware: the database layout has changed completely.
-               </revremark> 
-            </revision> 
-            <revision> 
-               <date>2005-04-25</date> 
-               <revremark>
-                  Maildir path has changed from user at domain/ to domain/user/.
-                  MySQL server can now be connected to as 127.0.0.1 over TCP/IP
-                  instead of the ethernet IP. Added information on how to create
-                  a database user. Added 'pre-cleanup' service to
-                  master.cf. Added database lookups for the virtual domains in
-                  the amavisd.conf. Revision numbers now come from the Subversion
-                  repository. :)
-               </revremark> 
-            </revision> 
-            <revision> 
-               <date>2005-06-30</date> 
-               <revremark>
-                  Removed the "pre-cleanup" section in the master.cf.
-                  Fixed a typo in the spam learn script.
-               </revremark> 
-            </revision> 
-            <revision> 
-               <date>2005-07-05</date> 
-               <revremark>
-                  Aliases have been evaluated both before sending it to
-                  AMaViS and when being re-injected into Postfix resulting
-                  in mails being delivered twice. This has been fixed
-                  by introducing receive_override_option=no_address_mappings
-                  to prevent aliases from being evaluated before the email
-                  is forwarded to AMaViS.
-               </revremark> 
-            </revision> 
-         </revhistory> 
-      </articleinfo>
-
-      <!-- main -->
-
-      <sect1 id="components" xreflabel="the components of the setup">
-         <title>The components</title>
-
-         <para>
-            The whole setup depends on different software components that play together nicely. Let me clarify what each of them does:
-         </para>
-
-            <itemizedlist>
-               <listitem>
-                  Postfix: Your MTA (Mail Transfer Agent) that receives emails via the
-                  SMTP (simple mail transfer protocol) and delivers them to different
-                  places on your hard disk.
-               </listitem>
-               <listitem>
-                  MySQL: The database server that stores the information to control the
-                  behaviour of postfix. It knows about users, domains, email
-                  forwardings and passwords.
-               </listitem>
-               <listitem>
-                  Courier: Courier is a standalone mail server just like Postfix. I
-                  will however just use its POP3/IMAP server component to let users
-                  access the mailboxes.
-               </listitem>
-               <listitem>
-                  SASL (the Cyrus library): If your users are dialed in at another ISP
-                  (Internet Service Provider) while they are on the road they get an IP
-                  address outside of your network. Your mail server however only trusts
-                  local IP addresses. The SASL (Simple Authentication and Security
-                  Layer) adds authentication to SMTP and makes your mail server trust
-                  them.
-               </listitem>
-               <listitem>
-                  AMaViS: A mail virus scanner that works as a content filter in
-                  Postfix. It scans incoming mail for spam pattern (using the
-                  well-known spamassassin) or viruses.
-               </listitem>
-               <listitem>
-                  phpmyadmin: A web interface to manage your local MySQL databases.
-                  It's far more comfortable than using the 'mysql' command from the
-                  command-line.
-               </listitem>
-            </itemizedlist>
-
-         <para>
-            The big picture looks something like this:
-            <mediaobject>
-               <imageobject>
-                  <imagedata fileref="bigpicture.png" format="PNG"/>
-               </imageobject>
-            </mediaobject>
-         </para>
-      </sect1>
-
       <sect1 id="mappings" xreflabel="what are mappings">
          <title>What are mappings?</title>
          <para>




More information about the Workaround-chitchat mailing list