Environment: rhel6.4 iptables and selinux disables
I. Upgrade postfix, including mysql, sasl, tls
1. Install the corresponding software:
Yum install-y db * devel make gcc mysql-devel mysql-sever cyrus *
Download the source code package;
Postfix-2.10.2.tar.gz
Tar zxf postfix-2.10.2.tar.gz
Cd postfix-2.10.2
2. view the corresponding software path:
Rpm-ql mysql-devel
Rpm-SQL cyrus-sasl-devel-2.1.23-13.el6_3.1.x8_64
Less MYSQL_README
Less TLS_README
Less SASL_README
3. Compile makefile
Make-f Makefile. init makefiles 'ccargs =-DHAS_MYSQL-I/usr/include/mysql-DUSE_SASL_AUTH-DUSE_CYRUS_SASL-I/usr/include/sasl-DUSE_TLS ''' AUXLIBS =-L/usr/lib64/ mysql-lmysqlclient-lz-lm-L/usr/lib64-lsasl2-lssl-lcrypto'
4. Upgrade:
Make update
5. Detection:
Postconf-m
Postconf-
Postconf-
6. view the version:
Postconf mail_version
2. Install MUA, including dovecot,
Yum install-y dovecot-mysql
3. Install webmail, including extmail and extman
Download the source code package:
Extman-1.1.tar.gz
Extmail-1.2.tar.gz
Mkdir/var/www/extsuite
Tar zxf extman-1.1.tar.gz-C/var/www/extsuite/
Tar zxf extmail-1.2.tar.gz-C/var/www/extsuite/
Cd/var/www/extsuite/
Music extmail-1.2/extmail
Music extman-1.1/extman
4. Install the mysql graphical Tool
Yum install-y http php-mysql
Download phpmyadmin-3.4.0-all-languages.tar.bz2
Tar jxf phpMyAdmin-3.4.0-all-languages.tar.bz2
Cp-r phpMyAdmin-3.4.0-all-languages/var/www/html/phpadmin
Cd/var/www/html/phpadmin/
Cp config. sample. inc. php config. inc. php
Vim config. inc. php
{
$ Cfg ['blowfish _ secret'] = 'westos ';
}
/Etc/init. d/httpd start
5. Configuration:
1. postfix
Vim main. cf
{
Inet_protocols = ipv4
Inet_interfaces = all
}
2. mysql
/Etc/init. d/mysqld start
Chkconfig mysqld on
Mysql_secure_installation --> westos
Import extmail. SQL and init. SQL of extmail to the database.
Vim init. SQL {modify the postmaster password: postmaster; root password: westos}
Mysql-uroot-pwestos <extmail. SQL
Mysql-uroot-pwestos <init. SQL
Link with postfix
Postconf-e virtual_uid_maps = static: 800
Postconf-e virtual_gid_maps = static: 800
Postconf-e virtual_mailbox_base =/home/email/
3. Associate postfix, dovecot. extmail with mysql
---------------------------------
Cd/etc/dovecot/
Vim conf. d/10-auth.conf
{
! Include auth-sql.conf.ext
}
In/usr/share/doc/dovecot-2.0.9/example-config
Cp dovecot-sql.conf.ext/etc/dovecot/
Cd/etc/dovecot
Vim dovecot-sql.conf.ext.
{
Driver = mysql
Connect = host = localhost dbname = extmail user = extmail password = extmail
Default_pass_scheme = plain
Password_query = \
SELECT username, domain, password \
FROM mailbox WHERE username = '% U'
User_query = SELECT maildir, 800 AS uid, 800 AS gid FROM mailbox WHERE username = '% U'
}
Vim/etc/dovecot. conf
{Listen = *}
Add email user, id = 800
Useradd-u 800 email
Vim conf. d/10-mail.conf
{
Mail_location = maildir:/home/email/% d/% n/Maildir
First_valid_uid = 800
}
---------------------------------------------------
Extmail
Cp webmail. cf. default webmail. cf
Webmail master configuration file
Vim/var/www/extmail/webmail. cf
{
SYS_AUTH_TYPE = mysql
SYS_MAILDIR_BASE =/home/email
SYS_CRYPT_TYPE = plain
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET =/var/lib/mysql. sock
}
------------------------------------------
Cd/var/www/extman/docs
Cp mysql_virtual_alias_maps.cf/etc/postfix/mysql-alias.cf
Cp mysql_virtual_domains_maps.cf/etc/postfix/mysql-domains.cf
Cp mysql_virtual_mailbox_maps.cf/etc/postfix/mysql-mailboxs.cf
Cd/var/www/extsuite/extmail/
Http VM
Less INSTALL
Vim/etc/httpd/conf/httpd. conf
{
NameVirtualHost *: 80
<VirtualHost *: 80>
DocumentRoot/var/www/html
ServerName server88.example.com
</VirtualHost>
<VirtualHost *: 80>
ServerName mail.extmail.org
DocumentRoot/var/www/extsuite/extmail/html/
ScriptAlias/extmail/cgi/var/www/extsuite/extmail/cgi
Alias/extmail/var/www/extsuite/extmail/html
SuexecUserGroup email
</VirtualHost>
}
Chown-R email. email cgi/
/Etc/init. d/httpd restart
On a real machine: vim/etc/hosts
{
192.168.0.12 mail.extmail.org
}
--------------------------------------
/Etc/init. d/httpd restart
When you log on to mail.extmail.org, some problems may occur: solution:
Yum install perl-CGI-y
Download: Unix-Syslog-1.1.tar.gz
Tar zxf Unix-Syslog-1.1.tar.gz
Cd Unix-Syslog-1.1
Yum install perl-ExtUtils-MakeMaker-y
Perl Makefile. PL
Make install
-----------------------------------------
Extman
Cd ../extman/
Master configuration file of webman
Vim webman. cf
{
SYS_MAILDIR_BASE =/home/email
SYS_SESS_DIR =/tmp
SYS_CRYPT_TYPE = plain
}
Http VM
Vim/etc/httpd/conf/httpd. conf
{
<VirtualHost *: 80>
DocumentRoot/var/www/html
ServerName server88.example.com
</VirtualHost>
<VirtualHost *: 80>
ServerName mail.extmail.org
DocumentRoot/var/www/extsuite/extmail/html/
ScriptAlias/extmail/cgi/var/www/extsuite/extmail/cgi
Alias/extmail/var/www/extsuite/extmail/html
*******************
ScriptAlias/extman/cgi/var/www/extsuite/extman/cgi
Alias/extman/var/www/extsuite/extman/html
*******************
SuexecUserGroup email
</VirtualHost>
}
Chown-R email. email cgi/
--------------------------------------------------------
Add verification code:
Download perl-GD-2.45-1.el6.rfx.x86_64.rpm
Yum localinstall perl-GD-2.45-1.el6.rfx.x86_64.rpm
Set the verification code length in webman. cf:
{SYS_CAPTCHA_LEN = 4}
-------------------------------------------------------------
The webman homepage obtains system information through the login server script under/var/www/extsuite/extman/daemon.
Add boot start:
Vim/etc/rc. local
{/Var/www/extsuite/extman/daemon/cmdserver &}
---------------------------------------------------------------
Add Graph Log to the webman webpage
Yum install rrdtool
Download rrdtool-perl-1.3.8-6.el6.x86_64.rpm
Yum localinstall rrdtool-perl-1.3.8-6.el6.x86_64.rpm
Cd/var/www/extsuite/extman/addon/
Cp-r mailgraph_ext // usr/local/
Cd/usr/local/mailgraph_ext/
Less README
./Mailgraph-init start
Download file-tail-0.99.3.tar.gz
Tar zxf File-Tail-0.99.3.tar.gz
Cd File-Tail-0.99.3
Perl Makefile. PL
Yum list perl-Time-HiRes
Yum install perl-Time-HiRes.x86_64-y
Perl Makefile. PL
Make install
Cd/usr/local/mailgraph_ext/
./Mailgraph-init restart
Add boot start
Vim/etc/rc. local
{Usr/local/mailgraph_ext/mailgraph-init restart}
---------------------------------------------------------------
If you are interested, you can add mailtoken and spamassassin to implement anti-spam and anti-virus emails.
This article is from the "linux" blog, please be sure to keep this source http://7870873.blog.51cto.com/7860873/1303964