Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 385601 - Virtual Mail Howto: MySQL Script Varies From Instructions
Summary: Virtual Mail Howto: MySQL Script Varies From Instructions
Status: RESOLVED OBSOLETE
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Docs Team
URL: http://www.gentoo.org/doc/en/virt-mai...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-04 12:05 UTC by John L. Poole
Modified: 2013-07-23 14:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John L. Poole 2011-10-04 12:05:54 UTC
Two issues:
1) I suggest having sample commands in MySQL for convenience; where the documentation states:

 "Your new database has default values and tables set up for two domains. The following tables are included: " 

provide an example such as:

mysql> show tables;
+-------------------+
| Tables_in_mailsql |
+-------------------+
| alias             |
| relocated         |
| transport         |
| users             |
| virtual           |
+-------------------+
5 rows in set (0.00 sec)

mysql> 

or at least cue the reader into "show tables" to list the tables.  Coming from other databases, your asking the user to go look up how to list tables when you can effectively provide them the command in about the same about of words.

2) the script, genericsql.sql does not create the tables as described in the documentation, specifically the "virtual" table is not populated.  Here's the output of what the genericsql.sql script created:

mysql> select * from alias
    -> ;
+----+------------+-----------------------+
| id | alias      | destination           |
+----+------------+-----------------------+
|  1 | root       | root@domain.com       |
|  2 | postmaster | postmaster@domain.com |
+----+------------+-----------------------+
2 rows in set (0.00 sec)

mysql> select * from relocated;
Empty set (0.00 sec)

mysql> select * from transport;
+----+-------------+-------------+
| id | domain      | destination |
+----+-------------+-------------+
|  1 | domain.com  | local:      |
|  2 | domain2.com | virtual:    |
+----+-------------+-------------+
2 rows in set (0.00 sec)

mysql> select * from users;
+----+--------------------+----------+-------------------------------------------+------+------+-------------+------------------------------------------+-------+---------+
| id | email              | clear    | name                                      | uid  | gid  | homedir     | maildir                                  | quota | postfix |
+----+--------------------+----------+-------------------------------------------+------+------+-------------+------------------------------------------+-------+---------+
|  1 | first@domain.com   | password | first local user                          | 1200 | 1200 | /home/first | /home/first/.maildir/                    |       | y       |
|  2 | second@domain2.com | password | second user who lives in a virtual domain | 1101 | 1101 | /home/vmail | /home/vmail/domain2.com/second/.maildir/ |       | y       |
+----+--------------------+----------+-------------------------------------------+------+------+-------------+------------------------------------------+-------+---------+
2 rows in set (0.00 sec)

mysql> select * from virtual;
Empty set (0.00 sec)

mysql>

Also, you might just give a sample SQL "select * from alias" to help the user quickly duplicate the output you show.



Reproducible: Always
Comment 1 John L. Poole 2011-10-04 12:17:43 UTC
Adding a third item:

The instructions direct you to install apache (presuming plain vanilla install).  However, later when the command:

cp /etc/ssl/misc/new.cert.cert /etc/apache2/ssl/

is provided, it assumes there is an "ssl" directory under /etc/apache2.  That is not the case for a plain install of apache:

atom apache2 # cp /etc/ssl/misc/new.cert.cert /etc/apache2/ssl/
cp: cannot create regular file `/etc/apache2/ssl/': Is a directory
atom apache2 #

This suggests that author already had ssl configured and has left out whatever instructions, or perhaps the creation of the directory "ssl" is what is needed.  At any rate, it's ambiguous leaving the reader to wonder if they need to perfect an Apache SSL install, or simply add a directory "ssl" to move forward.
Comment 2 John L. Poole 2011-10-04 12:36:08 UTC
A fourth point:

I have "ssl" included in my /etc/makc.conf USE variables, so my instance of Apache (2.2.21 9/16/2011) was built with SSL.  It appears the current version of apache has their SSL certificates under /etc/ssl/apache2.

Question:  you have the steps in the HOW-TO to create SSL certificates, should that step be qualified to reflect which version of apache one is working with as it appears that step may not be necessary?  Or is it intended that a separate certificate be utilized for this postfix install?  

my file /etc/apache2/vhosts.d/00_default_ssl_vhost.conf has in it:

        ## Server Certificate:
        # Point SSLCertificateFile at a PEM encoded certificate. If the certificate
        # is encrypted, then you will be prompted for a pass phrase. Note that a
        # kill -HUP will prompt again. Keep in mind that if you have both an RSA
        # and a DSA certificate you can configure both in parallel (to also allow
        # the use of DSA ciphers, etc.)
        SSLCertificateFile /etc/ssl/apache2/server.crt

        ## Server Private Key:
        # If the key is not combined with the certificate, use this directive to
        # point at the key file. Keep in mind that if you've both a RSA and a DSA
        # private key you can configure both in parallel (to also allow the use of
        # DSA ciphers, etc.)
        SSLCertificateKeyFile /etc/ssl/apache2/server.key

That Apache may, by default, point to already made keys is something that might be mentioned at the stage where you have the user create certificates.
Comment 3 nm (RETIRED) gentoo-dev 2012-07-08 23:24:50 UTC
we need to see a patch for these suggestions...preferably in diff -Nut format for readability. thanks.
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2013-07-23 14:25:03 UTC
I've obsoleted the document and am now referring to https://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server on the Gentoo Wiki.

If stuff from the original document needs to be ported to the complete virtual mail server article, its "wiki-style" version can be found at https://wiki.gentoo.org/wiki/User:SwifT/Wikified_but_not_merged_documents/Virtual_mail_HOWTO