您的位置:首页 > 其它

借助postfix搭建基于虚拟账户的邮件服务器

2012-09-20 20:51 381 查看
一、服务器的基本配置 1.1配置本地IP地址
[root@localhost ~]# setup












点击ok — save — save&quit — quit 保存配置,退出
重新启动网络配置
[root@localhost ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]



1.2更改dns指向以及主机名
[root@localhost ~]# vim /etc/resolv.conf
nameserver 192.168.2.65
[root@localhost ~]# vim /etc/sysconfig/network
HOSTNAME=mail.sh.abc.com
[root@localhost ~]# hostname mail.sh.abc.com
##在终端上执行这个不用在重启系统,重新登录系统即可
二、搭建dns服务器 2.1安装dns服务器 [root@localhost ~]# mkdir /mnt/cdrom
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom
[root@localhost ~]# cd /mnt/cdrom/Server/
[root@localhost Server]# rpm -ivh bind-9.3.6-4.P1.el5.i386.rpm
[root@localhost Server]# rpm -ivh bind-chroot-9.3.6-4.P1.el5.i386.rpm
[root@localhost Server]# rpm -ivh caching-nameserver-9.3.6-4.P1.el5.i386.rpm
2.2编辑dns的配置文件 [root@localhost ~]# cd /var/named/chroot/etc/
[root@localhost etc]# cp -p named.caching-nameserver.conf named.conf
[root@localhost etc]# vim named.conf
15 listen-on port 53 { any; };
27 allow-query { any; };
28 allow-query-cache { any; };
37 match-clients { any; };
38 match-destinations { any; };



2.3配置区域声明文件:声明正向解析区域 [root@localhost etc]# vim named.rfc1912.zones
27 zone "sh.abc.com" IN {
28 type master;
29 file "sh.abc.zone";
30 allow-update { none; };
31 };



2.4声明反向解析区域 33 zone "3.168.192.in-addr.arpa" IN {
34 type master;
35 file "sh.abc. local";
36 allow-update { none; };
37 };




2.5生成域文件 [root@localhost etc]# cd ../var/named/
[root@localhost named]# cp -p localhost.zone sh.abc.zone
[root@localhost named]# cp -p named.local sh.abc.local
2.6编辑正向解析域文件 [root@localhost named]# vim sh.abc. zone



2.7编辑反向解析域文件 [root@localhost named]# vim sh.abc.local



2.8启动dns服务器 [root@localhost named]# service named start
[root@localhost named]#chkconfig named on
2.9测试DNS服务器






2.10关闭sendmail,并将它的随系统自动启动功能关闭
[root@mail ~]# service sendmail stop
Shutting down sm-client: [ OK ]
Shutting down sendmail: [ OK ]
[root@mail ~]# chkconfig sendmail off
2.11安装所需的rpm包,这包括以下这些
httpd, php, php-mysql, mysql, mysql-server, mysql-devel, openssl-devel, dovecot, perl-DBD-MySQL, tcl, tcl-devel, libart_lgpl, libart_lgpl-devel, libtool-ltdl, libtool-ltdl-devel, expect
这里用yum进行安装,如何搭建yum环境。
[root@mail ~]# yum install httpd php php-mysql mysql mysql-server mysql-devel openssl-devel dovecot perl-DBD-MySQL tcl tcl-devel libart_lgpl libart_lgpl-devel libtool-ltdl libtool-ltdl-devel expect -y
2.12安装完成之后,启动mysql并设置为开机启动
[root@mail ~]# service mysqld start
[root@mail ~]# chkconfig mysqld on
[root@mail ~]# mysql
2.13设置mysql管理员密码 授权本地用户
mysql> SET PASSWORD FOR root@'localhost'=PASSWORD('redhat');
Query OK, 0 rows affected (0.00 sec)
mysql> SET PASSWORD FOR root@'127.0.0.1'=PASSWORD('redhat');
Query OK, 0 rows affected (0.00 sec)
刷新数据库
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
授权远程用户
mysql> GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)
刷新数据库
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
以上可以用下面指令代替
[root@mail ~]# mysqladmin -u root password 'redhat'
2.14启动saslauthd服务,并将其加入到自动启动队列
[root@mail ~]# service saslauthd start
Starting saslauthd: [ OK ]
[root@mail ~]# chkconfig saslauthd on
2.15查看是否安装以下开发所用到的rpm包组 [root@mail ~]# yum grouplist
Development Libraries
Development Tools
Legacy Software Development
X Software Development
方法:
# yum groupinstall "packge_group_name"

