|
CentOS Linux Server Guide |
Postfix Mail System - Step by Step GuidePart 2: Create Virtual User, Configure Postfix, Dovecot and Mysql |
||||||||||||||||
|
This is the Part2 of the Posft Mail System, we are going to configure the following:- 1. MySQL Server, create a postfixadmin database 2. Postfix Main.cf and create a virtual user file and virtual domain configuration files 3. Dovecot
Create Mysql Username, Password and Postfixadmin database
Step1: Start your mysqlLet us start up the mysql now. Also,we want the service to be auto-startup for whenever the system is under Level 3,4,5
Step2: Create mysql root user passwordFirst we need to create a password for our root access. I also perform a new test to ensure that no blank password is accepted.
Step3: Create Postfixadmin databaseNext,we create a database named postfix and the create a user called 'mail'. Then we will give full access rights for 'mail' on postfix database.
Create Postfixadmin User
Step1: Create a non-root user for postfixadminLet us create a non-root user for our postfixa & pop administration purposes.
Now, get a paper and write down the user id & group id of vmail.
Configure PostfixStep1: Configure the postfix main.cf fileFirst modify the /etc/postfix/main.cf. We change the following lines Note: Number in blue are line numbers. You can active it using :set nu under vi command mode
Next, Add in the following lines, this will tell the system to look for postfix configuration, its virtual domains, virtual users and aliases.
The virtual_uid_maps : static:501. This 501 is the id of my vmail. Change this if you have diffrent id for your uid and gid.
Step2: Configure the postfix mysql-domians.cf fileThe following configuration will create mysql-domains.cf. This will enable postfixadmin to create virtual domain
Step3: Configure the postfix mysql-users.cf fileThe following configuration will create mysql-users.cf. This will enable postfixadmin create virtual users
Step2: Configure the postfix mysql-alias.cf fileGreat, the last part we should do now is to connect the postfixadmin to mysql
Configuring Dovecot
Step 1 Check if the dovecot packages installed
Step 2 Create mysql config file for postfixadminCreate the file /etc/dovecot-mysql.conf containing the lines below. You might need to change your username, password and db user.
Now, This is very import part, many users including me :p that make mistake on the setting. First di a backup!
Next edit the file /etc/dovecot.conf and change the value of the following keys below. For line 917 please make sure that your uid and gid is the same as your vmail user. Make sure you remove # sign for all the following lines. Also, comment out all passdb and userdb setting. Then, make a dovecot.log to ease any dovecot troubleshooting.
Step3 Start you dovecot servicesFinally startup your dovecot services.
|
||||||||||||||||
|
Back to Step by Step Guide on CentOS Linux Postfix Mail Server |
|
Copyright 2011 http://www.1a-centosserver.com All Rights Reserved All trademarks are the property of their respective owners. Contact Us | Terms of Use | Privacy Policy |