虛擬域和虛擬用戶的認證過程
準備工作:
1、安裝一些必要的rpm包
- # yum install perl-DBD-MySQL -y #必須安裝,因爲mysql是編譯安裝的,這個不會自動安裝
- # yum install mysql-devel -y #因爲前面安裝dovecot時,由於依賴關係系統自動安裝了
- 一個mysql客戶端爲了不出錯誤,所以devel包也裝了
- # yum install pcre-devel -y # 編譯安裝apache用到
2、由於後面的Extmail需要用到web服務,所以要安裝web服務,詳細過程請見博客-手動搭建LAMP
下面正式開始配置過程:
一、編譯安裝courier-authlib-0.64.0
- 1、安裝要用到的rpm包
- [root@mail courier-authlib-0.64.0]# yum install mysql-devel
- [root@mail courier-authlib-0.64.0]# yum install expect #使用expect實現主機間通信的
- 查看和ldtl相關的包是否安裝:
- [root@mail courier-authlib-0.64.0]# yum list | grep ltdl
- Unable to read consumer identity
- libtool-ltdl.i386 1.5.22-7.el5_4 Base
- libtool-ltdl-devel.i386 1.5.22-7.el5_4 Base
- [root@mail courier-authlib-0.64.0]# yum install libtool-ltdl libtool-ltdl-devel -y
- ltdl: 動態模塊加載器,courier-authlib需要用到,所以安裝相關的包
- 2、編譯安裝courier-authlib-0.64.0
- 備註:在RHEL5上要使用0.64.0及之前的版本,否則,可能會由於sqlite版本過低問題導致configure檢查無法通過
- 或編譯無法進行。
- [root@mail ~]# date 0505145813.00 # 同步一下時間
- Sun May 5 14:58:00 CST 2013
- [root@mail ~]# date
- Sun May 5 14:58:13 CST 2013
- [root@mail ~]# tar xf courier-authlib-0.64.0.tar.bz2
- [root@mail ~]# cd courier-authlib-0.64.0
- [root@mail courier-authlib-0.64.0]#./configure \
- --prefix=/usr/local/courier-authlib \
- --sysconfdir=/etc \
- --without-authpam \
- --without-authshadow \
- --without-authvchkpw \
- --without-authpgsql \
- --with-authmysql \
- --with-sqlite-libs=/usr/lib
- --with-sqlite-include=/usr/include
- --with-mysql-libs=/usr/local/mysql/lib \
- --with-mysql-includes=/usr/local/mysal/include \
- --with-redhat \
- --with-authmysqlrc=/etc/authmysqlrc \
- --with-authdaemonrc=/etc/authdaemonrc \
- --with-mailuser=postfix \
- --with-mailgroup=postfix \
- --with-ltdl-lib=/usr/lib \
- --with-ltdl-include=/usr/include
- [root@mail courier-authlib-0.64.0]# make
- [root@mail courier-authlib-0.64.0]# make install
- 安裝完成後會在/usr/local/courier-authlib/目錄下生成一個var/spool/authdaemon套接字文件,系統會
- 通過這個套接字文件和進程建立聯繫,所以權限要改爲755
- 備註:可以使用--with-authdaemonvar=/var/spool/authdaemon選項來指定進程套按字目錄路徑。
- [root@mail courier-authlib-0.64.0]# cd /usr/local/courier-authlib/var/
- [root@mail spool]# ll
- total 8
- drwxr-x--- 2 postfix postfix 4096 Mar 31 04:41 authdaemon
- [root@mail spool]# chmod 755 /usr/local/courier-authlib/var/spool/authdaemon
- [root@mail spool]# ll
- total 8
- drwxr-xr-x 2 postfix postfix 4096 Mar 31 04:41 authdaemon
- 在編譯路徑下複製幾個配置文件
- [root@mail ~]# cd courier-authlib-0.64.0
- [root@mail courier-authlib-0.64.0]# cp /etc/authdaemonrc.dist /etc/authdaemonrc
- [root@mail courier-authlib-0.64.0]# cp /etc/authmysqlrc.dist /etc/authmysqlrc
- 修改/etc/authdaemonrc 文件
- [root@mail courier-authlib-0.64.0]# vim /etc/authdaemonrc
- authmodulelist="authmysql" #認證模塊類型
- authmodulelistorig="authmysql" #支持認證的原始模塊類型
- daemons=10 #進程數,這個自己隨意指定
- 3、配置其通過mysql進行郵件帳號認證
- 編輯/etc/authmysqlrc 爲以下內容,其中2525,2525 爲postfix 用戶的UID和GID。
- MYSQL_SERVER localhost
- MYSQL_PORT 3306 #指定你的mysql監聽的端口,這裏使用默認的3306
- MYSQL_USERNAME extmail #這時爲後文要用的數據庫的所有者的用戶名
- MYSQL_PASSWORD extmail #密碼
- MYSQL_SOCKET /tmp/mysql.sock #mysql的套接字文件,如果是rpm包裝的在/var/lib/mysql/mysql.lock
- MYSQL_DATABASE extmail #虛擬用戶放在哪個庫中,這個庫有extman自動創建
- MYSQL_USER_TABLE mailbox #mysql的用戶賬號放在哪個表中,這個也是由extman生成
- MYSQL_CRYPT_PWFIELD password
- MYSQL_UID_FIELD '2525'
- MYSQL_GID_FIELD '2525'
- MYSQL_LOGIN_FIELD username
- MYSQL_HOME_FIELD concat('/var/mailbox/',homedir) #定義用戶郵箱地址 concat是一個內置函數
- MYSQL_NAME_FIELD name 能將兩個字符串連接起來當做一個來使用
MYSQL_MAILDIR_FIELD concat('/var/mailbox/',maildir)- 給courier-authlib提供SysV風格的服務腳本,並啓動服務
- [root@mail courier-authlib-0.64.0]# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
- [root@mail courier-authlib-0.64.0]# chmod +x /etc/init.d/courier-authlib
- [root@mail courier-authlib-0.64.0]# chkconfig --add courier-authlib
- [root@mail courier-authlib-0.64.0]# chkconfig --level 2345 courier-authlib on
- [root@mail courier-authlib-0.64.0]# service courier-authlib start
- Starting Courier authentication services: authdaemond
- 4、新建虛擬用戶郵箱所在的目錄,並將其權限賦予postfix用戶:
- [root@mail ~]# mkdir -p /var/mailbox
- [root@mail ~]# chown -R postfix /var/mailbox
- 接下來重新配置SMTP 認證,編輯 /usr/lib/sasl2/smtpd.conf ,確保其爲以下內容:
- [root@mail ~]# vim /usr/lib/sasl2/smtpd.conf
- pwcheck_method: authdaemond
- mech_list: PLAIN LOGIN
- authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket #套接字文件路徑
- 由於要用到sasl,所以重啓一下saslauthd服務;
- [root@mail ~]# service saslauthd restart
- Stopping saslauthd: [ OK ]
- Starting saslauthd: [ OK ]
二、讓postfix支持虛擬域和虛擬用戶
- 1、編輯/etc/postfix/main.cf,添加如下內容:
- [root@mail ~]# vim /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
- 2、使用extman源碼目錄下docs目錄中的extmail.sql和init.sql建立數據庫:
- exman需要用到apache服務,所以請先安裝httpd,這裏是源碼編譯安裝的http-2.4.4,編譯過程
- 請參考博客LAMP的搭建過程
- [root@mail ~]# tar xf extman-1.1.tar.gz
- [root@mail ~]# cd extman-1.1
- [root@mail extman-1.1]# ls
- addon cgi contrib docs INSTALL libs README.fcgi Version
- AUTHORS ChangeLog daemon html lang README tools webman.cf.default
- [root@mail extman-1.1]# cd docs/
- [root@mail docs]# ls
- backport init.sql ldap_virtual_mailbox_maps.cf mysql_virtual_limit_maps.cf
- extmail.schema ldap_virtual_alias_maps.cf ldap_virtual_sender_maps.cf mysql_virtual_mailbox_maps.cf
- extmail.sql ldap_virtual_domains_maps.cf mysql_virtual_alias_maps.cf mysql_virtual_sender_maps.cf
- init.ldif ldap_virtual_limit_maps.cf mysql_virtual_domains_maps.cf README.postfix
- [root@mail docs]# sed -i 's@TYPE=MyISAM@ENGINE=InnoDB@g' extmail.sql #改一下里面的引擎類型
- [root@mail docs]# mysql -uroot -p < extmail.sql
- Warning: mysql: ignoring option '--named-commands' due to invalid value 'root'
- Enter password: #我這裏的mysql有密碼,你們的就沒有了
- [root@mail docs]# mysql -uroot -p < init.sql
- Warning: mysql: ignoring option '--named-commands' due to invalid value 'root'
- Enter password:
- 3、授予用戶extmail訪問extmail數據庫的權限
- [root@mail docs]# mysql -uroot -p
- Warning: mysql: ignoring option '--named-commands' due to invalid value 'root'
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 20
- Server version: 5.5.28-log Source distribution
- Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
- 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 [email protected] IDENTIFIED BY 'extmail';
- Query OK, 0 rows affected (0.00 sec)
- 4、提供配置文件
- [root@mail docs]# ls
- backport init.sql ldap_virtual_mailbox_maps.cf mysql_virtual_limit_maps.cf
- extmail.schema ldap_virtual_alias_maps.cf ldap_virtual_sender_maps.
- mysql_virtual_mailbox_maps.cf
- extmail.sql ldap_virtual_domains_maps.cf mysql_virtual_alias_maps.cf mysql_virtual_sender_maps.cf
- init.ldif ldap_virtual_limit_maps.cf mysql_virtual_domains_maps.cf README.postfix
- [root@mail docs]# cp mysql_virtual_* /etc/postfix/
- [root@mail docs]# cd /etc/postfix/
- [root@mail postfix]# ls
- access generic main.cf.default mysql_virtual_domains_maps.cf relocated
- aliases header_checks makedefs.out mysql_virtual_limit_maps.cf TLS_LICENSE
- bounce.cf.default LICENSE master.cf mysql_virtual_mailbox_maps.cf transport
- canonical main.cf mysql_virtual_alias_maps.cf mysql_virtual_sender_maps.cf virtual
- 5、連接數據庫查看
- [root@mail postfix]# mysql -uroot
- Warning: mysql: ignoring option '--named-commands' due to invalid value 'root'
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 23
- Server version: 5.5.28-log Source distribution
- Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
- mysql> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | information_schema |
- | extmail |
- | mysql |
- | performance_schema |
- | test |
- | wpdb |
- +--------------------+
- 6 rows in set (0.00 sec)
- mysql> use extmail
- Database changed
- mysql> show tables;
- +-------------------+
- | Tables_in_extmail |
- +-------------------+
- | alias |
- | domain |
- | domain_manager |
- | mailbox |
- | manager |
- +-------------------+
- 5 rows in set (0.04 sec)
- mysql> select * from domain\G #讓查詢的內容縱向顯示
- *************************** 1. row ***************************
- domain: extmail.org #如果我們在domain這個表中添加lsq.com,他就給我們中
- 繼郵件了,此時只給這個域中繼郵件,這個域是sql腳本生成的
- description: virtualDomain for extmail.org
- hashdirpath: A0/B0
- maxalias: 50
- maxusers: 50
- maxquota: 1073741824
- maxnetdiskquota: 1073741824
- transport: NULL
- can_signup: 1
- default_quota: 5242880
- default_netdiskquota: 5242880
- default_expire: 1y
- disablesmtpd: 0
- disablesmtp: 0
- disablewebmail: 0
- disablenetdisk: 0
- disableimap: 1
- disablepop3: 0
- createdate: 2007-02-14 15:10:04
- expiredate: 2010-11-08
- active: 1
- 1 row in set (0.03 sec)
三、配置dovecot,是dovecot也支持虛擬域和虛擬用戶
- 1、修改postfix的配置文件
- [root@mail postfix]# vim /etc/dovecot.conf
- mail_location = maildir:/var/mailbox/%d/%n/Maildir #表示在/var/mailbox下有每一個域,
- 在每個域下又有每一個用戶名命名的文件,而用戶的郵件則在maildir目錄中保存
- %d: dovecot所支持的宏,表示域名
- %n:dovecot所支持的宏,表示用戶名
- 2、修改下面的內容,並啓用相關選項:
- auth default {
- mechanisms = plain
- passdb sql {
- args = /etc/dovecot-mysql.conf
- }
- userdb sql {
- args = /etc/dovecot-mysql.conf
- }
- 禁用如下選項:
- userdb passwd {
- }
- passwdb pam {
- }
- 注意:禁用時,前後括弧都禁用才能禁用此選項
- 3、編輯/etc/dovecot-mysql.conf
- [root@mail postfix]# vim /etc/dovecot-mysql.conf
- driver = mysql
- connect = host=/tmp/mysql.sock 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 postfix]# service dovecot restart
- Stopping Dovecot Imap: [ OK ]
- Starting Dovecot Imap: [ OK ]
- 上述表示dovecot認證用戶的時候基於哪個賬號密碼去連接數據庫並且到數據庫的哪個庫中的哪張表中去查找用戶和密碼
- 從而驗證賬號和密碼是否匹配
- 說明:如果mysql服務器是本地主機,即host=localhost時,如果mysql.sock文件不是默認的/var/lib/mysql/mysql.sock
- 可以使用host=“sock文件的路徑”來指定新位置;例如,使用通用二進制格式或源碼安裝的MySQL,其sock文件位置爲/tmp/mysql.sock,
- 相應地,connect應按如下方式定義:
- connect = host=/tmp/mysql.sock dbname=extmail user=extmail password=extmail
- 如果使用rpm包安裝的mysql,其connect按如下方式定義:
- connect = host=localhost dbname=extmail user=extmail password=extmail
四、安裝Extmail-1.2
- 1、解壓縮extmail至網頁所在目錄下,並提供配置文件
- [root@mail ~]# tar xf extmail-1.2.tar.gz
- [root@mail ~]# mkdir -p /web/vhosts/extsuite
- [root@mail ~]# mv extmail-1.2 /web/vhosts/extsuite/extmail
- [root@mail ~]# cp /web/vhosts/
- extsuite/ www1/ www2/
- [root@mail ~]# cp /web/vhosts/extsuite/extmail/webmail.cf.default /web/vhosts/extsuite/extmail/webmail.cf
- 我們這裏的網頁路徑是/web/vhosts/ 與默認的不一致,所以修改配置文件
- 2、修改主配置文件
- 把SYS_CONFIG = /var/www/extsuite/extmail/ 改爲 SYS_CONFIG = /web/vhosts/extsuite/extmail/
- 把SYS_LANGDIR = /var/www/extsuite/extmail/lang 改爲 SYS_LANGDIR = /web/vhosts/extsuite/extmail/lang
- 把SYS_TEMPLDIR = /var/www/extsuite/extmail/html 改爲 SYS_TEMPLDIR = /web/vhosts/extsuite/extmail/html
- 部分修改選項的說明:
- SYS_MESSAGE_SIZE_LIMIT = 5242880 #用戶可以發送的最大郵件
- SYS_USER_LANG = en_US 語言選項,可改作:SYS_USER_LANG = zh_CN
- SYS_MAILDIR_BASE = /home/domains 此處即爲您在前文所設置的用戶郵件的存放目錄
- 可改作:
- SYS_MAILDIR_BASE = /var/mailbox
- SYS_MYSQL_USER = db_user
- SYS_MYSQL_PASS = db_pass
- 以上兩句句用來設置連接數據庫服務器所使用用戶名、密碼和郵件服務器用到的數據庫,這裏修改爲:
- SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock rpm包安裝的不用改了
- 由於我們這裏的源碼編譯安裝的mysql所以的改爲:
- SYS_MYSQL_SOCKET = /tmp/mysql.sock
- SYS_MYSQL_USER = extmail
- SYS_MYSQL_PASS = extmail
- SYS_MYSQL_HOST = localhost #指明數據庫服務器主機名,這裏默認即可
- SYS_MYSQL_TABLE = mailbox
- SYS_MYSQL_ATTR_USERNAME = username
- SYS_MYSQL_ATTR_DOMAIN = domain
- SYS_MYSQL_ATTR_PASSWD = password
- 以上用來指定驗正用戶登錄裏所用到的表,以及用戶名、域名和用戶密碼分別對應的表中列的名稱;這裏默認即可
- SYS_AUTHLIB_SOCKET = /var/spool/authdaemon/socket
- 此句用來指明authdaemo socket文件的位置,這裏修改爲:
- SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket
五、配置apache
- 由於extmail要進行本地郵件的投遞操作,故必須將運行apache服務器用戶的身份修改爲您的郵件投遞代理的用戶
- 本例中打開了apache服務器的suexec功能,故使用以下方法來實現虛擬主機運行身份的指定。此例中的MDA爲
- postfix自帶,因此將指定爲postfix用戶:
- [root@mail ~]# vim /etc/httpd/httpd.conf
- 1、定位至:DocumentRoot 禁用中心主機
- 2、在配置文件尾部添加如下內容:
- <VirtualHost *:80>
- ServerName mail.magedu.com
- DocumentRoot /web/vhosts/extsuite/extmail/html/
- ScriptAlias /extmail/cgi /web/vhosts/extsuite/extmail/cgi
- Alias /extmail /web/vhosts/extsuite/extmail/html
- SuexecUserGroup postfix postfix #Suexec就表示運行某些服務時,不以系統指定的身份運行,而以suexec指定的身份運行
- </VirtualHost>
- 修改 cgi執行文件屬主爲apache運行身份用戶:
- [root@mail ~]# cd /web/vhosts/extsuite/extmail/
- [root@mail extmail]# ls
- AUTHORS CREDITS dispatch_lig.sh html libs README.filter Version
- cgi dispatch.fcgi FAQ INSTALL README README.vpopmail webmail.cf
- ChangeLog dispatch-init globabook.cf lang README.fcgi tools webmail.cf.default
- [root@mail extmail]# chown -R postfix.postfix cgi/ /var/www/extsuite/extmail/cgi/
- [root@mail extmail]# httpd -t #檢查配置文件語法問題
- 注意:如果您沒有打開apache服務器的suexec功能,也可以使用以下方法解決:
- [root@mail ~]# vim /etc/httpd/httpd.conf
- 修改apache服務的運行者爲postfix
- User postfix
- Group postfix
- <VirtualHost *:80>
- ServerName mail.magedu.com
- DocumentRoot /web/vhosts/extsuite/extmail/html/
- ScriptAlias /extmail/cgi /web/vhosts/extsuite/extmail/cgi #執行cgi腳本的目錄
- Alias /extmail /web/vhosts/extsuite/extmail/html #別名路徑
- </VirtualHost>
- 3、依賴關係的解決
- extmail將會用到perl的Unix::syslogd功能,您可以去http://search.cpan.org搜索下載原碼包進行安裝。
- [root@mail ~]# tar xf Unix-Syslog-1.1.tar.gz
- [root@mail ~]# cd Unix-Syslog-1.1
- [root@mail Unix-Syslog-1.1]# perl Makefile.PL
- [root@mail Unix-Syslog-1.1]# make
- [root@mail Unix-Syslog-1.1]# make install
- 4、啓動apache服務
- # service httpd start
六、安裝extman-1.1
- 1、安裝及基本配置
- 由於前面用到了extman,已經解壓過了,所以這了我們直接使用
- [root@mail ~]# mv extman-1.1 /web/vhosts/extsuite/extman
- 提供配置文件並修改配置文件以符合本例的需要:
- [root@mail ~]# cd /web/vhosts/extsuite/extman/
- [root@mail extman]# ls
- addon cgi contrib docs INSTALL libs README.fcgi Version
- AUTHORS ChangeLog daemon html lang README tools webman.cf.default
- [root@mail extman]# cp webman.cf.default webman.cf
- [root@mail extman]# vim webman.cf
- 2、修改主配置文件
- 我們這裏的網頁路徑是/web/vhosts/ 與默認的不一致,所以修改配置文件
- 把SYS_CONFIG = /var/www/extsuite/extmail/ 改爲 SYS_CONFIG = /web/vhosts/extsuite/extman/
- 把SYS_LANGDIR = /var/www/extsuite/extmail/lang 改爲 SYS_LANGDIR = /web/vhosts/extsuite/extman/lang
- 把SYS_TEMPLDIR = /var/www/extsuite/extmail/html 改爲 SYS_TEMPLDIR = /web/vhosts/extsuite/extman/html
- SYS_MAILDIR_BASE = /home/domains 此處即爲您在前文所設置的用戶郵件的存放目錄,可改作:
- SYS_MAILDIR_BASE = /var/mailbox
- 修改 SYS_CAPTCHA_ON = 1 爲 SYS_CAPTCHA_ON = 0
- SYS_CAPTCHA_ON = # 是否開啓驗證碼功能,我們這裏不開啓
- SYS_DEFAULT_UID = 1000
- SYS_DEFAULT_GID = 1000
- 此兩處後面設定的ID號需更改爲前而創建的postfix用戶和postfix組的id號,本文使用的是2525
- 因此,上述兩項需要修改爲:
- SYS_DEFAULT_UID = 2525
- SYS_DEFAULT_GID = 2525
- SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock # 這個選項如果使用rpm包安裝的mysql就不用改了
- 我們這裏是源碼編譯安裝的,改爲:
- SYS_MYSQL_SOCKET = /tmp/mysql.sock
- 3、連上mysql,創建extman用戶,並賦予extman用戶extmail庫上對錶的所有權限
- [root@mail extman]# mysql -uroot -p
- Warning: mysql: ignoring option '--named-commands' due to invalid value 'root'
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 28
- Server version: 5.5.28-log Source distribution
- Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
- mysql> grant all privileges on extmail.* to webman@localost identified by 'webman';
- Query OK, 0 rows affected (0.43 sec)
- mysql> grant all privileges on extmail.* to [email protected] identified by 'webman';
- Query OK, 0 rows affected (0.00 sec)
- mysql> flush privileges; #讓mysql刷新授權表,重讀授權表
- Query OK, 0 rows affected (0.20 sec)
- mysql>
- 而後修改cgi目錄的屬主和數組爲postfix:
- [root@mail extman]# pwd
- /web/vhosts/extsuite/extman
- [root@mail extman]# chown -R postfix.postfix /web/vhosts/extsuite/extman/cgi
- 在apache的主配置文件中Extmail的虛擬主機部分,添加如下兩行:
- ScriptAlias /extman/cgi /web/vhosts/extsuite/extman/cgi
- Alias /extman /web/vhosts/extsuite/extman/html
- 完後重啓服務,讓之生效:
- [root@mail extman]# service httpd restart
- Stopping httpd: [ OK ]
- Starting httpd: [ OK ]
- 創建其運行時所需的臨時目錄,並修改其相應的權限:
- [root@mail extman]# mkdir -pv /tmp/extman
- mkdir: created directory `/tmp/extman'
- [root@mail extman]# chown -R postfix.postfix /tmp/extman
好了,這是我們的郵件服務給予虛擬域、虛擬用戶認證過程已經完工了,下面我們來試一下吧!
點擊那個添加域,我們可以添加一個域,然後在這個域裏申請兩個用戶,就可以用這兩個用戶,互相發送和接收郵件,大家都來試一試吧!
下面就是怎樣實現pops和imaps來實現郵件加密了,未完待續!