Linux学习之邮件服务器

服务器数据库
 
[root@localhost ~]# yum install mysql-server -y
 
[root@localhost ~]# /etc/init.d/mysqld start
 
[root@localhost ~]# mysql_secure_installation 设置密码为westos
 
[root@localhost ~]# yum install httpd -y
 
[root@localhost ~]# lftp 192.168.0.1
 
lftp 192.168.0.1:/pub/postfix> get extmail-1.2.tar.gz extman-1.1.tar.gz
 
[root@localhost ~]# tar zxf extman-1.1.tar.gz
 
[root@localhost ~]# tar zxf extmail-1.2.tar.gz
 
[root@localhost ~]# cd extman-1.1/docs/
 
[root@localhost docs]# mysql -pwestos < extmail.sql
 
[root@localhost docs]# vim init.sql
 

INSERT INTO `mailbox` VALUES ('postmaster@extmail.org','postmaster','westos','','PostMaster','','extmail.org/postmaster/Maildir/','extmail.org/postmaster','104857600S','52428800S','extmail.org',1000,1000,'2007-02-14 15:10:04','2010-11-08',1,0,0,0,0,0,0,0,'my question','my answer');
 
INSERT INTO `manager` VALUES ('root@extmail.org','westos','admin','root','Super User','my question','my answer','0','2007-02-14 15:10:04','2010-11-08',1);
 

[root@localhost docs]# mysql -pwestos < init.sql
 

[root@localhost docs]# useradd -u 800 vmail
 
[root@localhost docs]# postconf -e virtual_mailbox_base=/home/vmail/
 
[root@localhost docs]# postconf -e virtual_uid_maps=static:800
 
[root@localhost docs]# postconf -e virtual_gid_maps=static:800
 

[root@localhost docs]# cp mysql_virtual_alias_maps.cf mysql_virtual_domains_maps.cf mysql_virtual_mailbox_maps.cf /etc/postfix/
 
[root@localhost postfix]# postconf -e virtual_alias_maps=mysql:/etc/postfix/mysql_virtual_alias_maps.cf
 
[root@localhost postfix]# postconf -e virtual_mailbox_domains=mysql:/etc/postfix/mysql_virtual_domains_maps.cf
 
[root@localhost postfix]# postconf -e virtual_mailbox_maps=mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
 

[root@localhost postfix]# postfix reload
 
[root@localhost postfix]# yum install mailx-12.4-6.el6.x86_64 -y
 

[root@localhost postfix]# mail support@extmail.org
 
Subject: test
 
qwertyuiop
 
asdfghjkl
 
EOT
 
[root@localhost postfix]# mailq
 
Mail queue is empty
 
这时候,在/home/vmail/extmail.org/postmaster/Maildir/new下会有一封新的邮件
 

3月30日 第二天从这里开始
 
[root@localhost docs]# mkdir /var/www/extsuite
 
[root@localhost ~]# mv extman-1.1 /var/www/extsuite/extman
 
[root@localhost ~]# mv extmail-1.2 /var/www/extsuite/extmail
 
[root@localhost ~]# cd /var/www/extsuite/
 
[root@localhost extsuite]# chown vmail.vmail * -R
 

[root@localhost extsuite]# cp extmail/webmail.cf.default extmail/webmail.cf
 
[root@localhost extsuite]# cp extman/webman.cf.default extman/webman.cf
 
/etc/httpd/conf/httpd.conf 加入
 
NameVirtualHost *:80
 
<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>
 

主机名修改为mail.extmail.org
 
[root@localhost extsuite]# /etc/init.d/httpd restart
 

[root@localhost extsuite]# vi extmail/webmail.cf
 
修改配置文件extmail/webmail.cf
 
SYS_LOG_ON = 0
 
SYS_MAILDIR_BASE = /home/vmail
 
SYS_CRYPT_TYPE = plain
 
SYS_MYSQL_USER = extmail
 
SYS_MYSQL_PASS = extmail

修改配置文件extman/webman.cf
 
SYS_CAPTCHA_ON = 0
 
SYS_MAILDIR_BASE = /home/vmail
 
SYS_SESS_DIR = /tmp/
 
SYS_CRYPT_TYPE = plain
 
SYS_MYSQL_USER = webman
 
SYS_MYSQL_PASS = webman


[root@localhost extsuite]# yum install perl-CGI -y

客户端192.168.0.1做192.168.0.146 mail.extmail.org解析
 
访问mail.extmail.org 用户 uname:postmaster passwd:westos
 
管理员 passwd:westos
 
后台运行,管理员可查看系统信息
 
[root@localhost extsuite]# /var/www/extsuite/extman/daemon/cmdserver &


接下来添加功能
 
1.打开LOG功能记录登录状况
 
修改配置文件extmail/webmail.cf
 
SYS_LOG_ON = 1

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/60f41d1d6ecde53e974d58bd02f570d4.html