企业 全功能邮件服务器
生活随笔
收集整理的這篇文章主要介紹了
企业 全功能邮件服务器
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
?
DNS服務(wù)器搭建 第一步 搭建DNS服務(wù)器使DNS服務(wù)器能夠解析mail.hf.com為192.168.101.2 首先設(shè)置ip與主機(jī) [root@localhost ~]# grep HOSTNAME /etc/sysconfig/network HOSTNAME=dns.hf.com(設(shè)置主機(jī)名) [root@localhost ~]# ifconfig eth0 |grep "inet addr"(配置網(wǎng)卡) inet addr:192.168.101.2?Bcast:192.168.101.255?Mask:255.255.255.0 [root@localhost ~]# 配置本地yum倉庫 [root@localhost ~]# mkdir /mnt/cdrom [root@localhost ~]# mount /dev/cdrom /mnt/cdrom [root@localhost ~]# grep baseurl /etc/yum.repos.d/rhel-debuginfo.repo baseurl=file:///mnt/cdrom/Server [root@localhost ~]# grep enabled /etc/yum.repos.d/rhel-debuginfo.repo enabled=1 [root@localhost ~]# 第二步 安裝DNS包 并配置相關(guān)文件 [root@dns ~]#yum -y install bind bind-chroot caching-nameserver [root@dns ~]# vim /var/named/chroot/etc/named.conf(修改DNS住配置文件) 14 options { 15listen-on port 53 { any; }; 16listen-on-v6 port 53 { ::1; }; 27allow-query???? { any; }; 28allow-query-cache { localhost; }; 36 view localhost_resolver { 37match-clients????? { any; }; 38match-destinations { any; }; 39recursion yes; 40include "/etc/named.rfc1912.zones"; 41 }; 修改區(qū)域文件(建立正向和反向區(qū)域) [root@dns ~]# vim /var/named/chroot/etc/named.rfc1912.zones zone "localdomain" IN { type master; file "hf.com.db"; allow-update { none; }; }; zone "101.169,192.in-addr.arpa" IN { type master; file "back.hf.com.db"; allow-update { none; }; }; [root@dns ~]# cd /var/named/chroot/var/named/ [root@dns named]# cp -p named.zero hf.com.db [root@dns named]# cp -p hf.com.db back.hf.com.db [root@dns named]# cat hf.com.db (正向文件) $TTL86400 @IN SOA?hf.com.????? root.hf.com. ( 201204010???????????? ; serial (d. adams) 3H????????????? ; refresh 15M???????? ????; retry 1W????????????? ; expiry 1D )??????????? ; minimum IN????? NS????? dns.hf.com. IN????? MX?5?? mail.hf.com. dnsIN????? A?????? 192.168.101.2 mailIN????? A?????? 192.168.101.1 [root@dns named]# cat back.hf.com.db(反向文件) $TTL86400 @IN SOA?hf.com.????? root.hf.com. ( 201204010???????????? ; serial (d. adams) 3H????????????? ; refresh 15M???????????? ; retry 1W????????????? ; expiry 1D )??????????? ; minimum IN????? NS????? dns.hf.com. IN????? MX?5?? mail.hf.com. 2IN????? PTR???? dns.hf.com. 1IN????? PTR???? mail.hf.com. [root@dns named]# 郵件服務(wù)器搭建 第一步 配置基本 [root@mail ~]# ifconfig eth0 |grep "inet addr"(配置網(wǎng)卡信息) inet addr:192.168.101.1?Bcast:192.168.101.255?Mask:255.255.255.0 [root@mail ~]#?grep HOSTNAME /etc/sysconfig/network HOSTNAME=mail.hf.com(主機(jī)名) [root@mail ~]# [root@mail ~]# cat /etc/yum.repos.d/rhel-debuginfo.repo (yum信息) [rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=file:///mnt/cdrom/Server enabled=1 gpgcheck=1 gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release [root@mail ~]# 首先把系統(tǒng)自帶的sendmail 服務(wù)關(guān)閉或者卸載 [root@mail ~]#service sendmial stop [root@mail ~]#chkconfig –level 35 sendmail off 第二步 安裝apache軟件: 下面我們將把所有需要的安裝包放到并解壓到/usr/src/下面以方便我們統(tǒng)一管理維護(hù) [root@mail ~]# cd /usr/src/ [root@mail src]# tar -zxvf httpd-2.2.9.tar.gz 解壓到當(dāng)前目錄 [root@mail src]# cd httpd-2.2.9 [root@mail httpd-2.2.9]#?./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so --enable-auth-digest --enable-cgi --with-ssl=/usr/lib --enable-ssl --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/usr/local/apache2/htdocs [root@mail httpd-2.2.9]# make 編譯 [root@mail httpd-2.2.9]# make install 安裝 [root@mail httpd-2.2.9]# vim /usr/local/apache2/bin/apachectl修改文件 #!/bin/sh #chkconfig:35 85 15 #description:Apach is a World Wibe Web Server [root@mail httpd-2.2.9]# cd /usr/local/apache2/bin/ 進(jìn)入目錄 [root@mail bin]# cp apachectl /etc/init.d/apache?復(fù)制文件 [root@mail bin]# chkconfig --add apache 增加服務(wù) [root@mail bin]# service apache start 啟動服務(wù) 訪問測試 輸入 http://mail.hf.com 第三步創(chuàng)建mysql服務(wù)器 首先解壓 [root@mail ~]# cd /usr/src/ [root@mail src]# tar -zxvf mysql-5.0.95.tar.gz [root@mail src]# cd mysql-5.0.95(進(jìn)入目錄) [root@mail mysql-5.0.95]# useradd -M -s /sbin/nologin mysql 創(chuàng)建用戶mysql [root@mail mysql-5.0.95]# yum -y install libtermcap-devel安裝依賴(默認(rèn)情況下已安裝) 預(yù)編譯 [root@mail mysql-5.0.95]#./configure --prefix=/usr/local/mysql --without-debug --with-extra-charsets=utf8,gbk --enable-assembler --with-mysql-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=/tmp/mysql.sock --with-ssl --with-mysqld-us [root@mail mysql-5.0.95]#make 編譯 [root@mail mysql-5.0.95]#make install 安裝 [root@mail mysql-5.0.95]# cp support-files/my-medium.cnf /etc/my.cnf 拷貝文件 [root@mail mysql-5.0.95]# chown -R root.mysql /usr/local/mysql/修改所屬及所屬組 [root@mail mysql-5.0.95]# chown -R mysql.mysql /usr/local/mysql/var [root@mail mysql-5.0.95]#?echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf將路徑導(dǎo)入 [root@mail mysql-5.0.95]# ldconfig [ro [root@mail mysql-5.0.95]#?ln -s /usr/local/mysql/lib/mysql/lib* /usr/lib 創(chuàng)建軟連接 [root@mail mysql-5.0.95]# ln -s /usr/local/mysql/bin/* /usr/local/bin/ 創(chuàng)建軟連接 [root@mail mysql-5.0.95]#?mysql_install_db --user=mysql [root@mail mysql-5.0.95]# cp support-files/mysql.server /etc/init.d/mysqld [root@mail mysql-5.0.95]#?echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile [root@mail mysql-5.0.95]#?mysqladmin -u root password 123456 [root@mail mysql-5.0.95]# mysql -u root -p Enter password: Welcome to the MySQL monitor.?Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.95-log Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 第四步搭建PHP 首先安裝依賴 [root@mail src]# tar -jxvf libmcrypt-2.5.8.tar.bz2 [root@mail src]# cd libmcrypt-2.5.8 [root@mail libmcrypt-2.5.8]# ./config [root@mail libmcrypt-2.5.8]# make [root@mail libmcrypt-2.5.8]# make install [root@mail libmcrypt-2.5.8]# cd ../ [root@mail src]# tar -jxvf mhash-0.9.9.9.tar.bz2 [root@mail src]# cd mhash-0.9.9.9 [root@mail mhash-0.9.9.9]# ./configure [root@mail mhash-0.9.9.9]# make [root@mail mhash-0.9.9.9]# make install [root@mail mhash-0.9.9.9]#?ln -s /usr/local/lib/libmcrypt* /usr/lib [root@mail mhash-0.9.9.9]#?ln -s /usr/local/lib/libmhash.* /usr/lib/ [root@mail mhash-0.9.9.9]# cd ../ [root@mail src]# tar -zxvf mcrypt-2.6.8.tar.gz [root@mail src]# cd mcrypt-2.6.8 [root@mail mcrypt-2.6.8]# ./configure [root@mail mcrypt-2.6.8]# make [root@mail mcrypt-2.6.8]# make install 安裝php包 [root@mail mcrypt-2.6.8]# cd ../ [root@mail src]# tar -zxvf php-5.4.0.tar.gz [root@mail src]# cd php-5.4.0 [root@mail php-5.4.0]# [root@mail php-5.4.0]# ./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql/ --with-zlib --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --with-curl --with-curlwrappers --enable-fpm --enable-fastcgi --with-mcrypt --with-gd --with-openssl --with-mhash --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc -enable-zip --enable-soap --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php5 [root@mail php-5.4.0]#make [root@mail php-5.4.0]#make install [root@mail php-5.4.0]# cp php.ini-production /usr/local/php5/php.ini [root@mail php-5.4.0]#?vim /usr/local/apache2/conf/httpd.conf [root@mail php-5.2.13]# vim /usr/local/apache2/conf/httpd.conf 53 LoadModule php5_module??????? modules/libphp5.so 54 AddType application/x-httpd-php .php 167 <IfModule dir_module> 168???? DirectoryIndex index.php index.html 169 </IfModule> 第五部測試 [root@mail php-5.4.0]#[root@mail php-5.2.13]# cat /usr/local/apache2/htdocs/index.php <?php ??????? phpinfo(); ?> ?在瀏覽器中輸入http://mail.hf.com/indx.php [root@mail php-5.4.0]# vim /usr/local/php5/php.ini error_reporting = E_ALL & ~E_DEPRECATED date.timezone = Asia/Shanghai [root@mail php-5.4.0]#service apache restart [root@mail php-5.4.0]# [root@mail htdocs]# cat index.php 將index.php修改為 測試 與mysql的鏈接 <?php $link=mysql_connect('localhost','test',''); if (!$link) echo"Fail sorry"; else echo "OKOKOKOK"; phpinfo(); ?> [root@mail htdocs]# 測試結(jié)果如下 第六步搭建postfix [root@mail ~]# groupadd -g 1200 postdrop [root@mail ~]# groupadd -g 1000 postfix [root@mail ~]# useradd -M -u 1000 -g postfix -G postdrop -s /sbin/nologin postfix [root@mail ~]# cd /usr/src/ [root@mail src]# tar -zxvf postfix-2.6.2.tar.gz [root@mail src]# cd postfix-2.6.2 [root@mail src]# gunzip postfix-2.6.2-vda-ng.patch.gz [root@mail postfix-2.6.2]# [root@mail postfix-2.6.2]#?patch -p1 < ../postfix-2.6.2-vda-ng.patch patching file README_FILES/VDA_README patching file src/global/mail_params.h patching file src/util/file_limit.c patching file src/virtual/mailbox.c patching file src/virtual/maildir.c patching file src/virtual/virtual.c patching file src/virtual/virtual.h [root@mail postfix-2.6.2]# [root@mail postfix-2.6.2]# make makefile 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl' 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2' [root@mail postfix-2.6.2]# make [root@mail postfix-2.6.2]# make install [root@mail postfix-2.6.2]#vim?/etc/postfix/main.cf 修改文件 inet_interfaces?=?all?默認(rèn)設(shè)置 myhostname?=?mail.hf.com?主機(jī)名 mydomain?= hf.com?郵件域名 myorigin?=?$mydomain?外發(fā)郵件時發(fā)件人地址中的郵件域名 mydestination?=?$mydomain, $myhostname?可接收的郵件地址中的域名 home_mailbox?=?Maildir/?郵件存儲位置格式 [root@mail postfix-2.6.2]# postfix check [root@mail postfix-2.6.2]# postfix start postfix/postfix-script: starting the Postfix mail system 第七步發(fā)送郵件測試 [root@mail postfix-2.6.2]# useradd?-g?mailusers?-s?/sbin/nologin?kaimen [root@mail postfix-2.6.2]# useradd?-g?mailusers?-s?/sbin/nologin?guanmen [root@mail postfix-2.6.2]# passwd kaimen Changing password for user kaimen. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@mail postfix-2.6.2]# passwd guanmen Changing password for user guanmen. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@mail postfix-2.6.2]# 發(fā)送郵件 [root@mail postfix-2.6.2]# telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.hf.com ESMTP Postfix hello localhost 502 5.5.2 Error: command not recognized HELO localhost 250 mail.hf.com mail from:kaimen@hf.com 250 2.1.0 Ok rcpt to:guanmen@hf.com 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> Subject:A test mail Hello this is a test mail if you are guanmen .OK! . 250 2.0.0 Ok: queued as DE0902584E7 quit 221 2.0.0 Bye Connection closed by foreign host. 收件查看 [root@mail postfix-2.6.2]# cat /home/guanmen/Maildir/new/1332627934.V802I178a0aM806505.mail.hf.com Return-Path: <kaimen@hf.com> X-Original-To: guanmen@hf.com Delivered-To: guanmen@hf.com Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.hf.com (Postfix) with SMTP id DE0902584E7 for <guanmen@hf.com>; Sun, 25 Mar 2012 06:22:47 +0800 (CST) Subject:A test mail Message-Id: <20120324222315.DE0902584E7@mail.hf.com> Date: Sun, 25 Mar 2012 06:22:47 +0800 (CST) From: kaimen@hf.com To: undisclosed-recipients:; Hello this is a test mail if you are guanmen .OK! [root@mail postfix-2.6.2]# 哈哈 終于成功了一點(diǎn) 繼續(xù)努力 第八步接下來構(gòu)建郵件接收服務(wù)器 [root@mail src]# tar -zxvf dovecot-1.1.4.tar.gz [root@mail src]# cd dovecot-1.1.4 [root@mail dovecot-1.1.4]# ./configure --sysconfdir=/etc --with-mysql [root@mail dovecot-1.1.4]# make [root@mail dovecot-1.1.4]# make install 拷貝配置文件,并對其進(jìn)行修改 [root@mail dovecot-1.1.4]# cp /etc/dovecot-example.conf /etc/dovecot.conf [root@mail dovecot-1.1.4]# vim /etc/dovecot.conf 24 protocols = pop3 imap ?48 disable_plaintext_auth = no ?89 ssl = no 218 mail_location = maildir:~/Maildir 創(chuàng)建 [root@mail dovecot-1.1.4]# vim /etc/pam.d/dovecot auth?required?pam_nologin.so auth?include?system-auth account?include?system-auth session?include?system-auth [root@mail dovecot-1.1.4]# vim /etc/pam.d/dovecot [root@mail dovecot-1.1.4]# /usr/local/sbin/dovecot -c /etc/dovecot.conf Error: Login user doesn't exist: dovecot Fatal: Invalid configuration in /etc/dovecot.conf [root@mail dovecot-1.1.4]#?useradd -M -s /sbin/nologin dovecot [root@mail dovecot-1.1.4]# /usr/local/sbin/dovecot -c /etc/dovecot.conf [root@mail dovecot-1.1.4]# echo "/usr/local/sbin/dovecot -c /etc/dovecot.conf" > > /etc/rc.local [root@mail dovecot-1.1.4]# netstat -tupln |grep dovecot查看端口 tcp0????? 0 0.0.0.0:110???????????????? 0.0.0.0:*?????????????????? LISTEN????? 18406/dovecot?????? tcp0????? 0 0.0.0.0:143???????????????? 0.0.0.0:*?????????????????? LISTEN????? 18406/dovecot?????? 測試 [root@mail dovecot-1.1.4]# telnet localhost 110 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. +OK Dovecot ready. user guanmen +OK pass guanmen +OK Logged in. list +OK 1 messages: 1 492 . retr 1 +OK 492 octets Return-Path: <kaimen@hf.com> X-Original-To: guanmen@hf.com Delivered-To: guanmen@hf.com Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.hf.com (Postfix) with SMTP id DE0902584E7 for <guanmen@hf.com>; Sun, 25 Mar 2012 06:22:47 +0800 (CST) Subject:A test mail Message-Id: <20120324222315.DE0902584E7@mail.hf.com> Date: Sun, 25 Mar 2012 06:22:47 +0800 (CST) From: kaimen@hf.com To: undisclosed-recipients:; Hello this is a test mail if you are guanmen .OK! . quit +OK Logging out. Connection closed by foreign host. [root@mail dovecot-1.1.4]# 說明dovecot成功了 第九步配置SquirrelMAIL [root@mail src]# tar -zxvf squirrelmail-webmail-1.4.22.tar.gz [root@mail apache2]# cd /usr/src/ [root@mail src]# mv squirrelmail-webmail-1.4.22 webmail [root@mail src]# cd webmail/ [root@mail webmail]# mkdir -p attach data [root@mail webmail]# chown -R daemon:daemon attach/ data/ [root@mail webmail]# chmod 730 attach/ [root@mail webmail]# cd config [root@mail config]# cp config_default.php config.php [root@mail config]# vim config.php修改配置文件 118 $domain = 'hf.cn'; 231 $imap_server_type = 'dovecot'; 499 $data_dir = '/usr/local/apache2/htdocs/webmail/data/'; 517 $p_w_upload_dir = '/usr/local/apache2/htdocs/webmail/attach/'; 1012 $squirrelmail_default_language = 'zh_CN'; 1027 $default_charset = 'zh_CN.UTF-8'; 重啟 服務(wù) 在瀏覽器地址欄中輸入http://mail.hf.com/webmail?
?
?
?
測試成功 第十步安裝extman [root@mail ~]# service mysqld restart [root@mail ~]# service mysqld restart [root@mail ~]# cd /usr/src/ [root@mail src]# tar -zxvf extman-0.2.5.tar.gz [root@mail src]# cd extman-0.2.5/docs/ [root@mail docs]# mysql -u root -p < extmail.sql Enter password: [root@mail docs]# mysql -u root -p < init.sql Enter password: [root@mail docs]# [root@mail docs]# postconf -m |grep mysql mysql [root@mail docs]# 第十一步配置postfix root@mail docs]# Vim /usr/src/extman-0.25-docs readme_directory = no virtual_mailbox_base=/mailbox virtual_alias_maps=mysql:/etc/postfix/mysql_virtual_alias_maps.cf virtual_mailbox_maps=mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf virtual_mailbox_domains=mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_uid_maps = static:1000 virtual_gid_maps = static:1000 [root@mail docs]# cp mysql_virtual_* /etc/postfix/ 第十二步虛擬用戶設(shè)置SMTP發(fā)信認(rèn)證 [root@mail src]# tar -jxvf courier-authlib-0.62.4.tar.bz2 [root@mail src]# cd courier-authlib-0.62.4 [root@mail courier-authlib-0.62.4]# ./configure?--prefix=/usr/local/courier-authlib?--without-stdheaderdir?--with-authmysql?--with-redhat --with-mysql-libs=/usr/local/mysql/lib/mysql?--with-mysql-includes=/usr/local/mysql/include/mysql [root@mail courier-authlib-0.62.4]# make編譯 [root@mail courier-authlib-0.62.4]# make install [root@mail courier-authlib-0.62.4]# make install-configure [root@mail courier-authlib-0.62.4]# echo "/usr/local/courier-authlib/lib/courier-authlib" >> /etc/ld.so.conf [root@mail courier-authlib-0.62.4]# ldconfig [root@mail courier-authlib-0.62.4]# [root@mail authlib]# cp authdaemonrc authdaemonrc.bak [root@mail authlib]# vim authdaemonrc 27 authmodulelist="authmysql" 34 authmodulelistorig="authmysql" [root@mail authlib]# chmod -R 755 /usr/local/courier-authlib/var/spool/authdaemon/ [root@mail authlib]# cp authmysqlrc authmysqlrc.bak [root@mail authlib]# vim authmysqlrc 26 MYSQL_SERVERlocalhost?//mysql數(shù)據(jù)庫服務(wù)器位置 27 MYSQL_USERNAMEextmail?? //管理員帳號 28 MYSQL_PASSWORDextmail??//密碼 49 MYSQL_SOCKET/tmp/mysql.sock 68 MYSQL_DATABASEextmail??? //虛擬用戶數(shù)據(jù)庫 83 MYSQL_USER_TABLEmailbox??//從mailbox表獲取郵件賬戶信息 92 MYSQL_CRYPT_PWFIELD?password ?//從password獲取密碼 113 MYSQL_UID_FIELDuidnumber ?//從uidnumber字段映射本地uid 119 MYSQL_GID_FIELDgidnumber ?//從gidnumber字段映射本地gid 128 MYSQL_LOGIN_FIELDusername?? 133 MYSQL_HOME_FIELDconcat('/mailbox/',homedir) 139 MYSQL_NAME_FIELDname 150 MYSQL_MAILDIR_FIELD?concat('/mailbox/',maildir) 復(fù)制腳本啟動服務(wù) [root@mail authlib]# cp /usr/src/courier-authlib-0.62.4/courier-authlib.sysvinit /etc/ init.d/courier-authlib [root@mail authlib]# chmod 755 /etc/init.d/courier-authlib 更改權(quán)限 [root@mail authlib]# chkconfig --level 35 courier-authlib on 設(shè)置開機(jī)啟動 [root@mail authlib]# service courier-authlib start Starting Courier authentication services: authdaemond 修改Cyrus sasl [root@mail authlib]# vim /usr/lib/sasl2/smtpd.conf [root@mail authlib]# cat /usr/lib/sasl2/smtpd.conf pwcheck_method:authdaemond authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket 環(huán)境變量 [root@mail authlib]# 修改Dovecot配置 [root@mail authlib]# vim /etc/dovecot.conf? ?mail_location = maildir:/mailbox/%d/%n/Maildir auth default { mechanisms = plain passdb sql { args = /etc/dovecot-mysql.conf } userdb sql { args = /etc/dovecot-mysql.conf } 建立查詢數(shù)據(jù)庫 [root@mail authlib]# vim /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' 建立虛擬用戶 [root@mail authlib]# mkdir -p /mailbox/extmail.org/postmaster/Maildir/ [root@mail authlib]# chown -R postfix:postfix /mailbox/ [root@mail authlib]# pkill dovecot [root@mail authlib]# dovecot [root@mail Maildir]# chown -R postfix:postfix /mailbox [root@mail Maildir]# /usr/local/courier-authlib/sbin/authtest -s login postmaster@extmail.org extmail Authentication succeeded.虛擬用戶測試成功 Authenticated: postmaster@extmail.org?(uid 1000, gid 1000) Home Directory: /mailboxextmail.org/postmaster Maildir: /mailbox/extmail.org/postmaster/Maildir/ Quota: (none) Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0 Cleartext Password: extmail Options: (none) [root@mail Maildir]# 第十三步 Extmail平臺搭建 需要三個依賴包 [root@mail ~]# cd /usr/src/ [root@mail src]# tar -zxvf Unix-Syslog-1.1.tar.gz [root@mail src]# cd Unix-Syslog-1.1 [root@mail Unix-Syslog-1.1]# perl?Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Unix::Syslog [root@mail Unix-Syslog-1.1]# make [root@mail Unix-Syslog-1.1]# make install [root@mail ~]# cd /usr/src/ [root@mail src]# tar -zxvf DBI-1.616.tar.gz [root@mail src]# cd DBI-1.616 [root@mail DBI-1.616]# perl Makefile.PL [root@mail DBI-1.616]#make [root@mail DBI-1.616]#make install [root@mail ~]# cd /usr/src/ [root@mail src]# tar -zxvf DBD-mysql-4.020.tar.gz [root@mail src]# cd DBD-mysql-4.020 [root@mail DBD-mysql-4.020]# perl?Makefile.PL [root@mail DBD-mysql-4.020]# make [root@mail DBD-mysql-4.020]# make intall 安裝Extmail [root@mail DBI-1.616]# cd ../ [root@mail src]# tar -zxvf extmail-1.0.5.tar.gz [root@mail src]# mv extmail-1.0.5 /usr/local/apache2/htdocs/ [root@mail src]# cd /usr/local/apache2/htdocs/ [root@mail htdocs]# mv extmail-1.0.5 extmail [root@mail htdocs]# cd extmail/ [root@mail extmail]# chown -R postfix:postfix cgi [root@mail extmail]# cp webmail.cf.default webmail.cf 修改配置文件 [root@mail extmail]# vim webmail.cf 2 SYS_CONFIG = /usr/local/apache2/htdocs/extmail/ 5 SYS_LANGDIR = /usr/local/apache2/htdocs/extmail/lang 8 SYS_TEMPLDIR = /usr/local/apache2/htdocs/extmail/html 112 SYS_MAILDIR_BASE = /mailbox 124 SYS_MYSQL_USER = extmail 125 SYS_MYSQL_PASS = extmail 126 SYS_MYSQL_DB = extmail 127 SYS_MYSQL_HOST = localhost 128 SYS_MYSQL_SOCKET = /tmp/mysql.sock ? ? ? ? 調(diào)整apache主配置文件添加extman相關(guān)路徑 #vim ?/usr/local/apache2/conf/httpd.conf NameVirtualHost *:80 <VirtualHost *:80> ServerName mail.hf.com DocumentRoot /usr/local/apache2/htdocs/extmail/html/ ScriptAlias /extmail/cgi/ "/usr/local/apache2/htdocs/extmail/cgi/" Alias /extmail "/usr/local/apache2/htdocs/extmail/html/" ScriptAlias /extman/cgi "/usr/local/apache2/htdocs/extman/cgi/" Alias /extman "/usr/local/apache2/htdocs/extman/html/" </VirtualHost> #/usr/local/apache2/bin/apachectl?restart 客戶端訪問登陸測試?
默寫功能還未能成功實(shí)現(xiàn) 待續(xù)
轉(zhuǎn)載于:https://blog.51cto.com/hfang/834817
總結(jié)
以上是生活随笔為你收集整理的企业 全功能邮件服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Lync Server外部访问系列PAR
- 下一篇: HNOI2008 玩具装箱