slinux 和iptables都关掉!!!!!!!
发信
mkdir /var/www/extsuite
lftp 192.168.0.254
cd /pub/docs/extmail
get extmail-1.2.tar.gz extman-1.1.tar.gz
tar zxf extmail-1.2.tar.gz -C /var/www/extsuite/
tar zxf extman-1.1.tar.gz -C extman-1.1.tar.gz
cd /var/www/extsuite/
mv extmail-1.2/ extmial
mv extman-1.1/ extman
cd extmail/
ls
cp webmail.cf.default webmail.cf
cd ../extman/docs
mysql < extmial.sql
vi init.sql
INSERT INTO `mailbox` VALUES ('postmaster@extmail.org','postmaster','westos','','PostMaster','
LOCK TABLES `manager` WRITE;
INSERT INTO `manager` VALUES ('root@extmail.org','westos','admin','root',
mysql < init.sql
cp mysql_virtual_alias_maps.cf /etc/postfix/ ‘y’//覆盖以前的
cp mysql_virtual_domains_maps.cf /etc/postfix/ ‘y’//覆盖以前的
cp mysql_virtual_mailbox_maps.cf /etc/postfix/ ‘y’//覆盖以前的
postmap -q 'support@exmail.org' mysql:/etc/postfix/mysql-alias.cf
postmap -q 'support@extmail.org' mysql:/etc/postfix/mysql-alias.cf
postmap -q 'postmaster@extmail.org' mysql:/etc/postfix/mysql-mailboxs.cf
postmap -q 'extmail.org' mysql:/etc/postfix/mysql-domains.cf //以上三条是进行测试邮件的设置是否正确
postfix reload
收信
dovecot的收信设置
cd /etc/dovecot/conf.d/
vi 10-mail.conf
mail_location = maildir:/home/vmail/%d/%n/Maildir
vi ../dovecot-sql.conf.ext
connect = host=localhost dbname=extmail user=extmail password=extmail
password_query = \
SELECT username, domain, password \
FROM mailbox WHERE username = '%u'
userid = '%u'
user_query = SELECT maildir, 700 AS uid, 700 AS gid FROM mailbox WHERE username = '%u'
/etc/init.d/dtelovecot restart
telnet localhost 110
user postmaster@extmail.org
pass westos
list
quit
测试完成
web搭建收信模式
vi /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName desktop1.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 vmail vmail
</VirtualHost>
以上的配置文件中直接在
cd /var/www/extsuite/
cd extman
vi INSTALL 在这个文件中copy里apache配置文件中所需要的条目
cd ../extmail/
vi INSTALL 中也同上面一样
chown vmail.vmail cgi/ -R
cd ../extman
chown vmail.vmail cgi/ -R
yum install perl-CGI -y
vi webmail.cf
SYS_SESS_DIR = /tmp
SYS_LOG_ON = 0
SYS_MAILDIR_BASE = /home/vmail
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock
cd ../extman/
vi webman.cf
SYS_MAILDIR_BASE = /home/vmail
SYS_SESS_DIR = /tmp/
SYS_CAPTCHA_ON = 0
/etc/init.d/httpd restart
/etc/init.d/dovecot restart
/etc/init.d/mysqld restart
配置完成
进行apache测试
转载于:https://blog.51cto.com/josion/695767