Release
 
Part 5 - Vpopmail w/mysql

Vpopmail is one of the major components of this installation. Vpopmail allows us to do virtual domain mail hosting. It's got a lot of built in tools and features that make it a dream to work with. Even if you don't want to host mail for multiple domains, I would still recommend installing Vpopmail. It just makes the whole mail game easier. Plus, my installation centers around it, so if you don't install it you're going to have a headache.

This page details the configuration and installation of vpopmail with MySQL functionality. When used with mysql, all domain information (domain name, email users, passwords etc.) are all stored in a handy mysql database. The actual mail messages are NOT stored in the database and are still kept in the same areas as a standard vpopmail build. I would not recommend integrating mysql into vpopmail if you're only going to be hosting a few domains on your email server, but if you plan on hosting great numbers of domains then the mysql component is a practical solution. It also makes it easy to port your mail server to another machine if you ever have to upgrade or recover from a crash.

A note for NEWBIES: If you are a newbie to qmail and especially to mysql, I would strongly recommend that you NOT mess with this section and that you simply install a standard build of vpopmail. I'm not going to hold your hand on how to install mysql, how to configure mysql and how to administer a mysql server. You should only proceed with this section is you are very comfortable with mysql. I will ignore any and all newbie related questions to this section. In general, on a linux build, you will want to have both mysql-server and mysql-devel installed (along with any dependencies), but that's all l'm gonna say on the matter.

So let's install it...

If you recall, we already created a "vpopmail" system user and a "vchkpw" system group in step 2 when all the needed users and groups were created. So, now we will set up the vpopmail mysql connection config file under the vpopmail user's home directory.

mkdir ~vpopmail/etc

chown vpopmail:vchkpw ~vpopmail/etc

Obviously, you will want to substitute in your own vpopmail username and password below. You can make the username and password anything you wish.

echo "localhost|0|vpopmailuser|password|vpopmail" > ~vpopmail/etc/vpopmail.mysql

Now we set the proper ownership/permissions on the new mysql connection config file...

chown vpopmail:vchkpw ~vpopmail/etc/vpopmail.mysql

chmod 640 ~vpopmail/etc/vpopmail.mysql

The next step is to log into your mysql server as the "root" mysql user and create the vpopmail database as well as a vpopmail user with proper rights on that new database.

mysql -u root -p

Enter your mysql server's root password when prompted.

And now we create the new vpopmail database...

CREATE DATABASE vpopmail;

And we create a vpopmail user that will have access to that database.

The username and password that you create here MUST match the information that you entered in the config file above.

GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmailuser@localhost IDENTIFIED BY 'password';

And now let's quit...

quit

And let's test the new user we just created...

mysql -u vpopmailuser -p

Enter the vpopmail user's password when prompted. If you get in, you're golden. If you are denied access, you screwed up. Go back and repeat the above steps.

Ok, so that does it for the mysql setup portion. Now let's configure vpopmail to actually user the mysql functionality and then install it.

cd /downloads/qmailrocks

tar zxvf vpopmail-5.4.9.tar.gz

cd vpopmail-5.4.9

./configure --enable-logging=p --enable-auth-module=mysql --disable-passwd --enable-clear-passwd --disable-many-domains --enable-auth-logging --enable-mysql-logging --enable-valias --disable-mysql-limits

make && make install-strip

If you don't get any errors, then Vpopmail is good to go! Further ahead in the installation, we'll create domains under vpopmail. At that time, if you wish, you can log back into mysql and confirm that the mysql entries have been created for the domain(s) you add.

Wait! I'm getting an error! What do I do?

If you are using GCC version 3.x, you may get a compilation error similar to this:

In file included from vconvert.c:35:
vmysql.h:53:22: missing terminating " character
vmysql.h:60:35: missing terminating " character
make[2]: *** [vconvert.o] Error 1

If you get this error, you will need to apply a patch to Vpopmail:

patch < /downloads/qmailrocks/patches/vmysql.patch

Once you've applied the patch, try running "make" and "make install" again and you should be ok.

So now let's go on to part 6...

Proceed to Part 6

 

Color Coded Qmail Installation Key
 
Regular Black Text 
 Qmail installation notes and summaries by the author. Me talking.
 
Bold Black Text 
 Commands to be run by you, the installer.
 
Bold Maroon Text 
 Special notes for Redhat 9 users.
 
Bold Red Text 
 Vital and/or critical information.
 
Regular/Bold Purple text 
 Denotes helpful tips and hints or hyperlinks.
 
Regular Orange Text 
 Command line output.
Cp

Regular green text 

 Denotes the contents of a file or script.
home | about | the installation | utilities | faq | contact | journal | mailing list | list archive | forum | links | donatemerchandise
modified
This mirror last modified: Thursday, August 9th, 2012 15:59:44 CEST
 
The Rocks Project