This article describes the process of configuring a Postfix mail server on a PC that has Redhat Enterprice as 4 U2 installed. Implementing virtual domains, virtual users, POP3, SMTP
LAMP configuration is not configured here
The software involved
1. Redhat Enterprice as 4 U5
2. Mysql
System Self-belt
Used to store information such as virtual domains, virtual users, and so on.
3. Apache
System Self-belt
4. PHP
System Self-belt
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2. Install Courier-authlib
Add Postfix and Maildrop-related users & groups before installation
Groupadd Postfix
Groupadd Postdrop
Useradd postfix-g postfix-c "postfix user"-d/dev/null-s/sbin/nologin
Groupadd Vmail
Useradd vmail-g vmail-d/home/mail
# # Special Tip 1: This is mainly to set the mail management account/process startup account. Remember that the postfix and Pstdrop groups all contain users
Postfix, Vmail group includes vmail users, you can add these users to the relevant group by directly compiling/etc/group files. While
, please keep in mind here the vmail of gi--502 and uid--501, which are used in multiple needles in the following article.
[root@mail~]# Mkdir/home/mail
[root@mail~]# chown Vmail:vmail/home/mail
[root@mail~]# chmod-r 775/home/mail
[root@mail~]# cd/usr/src/
[root@usr/src/]# tar jvxf courier-authlib-0.60.2.tar.bz2
[root@usr/src/] #cd/usr/src/courier-authlib-0.60.2
./configure--prefix=/usr/local/courier-authlib--without-authpam--without-authldap--without-authpwd- Without-authshadow--WITHOUT-AUTHVCHKPW--without-authpgsql--with-authmysql--with-mysql-libs=/usr/lib/mysql-- With-mysql-includes=/usr/include/mysql--with-redhat--with-authmysqlrc=/usr/local/courier-authlib/etc/ AUTHMYSQLRC--WITH-AUTHDAEMONRC=/USR/LOCAL/COURIER-AUTHLIB/ETC/AUTHDAEMONRC cflags= "-march=i686-o2- Fexpensive-optimizations "cxxflags="-march=i686-o2-fexpensive-optimizations "[root@usr/src/ courier-authlib-0.60.2]# make
[root@usr/src/courier-authlib-0.60.2]# make Install
[root@net-server:/]# cd/usr/local/courier-authlib/etc/
[root@usr/local/courier-authlib/etc]# CP authmysqlrc.dist AUTHMYSQLRC
[root@usr/local/courier-authlib/etc]# CP authdaemonrc.dist AUTHDAEMONRC
[root@usr/local/courier-authlib/etc]# VI AUTHDAEMONRC
Authmodulelist= "Authmysql" <--use MySQL user authentication-->
Authmodulelistorig= "Authmysql" <--use MySQL user authentication-->
Daemons=5 <--already exists, no increase in-->
Authdaemonvar=/var/spool/authdaemon <--authlib will set this path himself->
Debug_login=0 <--already exists, no increase, 2 for detailed debug mode, you can see more detailed log-->
Defaultoptions= "" <--already exists, no increase in-->
Loggeropts= "" <--already exists, no increase in-->
[root@usr/local/courier-authlib/etc]# VI AUTHMYSQLRC
mysql_server localhost <--mysql server name or IP address-->
mysql_username postfix <--mysql User name-->
Mysql_password postfix <--mysql user name password-->
Mysql_socket/var/lib/mysql/mysql.sock <--mysql SOCKET, please set according to your facts-->
Mysql_port 3306 <--mysql Port number, please set according to your facts-->
Mysql_opt 0
mysql_database postfix
Mysql_user_table Mailbox
Mysql_crypt_pwfield Password
Mysql_uid_field 501 <--mysql table, manages the UID of the authlib user. We'll use the vmail--> before.
Mysql_gid_field 502 <--mysql table, manages the GID of the authlib user. We'll use the vmail--> in the front.
### vmail---->uid:501, gid:502####
Mysql_login_field username
Mysql_home_field concat ('/home/mail/', Maildir)
Mysql_name_field NAME
Mysql_maildir_field concat ('/home/mail/', MAILDIR)
Mysql_quota_field QUOTA
Mysql_where_clause active= ' 1 '
Note that the above text cannot be connected to the database without spaces at last!!!!