三、安装并配置postfix 3.1新建用户并以安全方式运行进程
[root@mail ~]# groupadd -g 2525 postfix
[root@mail ~]# useradd -g postfix -u 2525 -s /sbin/nologin -M postfix
[root@mail ~]# groupadd -g 2526 postdrop ##邮件投递组 2526代表组id号,随意起
[root@mail ~]# useradd -g postdrop -u 2526 -s /bin/false -M postdrop
3.2解压缩postfix后编译并安装
[root@mail ~]# tar zxvf postfix-2.8.2.tar.gz -C /usr/local/src
[root@mail ~]# cd /usr/local/src/postfix-2.8.2/
[root@mail postfix-2.8.2]# make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS ' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto'
[root@mail postfix-2.8.2]# make
[root@mail postfix-2.8.2]# make install
按照以下的提示输入相关的路径([]号中的是缺省值,”]”后的是输入值,省略的表示采用默认值)
install_root: [/] /
tempdir: [/usr/local/src/ postfix-2.8.2] /tmp
config_directory: [/etc/postfix] /etc/postfix
daemon_directory: [/usr/libexec/postfix]
command_directory: [/usr/sbin]
queue_directory: [/var/spool/postfix]
sendmail_path: [/usr/sbin/sendmail]
newaliases_path: [/usr/bin/newaliases]
mailq_path: [/usr/bin/mailq]
mail_owner: [postfix]
setgid_group: [postdrop]
html_directory: [no] /var/www/postfix_html
manpages: [/usr/local/man]
readme_directory: [no]
3.3生成别名二进制文件,这个步骤如果忽略,会造成postfix效率极低
[root@mail postfix-2.8.2]# newaliases
3.4启动postfix并查看25端口
[root@mail postfix-2.8.2]# postfix start
postfix/postfix-script: starting the Postfix mail system
[root@mail postfix-2.8.2]# netstat -tupln |less
3.5是否支持mysql模块
[root@mail postfix-2.8.2]# postconf –m
btree
cidr
environ
hash
internal
mysql
nis
proxy
regexp
static
tcp
texthash
unix
3.6是否支持验证
[root@mail postfix-2.8.2]# postconf –a
cyrus
dovecot
3.7为postfix提供sysv 服务脚本,这里用拆分rpm包的方法实现服务脚本
[root@mail ~]# mkdir /tmp/abc
[root@mail ~]# cd /tmp/abc
[root@mail abc]# cp /mnt/cdrom/Server/postfix-2.3.3-2.1.el5_2.i386.rpm ./
展开包
[root@mail abc]# rpm2cpio postfix-2.3.3-2.1.el5_2.i386.rpm |cpio -id
[root@mail abc]# cd etc/rc.d/init.d/
[root@mail init.d]# cp postfix /etc/init.d/
3.8将此脚本copy到init.d下,并重新启动
[root@mail init.d]# cp postfix /etc/init.d/
[root@mail ~]# service postfix restart
3.9添加至服务管理列表,并让其开机自动启动
[root@mail ~]# chkconfig --add postfix
[root@mail ~]# chkconfig postfix on
[root@mail ~]# chkconfig --list |grep postfix
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
3.10修改配置文件,修改以下几项为您需要的配置
[root@mail ~]# vim /etc/postfix/main.cf
75 myhostname = mail.sh.abc.com
83 mydomain = sh.abc.com
99 myorigin = $mydomain
113 inet_interfaces = all
161 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
260 mynetworks = 192.168.3.0/27, 127.0.0.0/8
说明:
myorigin参数用来指明发件人所在的域名;
mydestination参数指定postfix接收邮件时收件人的域名,即您的postfix系统要接收到哪个域名的邮件;
myhostname 参数指定运行postfix邮件系统的主机的主机名,默认情况下,其值被设定为本地机器名;
mydomain参数指定您的域名,默认情况下,postfix将myhostname的第一部分删除而作为mydomain的值;
mynetworks 参数指定你所在的网络的网络地址,postfix系统根据其值来区别用户是远程的还是本地的,如果是本地网络用户则允许其访问;
inet_interfaces 参数指定postfix系统监听的网络接口;
注意:
1、在postfix的配置文件中,参数行和注释行是不能处在同一行中的;
2、任何一个参数的值都不需要加引号,否则,引号将会被当作参数值的一部分来使用;
3、每修改参数及其值后执行 postfix reload 即可令其生效;但若修改了inet_interfaces,则需重新启动postfix
4、如果一个参数的值有多个,可以将它们放在不同的行中,只需要在其后的每个行前多置一个空格即可;postfix会把第一个字符为空格或tab的文本行视为上一行的延续;
修改之后重新启动服务
[root@mail ~]# service postfix restart
3.11测试
[root@mail ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.sh.abc.com ESMTP Postfix
EHLO mail.sh.abc.com
250-mail.sh.abc.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:root@sh.abc.com
250 2.1.0 Ok
rcpt to:user@sh.abc.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject:testmail
test user
.
250 2.0.0 Ok: queued as 71211577496
quit
221 2.0.0 Bye
Connection closed by foreign host.
切换到user账户,查后邮件
[root@mail ~]# su - user
[user@mail ~]$ mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/user": 1 message 1 new
>N 1 root@sh.abc.com Fri Sep 21 01:38 14/476 "testmail"
& 1
Message 1:
From root@sh.abc.com Fri Sep 21 01:38:27 2012
X-Original-To: user@sh.abc.com
Delivered-To: user@sh.abc.com
subject:testmail
Date: Fri, 21 Sep 2012 01:37:34 +0800 (CST)
From: root@sh.abc.com

test user

& q
Saved 1 message in mbox可以看到成功!!!!!!!
四、为postfix开启基于cyrus-sasl的认证功能 4.1使用以下命令验正postfix是否支持cyrus风格的sasl认证
[root@mail ~]# postconf -a
cyrus
dovecot
可以看到支持验证
4.2修改postfox的配置文件
260 mynetworks = 127.0.0.0/8
并添加下面内容
############################CYRUS-SASL############################
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!



[root@mail ~]# cd /usr/lib/sasl2/
[root@mail sasl2]# cp -p Sendmail.conf smtpd.conf
[root@mail sasl2]# vim smtpd.conf
添加下面内容
mech_list: PLAIN LOGIN
4.3重新启动验证服务
[root@mail ~]# service saslauthd restart
Stopping saslauthd: [ OK ]
Starting saslauthd: [ OK ]
[root@mail ~]# chkconfig saslauthd on
4.4让postfix重新加载配置文件
[root@mail ~]# service postfix reload
4.5测试
[root@mail ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.abc.com ESMTP Postfix
EHLO mail.abc.com
250-mail.abc.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN ##说明能身份验证
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

五、安装Courier authentication library 5.1解压缩
[root@mail ~]# tar jxvf courier-authlib-0.63.0.tar.bz2 -C /usr/local/src
5.2编译并安装
[root@mail ~]# cd /usr/local/src/courier-authlib-0.63.0/
[root@mail courier-authlib-0.63.0]# ./configure \
> --prefix=/usr/local/courier-authlib \
> --sysconfdir=/etc --with-authmysql \
> --with-mysql-libs=/usr/lib/mysql \
> --with-mysql-includes=/usr/include/mysql \
> --with-redhat \
> --with-authmysqlrc=/etc/authmysqlrc \
> --with-authdaemonrc=/etc/authdaemonrc \
> --with-ltdl-lib=/usr/lib \
> --with-ltdl-include=/usr/include
[root@mail courier-authlib-0.63.0]# make
[root@mail courier-authlib-0.63.0]# make install
5.3更改权限,将脚本样本copy成所需要的脚本文件
[root@mail ~]# chmod 755 /usr/local/courier-authlib/var/spool/authdaemon
[root@mail ~]# cp /etc/authdaemonrc.dist /etc/authdaemonrc
[root@mail ~]# cp /etc/authmysqlrc.dist /etc/authmysqlrc
5.4修改文件
[root@mail ~]# vim /etc/authdaemonrc
27 authmodulelist="authmysql"
34 authmodulelistorig="authmysql"
53 daemons=10
[root@mail ~]# vim /etc/authmysqlrc
26 MYSQL_SERVER localhost
27 MYSQL_USERNAME extmail ##这时为后文要用的数据库的所有者的用户名
28 MYSQL_PASSWORD extmail ##密码
49 MYSQL_SOCKET /var/lib/mysql/mysql.sock
56 MYSQL_PORT 3306 ##指定你的mysql监听的端口,这里使用默认的3306
68 MYSQL_DATABASE extmail
83 MYSQL_USER_TABLE mailbox
92 MYSQL_CRYPT_PWFIELD password
113 MYSQL_UID_FIELD '2525'
119 MYSQL_GID_FIELD '2525'
128 MYSQL_LOGIN_FIELD username
133 MYSQL_HOME_FIELD concat('/var/mailbox/',homedir)
139 MYSQL_NAME_FIELD name
150 MYSQL_MAILDIR_FIELD concat('/var/mailbox/',maildir)
5.5为courier-authlib提供sysv 服务脚本
[root@mail ~]# cd /usr/local/src/courier-authlib-0.63.0/
[root@mail courier-authlib-0.63.0]# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
5.6更改权限并添加至服务管理列表,并让其开机自动启动
[root@mail courier-authlib-0.63.0]# chmod 755 /etc/init.d/courier-authlib
[root@mail courier-authlib-0.63.0]# chkconfig --add courier-authlib
[root@mail courier-authlib-0.63.0]# chkconfig --level 2345 courier-authlib on
[root@mail ~]# chkconfig --list |grep courier-authlib
courier-authlib 0:off 1:off 2:on 3:on 4:on 5:on 6:off
5.7由于是源代码安装,形成的库文件不是标准路径,为了让其他软件包和服务调用做一下修改并启动服务
[root@mail ~]# echo "/usr/local/courier-authlib/lib/courier-authlib" >>
/etc/ld.so.conf.d/courier-authlib.conf
[root@mail ~]# ldconfig –pv |grep cour ##查看是否导入
[root@mail ~]# service courier-authlib start
Starting Courier authentication services: authdaemond
5.8新建虚拟用户邮箱所在的目录,并将其权限赋予postfix用户
[root@mail ~]# mkdir -pv /var/mailbox
mkdir: created directory `/var/mailbox'
[root@mail ~]# chown -R postfix /var/mailbox
5.9重新配置SMTP 认证,编辑 /usr/local/lib/sasl2/smtpd.conf ,确保其为以下内容
[root@mail ~]# vim /usr/lib/sasl2/smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list:PLAIN LOGIN
authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket
可以在底行模式下用下面命令查看是否有此路径
:.! –l /usr/

六、让postfix支持虚拟域和虚拟用户 6.1编辑/etc/postfix/main.cf,添加如下内容
########################Virtual Mailbox Settings########################
virtual_mailbox_base = /var/mailbox
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:2525
virtual_gid_maps = static:2525
virtual_transport = virtual
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1
##########################QUOTA Settings########################
message_size_limit = 14336000
virtual_mailbox_limit = 20971520
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please Tidy your mailbox and try again later.
virtual_overquota_bounce = yes
七、使用extman源码目录下docs目录中的extmail.sql和init.sql建立数据库 7.1解压缩
[root@mail ~]# tar zxvf extman-1.1.tar.gz
[root@mail ~]# cd extman-1.1
[root@mail extman-1.1]# cd docs/
[root@mail docs]# mysql -u root -p <extmail.sql
Enter password: (前面设置的密码redhat
[root@mail docs]# mysql -u root -p <init.sql
Enter password: (前面设置的密码redhat
7.2导入之后用下面命令验证一下
[root@mail docs]# mysql -u root -p
Enter password:



7.3把映射文件copy到/etc/postfix
[root@mail docs]# cp mysql_virtual_* /etc/postfix/
7.4授予用户extmail访问extmail数据库的权限
[root@mail docs]# mysql -u root -p
Enter password:
mysql> GRANT all privileges on extmail.* TO extmail@localhost IDENTIFIED BY 'extmail';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT all privileges on extmail.* TO extmail@127.0.0.1 IDENTIFIED BY 'extmail';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES; ##让设置的内容生效
Query OK, 0 rows affected (0.00 sec)
mysql> \q
Bye
7.5重新启动服务
[root@mail ~]# service postfix restart
说明:启用虚拟域以后,需要取消中心域,即注释掉myhostname, mydestination, mydomain, myorigin几个指令;这些前面已经做过。当然,你也可以把mydestionation的值改为你自己需要的。
八、配置dovecot 8.1修改配置文件
[root@mail ~]# vim /etc/dovecot.conf
211 mail_location = maildir:/var/mailbox/%d/%n/Maildir
795 #passdb pam {

828 #}
869 passdb sql {
870 # Path for SQL configuration file, see doc/dovecot-sql-example.conf
871 args = /etc/dovecot-mysql.conf
872 }
把userdb的其他相关禁用
896 #userdb passwd {

903 #}

930 userdb sql {
931 # Path for SQL configuration file, see doc/dovecot-sql-example.conf
932 args = /etc/dovecot-mysql.conf
933 }
8.2创建dovecot-mysql.conf文件,内容如下
[root@mail ~]# vi /etc/dovecot-mysql.conf
driver = mysql
connect = host=localhost dbname=extmail user=extmail password=extmail
default_pass_scheme = CRYPT
password_query = SELECT username AS user,password AS password FROM mailbox WHERE username = '%u'
user_query = SELECT maildir, uidnumber AS uid, gidnumber AS gid FROM mailbox WHERE username = '%u'
8.3编辑postfix配置文件
[root@mail ~]# vim /etc/postfix/main.cf
415 home_mailbox = Maildir/
8.4启动dovecot服务重启postfix服务
[root@mail ~]# service dovecot start
[root@mail ~]# chkconfig dovecot on
[root@mail ~]# service postfix restart
九、安装Extmail-1.2 9.1解压缩
[root@mail ~]# tar zxvf extmail-1.2.tar.gz
Extmail运行在固定的目录创建下面目录,并把解压缩文件移动到其下
[root@mail extmail-1.2]# mkdir -pv /var/www/extsuite
mkdir: created directory `/var/www/extsuite'
[root@mail extmail-1.2]# cd
[root@mail ~]# mv extmail-1.2 /var/www/extsuite/extmail
[root@mail ~]# mv extman-1.1 /var/www/extsuite/extman
[root@mail ~]# cd /var/www/extsuite/
[root@mail extsuite]# cd extmail/
Copy配置文件
[root@mail extmail]# cp webmail.cf.default webmail.cf
9.2修改配置文件
[root@mail extmail]# vim webmail.cf
77 SYS_USER_LANG = zh_CN
127 SYS_MAILDIR_BASE = /var/mailbox
139 SYS_MYSQL_USER = extmail
140 SYS_MYSQL_PASS = extmail
197 SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket
9.3启动apache
[root@mail extmail]# service httpd start
Starting httpd: [ OK ]
[root@mail extmail]# chkconfig httpd on
9.4 apache的相关配置
由于extmail要进行本地邮件的投递操作,故必须将运行apache服务器用户的身份修改为您的邮件投递代理的用户;本例中打开了apache服务器的suexec功能,故使用以下方法来实现虚拟主机运行身份的指定。此例中的MDA为postfix自带,因此将指定为postfix用户:
[root@mail extmail]# vim /etc/httpd/conf/httpd.conf
添加一下内容
<VirtualHost 192.168.3.65:80>
ServerName mail.sh.abc.com
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
SuexecUserGroup postfix postfix
</VirtualHost>
可以不要SuexecUserGroup postfix postfix,但做一下修改
231 User postfix
232 Group postfix
修改 cgi执行文件属主为apache运行身份用户:
[root@mail extmail]# chown -R postfix.postfix /var/www/extsuite/extmail/cgi/
重新启动
[root@mail ~]# service httpd restart
十、安装Extman-1.1 10.1解压缩了并把解压缩文件copy到/var/www/extsuite下,这些前面做过
Copy配置文件并修改
[root@mail extman]# cp webman.cf.default webman.cf
[root@mail extman]# vim webman.cf
12 SYS_MAILDIR_BASE = /var/mailbox
##此处即为您在前文所设置的用户邮件的存放目录
21 SYS_CAPTCHA_ON = 0 ##代表不需要验证码
10.2修改cgi目录的属主
[root@mail extman]# vim /etc/httpd/conf/httpd.conf
[root@mail extman]# chown -R postfix.postfix /var/www/extsuite/extman/cgi/
在apache的主配置文件中Extmail的虚拟主机部分,添加如下两行
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
Alias /extman /var/www/extsuite/extman/html
10.3创建其运行时所需的临时目录,并修改其相应的权限
[root@mail extman]# mkdir -pv /tmp/extman
mkdir: created directory `/tmp/extman'
[root@mail extman]# chown postfix.postfix /tmp/extman
十一、为extmail与extman打个小补丁Unix-Syslog 11.1解压缩
[root@mail ~]# tar zxvf Unix-Syslog-0.100.tar.gz
11.2编译安装
[root@mail ~]# cd Unix-Syslog-0.100
[root@mail Unix-Syslog-0.100]# perl Makefile.PL
[root@mail Unix-Syslog-0.100]# make
[root@mail Unix-Syslog-0.100]# make install
十二、测试 好了,到此为止,重新启动apache服务器后,您的Webmail和Extman已经可以使用了,
在访问之前在修改一下文件,验证后面已经做过,这里冲突,所以注释掉。要不然不能发信。
[root@mail ~]# vim /etc/postfix/main.cf
161 #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
修改完毕之后重启服务,现在可以在浏览器中输入指定的虚拟主机的名称进行访问,如下:
http://mail.abc.com
如图:




选择管理即可登入extman进行后台管理了。默认管理帐号为:root@extmail.org 密码为:extmail*123*
如图:



管理员添加域sh.abc.com并在域sh.abc.com中申请注册帐号
test1@sh.abc.com
test2@sh.ahc.com

如图:
登录test1邮箱,给test2发送邮件



登录test2账户,查收邮件







内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: