構建Postfix郵件服務器

Postfix是一款基於開源環境,用於取代在開源環境中Sendmail的一種嘗試。與Sendmail相比postfix更快、更安全、更加易於管理,於此同時還與Sendmail保持了足夠的兼容性。

下面是基於Postfix配合Dovecat、Extmail與Extman實現提供具有SASL認證的web服務的郵件服務器

下面對postfix郵件服務器的具體構建、以及各部分的測試過程進行詳述:

一、安裝前的準備工作

爲了實現完整的郵件服務器功能,我們需要具有解析本域郵件服務器功能的DNS Server,具體過程不再贅述,可以參考作者博文:《Linux下DNS服務器搭建詳解》http://evolution.blog.51cto.com/3343305/643520

1.安裝所需的rpm包

  1. yum install -y 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 
  2. #爲了降低搭建過程的複雜程度,這裏作者將非必須編譯安裝的軟件使用yum源來安裝 

2.關閉sendmail,並卸載

  1. service sendmail stop 
  2. chkconfig sendmail off 
  3. rpm -e --nodeps sendmail 
  4. #卸載sendmail防止影響後面postfix的安裝工作 

3.安裝編譯安裝時需要用到的開發包組

  1. yum -y groupinstall "Development Libraries" "Development Tools" "Legacy Software Development" "X Software Development" 

4.啓動Mysql數據庫,並設置密碼

  1. service mysqld start 
  2. chkconfig mysqld on 
  3. /usr/bin/mysql 
  4. mysql>SET PASSWORD FOR root@'localhost'=PASSWORD('redhat');    
  5. mysql>SET PASSWORD FOR root@'127.0.0.1'=PASSWORD('redhat');  
  6. #設置本地登錄密碼 
  7. mysql>GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'redhat'
  8. #設置遠程登陸密碼 
  9. mysql>FLUSH PRIVILEGES; 
  10. mysql>quit 

5.啓動SASL並加入開機啓動

  1. service saslauthd start 
  2. chkconfig saslauthd on 

二、安裝配置Postfix

1.編譯安裝

  1. groupadd -g 2525 postfix   
  2. useradd -g postfix -u 2525 -s /sbin/nologin -M postfix 
  3. groupadd -g 2526 postdrop 
  4. useradd -g postdrop -u 2526 -s /bin/false -M postdrop 
  5. #創建postfix用戶 
  6. tar zxvf postfix-2.6.5.tar.gz  
  7. cd postfix-2.6.5 
  8. 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' 
  9. #編譯選項:gcc的編譯選項;mysql頭文件;支持sasl認證;cyrus_sasl的頭文件;mysql的客戶端;指明auxlibs的位置 
  10. make 
  11. make install 

  1. 以下是安裝時提示輸入的內容,“[]”中爲默認值 
  2. install_root: [/] / 
  3. tempdir: [/usr/local/src/ postfix-2.6.5] /tmp 
  4. config_directory: [/etc/postfix] /etc/postfix 
  5. daemon_directory: [/usr/libexec/postfix]  
  6. command_directory: [/usr/sbin]  
  7. queue_directory: [/var/spool/postfix] 
  8. sendmail_path: [/usr/sbin/sendmail] 
  9. newaliases_path: [/usr/bin/newaliases] 
  10. mailq_path: [/usr/bin/mailq] 
  11. mail_owner: [postfix] 
  12. setgid_group: [postdrop]    
  13. html_directory: [no] /var/www/postfix_html 
  14. manpages: [/usr/local/man] 
  15. readme_directory: [no

編譯安裝完成後

  1. newaliases 
  2. 生成別名二進制文件,這個步驟如果忽略,會造成postfix效率極低。 

2.配置postfix

  1. vim /etc/postfix/main.cf 
  2. myhostname = mail.evo.com 
  3. #指定運行postfix郵件系統的主機的主機名 
  4. myorigin = evo.com 
  5. #指明發件人所在的域名 
  6. mydomain = evo.com 
  7. #郵件服務器的域名 
  8. mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain 
  9. #指定postfix接收郵件時收件人的域名 
  10. mynetworks = 192.168.0.0/24, 127.0.0.0/8 
  11. #指定你所在的網絡的網絡地址 
  12. inet_interfaces  
  13. #參數指定postfix系統監聽的網絡接口 

3.添加postfix啓動腳本

  1. vim /etc/init.d/postfix 
  2.  
  3. #!/bin/bash 
  4. . /etc/rc.d/init.d/functions 
  5. . /etc/sysconfig/network 
  6. [ ${NETWORKING} = "no" ] && exit 0 
  7.  
  8. [ -x /usr/sbin/postfix ] || exit 0 
  9. [ -d /etc/postfix ] || exit 0 
  10. [ -d /var/spool/postfix ] || exit 0 
  11.  
  12. RETVAL=0 
  13. prog="postfix" 
  14.  
  15. start() { 
  16.     # Start daemons. 
  17.     echo -n $"Starting postfix: " 
  18.         /usr/bin/newaliases >/dev/null 2>&1 
  19.     /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure $"$prog start" 
  20.     RETVAL=$? 
  21.     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix 
  22.         echo 
  23.     return $RETVAL 
  24.  
  25. stop() { 
  26.         # Stop daemons. 
  27.     echo -n $"Shutting down postfix: " 
  28.     /usr/sbin/postfix stop 2>/dev/null 1>&2 && success || failure $"$prog stop" 
  29.     RETVAL=$? 
  30.     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/postfix 
  31.     echo 
  32.     return $RETVAL 
  33.  
  34. reload() { 
  35.     echo -n $"Reloading postfix: " 
  36.     /usr/sbin/postfix reload 2>/dev/null 1>&2 && success || failure $"$prog reload" 
  37.     RETVAL=$? 
  38.     echo 
  39.     return $RETVAL 
  40.  
  41. abort() { 
  42.     /usr/sbin/postfix abort 2>/dev/null 1>&2 && success || failure $"$prog abort" 
  43.     return $? 
  44.  
  45. flush() { 
  46.     /usr/sbin/postfix flush 2>/dev/null 1>&2 && success || failure $"$prog flush" 
  47.     return $? 
  48.  
  49. check() { 
  50.     /usr/sbin/postfix check 2>/dev/null 1>&2 && success || failure $"$prog check" 
  51.     return $? 
  52.  
  53. restart() { 
  54.     stop 
  55.     start 
  56.  
  57. # See how we were called. 
  58. case "$1" in 
  59.   start) 
  60.     start 
  61.     ;; 
  62.   stop) 
  63.     stop 
  64.     ;; 
  65.   restart) 
  66.     stop 
  67.     start 
  68.     ;; 
  69.   reload) 
  70.     reload 
  71.     ;; 
  72.   abort) 
  73.     abort 
  74.     ;; 
  75.   flush) 
  76.     flush 
  77.     ;; 
  78.   check) 
  79.     check 
  80.     ;; 
  81.   status) 
  82.     status master 
  83.     ;; 
  84.   condrestart) 
  85.     [ -f /var/lock/subsys/postfix ] && restart || : 
  86.     ;; 
  87.   *) 
  88.     echo $"Usage: $0 {start|stop|restart|reload|abort|flush|check|status|condrestart}" 
  89.     exit 1 
  90. esac 
  91.  
  92. exit $? 

  1. chmod +x postfix 
  2. #給腳本執行權限 
  3. chkconfig --add postfix 
  4. #添加默認2345運行級別隨系統啓動 
  5. service postfix start 
  6. #啓動postfix 

4.測試postfix,驗正服務啓動狀況

  1. >telnet 192.168.0.71 25 
  2. Trying 192.168.0.71... 
  3. Connected to station71.redhat_hu.com (192.168.0.71). 
  4. Escape character is '^]'
  5. 220 mail.evo.com ESMTP Postfix 
  6. >ehlo mail.evo.com 
  7. 250-mail.evo.com 
  8. 250-PIPELINING 
  9. 250-SIZE 10240000 
  10. 250-VRFY 
  11. 250-ETRN 
  12. 250-ENHANCEDSTATUSCODES 
  13. 250-8BITMIME 
  14. 250 DSN 
  15. >mail from:root@evo.com 
  16. 250 2.1.0 Ok 
  17. >rcpt to:root@evo.com 
  18. 250 2.1.5 Ok 
  19. >data 
  20. 354 End data with <CR><LF>.<CR><LF> 
  21. >subject:test 
  22. >test 123... 
  23. >. 
  24. 250 2.0.0 Ok: queued as 7AAD51B803D 
  25. >quit 
  26. 221 2.0.0 Bye 
  27. Connection closed by foreign host. 
  28. You have mail in /var/spool/mail/root 
  29. #已有提示收到測試郵件 
  30. >mail 
  31. #查看郵箱 
  32. Mail version 8.1 6/6/93.  Type ? for help. 
  33. "/var/spool/mail/root": 1 message 1 new 
  34. N  1 root@evo.com          Sun Aug 14 20:03  15/481   "test" 

三、爲postfix開啓基於cyrus-sasl的認證功能

1.編輯postfix配置文件

  1. vi /etc/postfix/main.cf 
  2. 添加以下內容: 
  3. broken_sasl_auth_clients = yes 
  4. #定義是否允許突破sasl認證 
  5. 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 
  6. smtpd_sasl_auth_enable = yes 
  7. #啓動sasl認證 
  8. smtpd_sasl_local_domain = $myhostname 
  9. #本域名定義 
  10. smtpd_sasl_security_options = noanonymous 
  11. #不支持匿名 
  12. smtpd_sasl_application_name = smtpd 
  13. smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version has been hidden! 
  14. #隱藏版本信息 

2.編輯stmtpd服務配置文件

  1. vim /usr/lib/sasl2/smtpd.conf 
  2. pwcheck_method: saslauthd 
  3. #密碼檢驗方法爲sasl認證 
  4. mech_list: PLAIN LOGIN 

3.重啓postfix服務

  1. service postfix restart 

4.測試SASL認證

  1. >telnet 192.168.0.71 25 
  2. Trying 192.168.0.71... 
  3. Connected to station71.redhat_hu.com (192.168.0.71). 
  4. Escape character is '^]'
  5. 220 Welcome to our mail.evo.com ESMTP,Warning: Version has been hidden. 
  6. >ehlo mail.evo.com  
  7. 250-mail.evo.com 
  8. 250-PIPELINING 
  9. 250-SIZE 10240000 
  10. 250-VRFY 
  11. 250-ETRN 
  12. 250-AUTH PLAIN LOGIN 
  13. 250-AUTH=PLAIN LOGIN   
  14. #有以上兩行說明CYRUS-SASL認證添加成功 
  15. 250-ENHANCEDSTATUSCODES 
  16. 250-8BITMIME 
  17. 250 DSN 
  18. >quit 
  19. 221 2.0.0 Bye 
  20. Connection closed by foreign host. 

四、安裝Courier authentication library

注意:請確保安裝libtool-ltdl,libtool-ltdl-devel不然編譯過程會報錯

1.編譯安裝Courier auth

  1. tar jxvf courier-authlib-0.62.4.tar.bz2 
  2. cd courier-authlib-0.62.4 
  3. ./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 CFLAGS="-march=i686 -O2 -fexpensive-optimizations"   CXXFLAGS="-march=i686 -O2 -fexpensive-optimizations" 
  4. make 
  5. make install 

2.編輯配置文件

  1. chmod 755 /usr/local/courier-authlib/var/spool/authdaemon 
  2. cp /etc/authdaemonrc.dist  /etc/authdaemonrc 
  3. cp /etc/authmysqlrc.dist  /etc/authmysqlrc 
  4.  
  5. vim /etc/authdaemonrc  
  6. authmodulelist="authmysql" 
  7. authmodulelistorig="authmysql"     
  8. daemons=10 
  9. #修改這3行 
  10. vim /etc/authmysqlrc  
  11. MYSQL_SERVER localhost 
  12. MYSQL_PORT 3306                   
  13. #指定你的mysql監聽的端口,這裏使用默認的3306 
  14. MYSQL_USERNAME  extmail       
  15. #這時爲後文要用的數據庫的所有者的用戶名 
  16. MYSQL_PASSWORD extmail         
  17. #密碼 
  18. MYSQL_SOCKET  /var/lib/mysql/mysql.sock  
  19. #此行前註釋去掉 
  20. MYSQL_DATABASE  extmail          
  21. MYSQL_USER_TABLE  mailbox 
  22. MYSQL_CRYPT_PWFIELD  password 
  23. MYSQL_UID_FIELD  '2525' 
  24. MYSQL_GID_FIELD  '2525' 
  25. #2525,2525 爲postfix 用戶的UID和GID 
  26. MYSQL_LOGIN_FIELD  username 
  27. MYSQL_HOME_FIELD  concat('/var/mailbox/',homedir)        
  28. #本地郵箱的位置 
  29. MYSQL_NAME_FIELD  name 
  30. MYSQL_MAILDIR_FIELD  concat('/var/mailbox/',maildir)   

3.爲courier添加啓動腳本

  1. cp courier-authlib.sysvinit /etc/init.d/courier-authlib             #courier提供的啓動腳本 
  2. chmod 755 /etc/init.d/courier-authlib 
  3. chkconfig --add courier-authlib 
  4. chkconfig courier-authlib on 

4.添加庫文件並測試導入情況

  1. echo "/usr/local/courier-authlib/lib/courier-authlib" >> /etc/ld.so.conf   
  2. #或添加到/etc/ld.so.conf.d/courier.conf 
  3. ldconfig -v | grep courier 
  4. #有如下顯示錶示庫文件添加成功 
  5. /usr/local/courier-authlib/lib/courier-authlib: 
  6.     libcourierauthcommon.so -> libcourierauthcommon.so.0 
  7.     libcourierauth.so -> libcourierauth.so.0 
  8.     libcourierauthsasl.so -> libcourierauthsasl.so.0 
  9.     libcourierauthsaslclient.so -> libcourierauthsaslclient.so.0 

5.啓動courier-authlib服務

  1. service courier-authlib start    
  2. #啓動服務 
  3. ps aux |grep courier 
  4. #查看進程啓動狀態 

6.創建虛擬用戶郵箱目錄

  1. mkdir –pv /var/mailbox 
  2. #新建虛擬用戶郵箱所在的目錄,並將其權限賦予postfix用戶 
  3. chown –R postfix /var/mailbox    
  4. #所有用戶的郵件都在這裏 

7.重新修改smtpd服務配置文件,確保是如下內容

  1. pwcheck_method: authdaemond 
  2. log_level: 3 
  3. mech_list:PLAIN LOGIN 
  4. authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket 
  5. #添加這些內容進去 

五、讓postfix支持虛擬域和虛擬用戶

1.編輯postfix配置文件,添加如下內容於配置文件末行

  1. vim /etc/postfix/main.cf 
  2. virtual_mailbox_base = /var/mailbox 
  3. #指明虛擬用戶郵件目錄 
  4. virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf 
  5. virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf 
  6. virtual_alias_domains = 
  7. virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf 
  8. virtual_uid_maps = static:2525 
  9. virtual_gid_maps = static:2525 
  10. virtual_transport = virtual 
  11. maildrop_destination_recipient_limit = 1 
  12. maildrop_destination_concurrency_limit = 1  
  13. message_size_limit = 14336000 
  14. virtual_mailbox_limit = 20971520 
  15. virtual_create_maildirsize = yes 
  16. virtual_mailbox_extended = yes 
  17. virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf 
  18. virtual_mailbox_limit_override = yes 
  19. virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please Tidy your mailbox and try again later. 
  20. virtual_overquota_bounce = yes 

2.添加extmail數據進mysql數據庫

  1. tar zxvf  extman-1.1.tar.gz 
  2. cd extman-1.1/docs 
  3. mysql -u root -p <extmail.sql    
  4. #添加extmail.sql數據庫到mysql 
  5. mysql -u root -p <init.sql 
  6. #添加init.sql數據庫到mysql 
  7. cp mysql*  /etc/postfix/ 

3.授予用戶extmail訪問extmail數據庫的權限

  1. mysql> GRANT all privileges on extmail.* TO extmail@localhost IDENTIFIED BY 'extmail'
  2. mysql> GRANT all privileges on extmail.* TO extmail@127.0.0.1 IDENTIFIED BY 'extmail'

4.在此修改postfix配置文件

爲了支持虛擬用戶,需要對/etc/postfix/main.cf即postfix的配置文件做如下修改:

虛擬域以後,需要取消中心域,註釋掉myhostname, mydestination, mydomain, myorigin,mydestionation幾個指令。

六、配置Dovecot

1.編輯dovecot主配置文件

  1. vim /etc/dovecot.conf 
  2. mail_location = maildir:/var/mailbox/%d/%n/Maildir    
  3. #修改此項 
  4. auth default {                                                                       
  5.     mechanisms = plain 
  6. #pam {xxxxxxxx}                                                                                             #注意把pam{}這一項註釋掉   
  7.  passdb sql { 
  8.         args = /etc/dovecot-mysql.conf                              #添加此項 
  9.     } 
  10.     userdb sql { 
  11.         args = /etc/dovecot-mysql.conf                              #添加此項 
  12.     } 
  13.     

2.編輯dovecot與mysql關聯的配置文件

  1. vim /etc/dovecot-mysql.conf                  
  2. driver = mysql                                       
  3. connect = host=localhost dbname=extmail user=extmail password=extmail    
  4. default_pass_scheme = CRYPT 
  5. password_query = SELECT username AS user,password AS password FROM mailbox WHERE username = '%u'                             
  6. user_query = SELECT maildir, uidnumber AS uid, gidnumber AS gid FROM mailbox WHERE username = '%u' 

3.啓動dovecot服務

  1. service dovecot start 
  2. chkconfig dovecot on 

七、安裝Extmail

1.解壓安裝

  1. tar zxvf extmail-1.2.tar.gz 
  2. mkdir -pv /var/www/extsuite 
  3. mv extmail-1.2 /var/www/extsuite/extmail 
  4. cp /var/www/extsuite/extmail/webmail.cf.default  /var/www/extsuite/extmail/webmail.cf 
  5. #複製配置文件 

2.修改主配置文件

  1. SYS_MESSAGE_SIZE_LIMIT = 5242880 
  2. #用戶可以發送的最大郵件 
  3. SYS_USER_LANG = zh_CN 
  4. #語言選項選擇中文 
  5. SYS_MAILDIR_BASE = /var/mailbox 
  6. #修改郵件的存放目錄 
  7. SYS_MYSQL_USER = extmail 
  8. SYS_MYSQL_PASS = extmail 
  9. #以上兩句句用來設置連接數據庫服務器所使用用戶名、密碼和郵件服務器用到的數據庫 
  10. SYS_MYSQL_HOST = localhost 
  11. #使用默認選項 
  12. SYS_MYSQL_TABLE = mailbox 
  13. SYS_MYSQL_ATTR_USERNAME = username 
  14. SYS_MYSQL_ATTR_DOMAIN = domain 
  15. SYS_MYSQL_ATTR_PASSWD = password 
  16. #以上用來指定驗正用戶登錄裏所用到的表,以及用戶名、域名和用戶密碼分別對應的表中列的名稱;使用默認值 
  17. SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket 
  18. #此句用來指明authdaemo socket文件的位置 

3.配置apache虛擬主機

  1. vim /etc/httpd/conf/httpd.conf 
  2. User postfix 
  3. Group postfix 
  4. #修改這兩項 
  5. #DocumentRoot "/var/www/html" 
  6. #註釋此項 
  7. NameVirtualHost *:80 
  8. #啓用此項 
  9. <VirtualHost *:80> 
  10. ServerName mail.test.com 
  11. DocumentRoot /var/www/extsuite/extmail/html/ 
  12. ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi 
  13. Alias /extmail /var/www/extsuite/extmail/html 
  14. </VirtualHost> 
  15. <Directory "/var/www/extsuite/extmail/html/"
  16.     Order allow,deny 
  17.     Allow from all 
  18. </Directory> 
  19. #添加權限 

 

4.解決extmail的依賴關係

  1. tar zxvf Unix-Syslog-0.100.tar.gz 
  2. cd Unix-Syslog-0.100 
  3. perl Makefile.PL 
  4. make 
  5. make install 
  6. #編譯安裝Unix-Syslog 

5.修改 cgi執行文件權限,啓動httpd

  1. chown -R postfix.postfix /var/www/extsuite/extmail/cgi/ 
  2. service httpd start 
  3. chkconfig httpd on 

八、安裝Extman

1.安裝extman

  1. tar zxvf  extman-1.1.tar.gz 
  2. mv extman-1.1 /var/www/extsuite/extman 

2.編輯extman的配置文件

  1. cp /var/www/extsuite/extman/webman.cf.default  /var/www/extsuite/extman/webman.cf 
  2. vim /var/www/extsuite/extman/webman.cf 
  3. SYS_MAILDIR_BASE = /var/mailbox 
  4. #用戶郵件的存放目錄 
  5. SYS_CAPTCHA_ON = 0   
  6. #關閉驗證碼功能 
  7. SYS_DEFAULT_UID=2525 
  8. SYS_DEFAULT_UID=2525 
  9. #將虛擬用戶映射本地用戶2525以下載郵件 

3.修改apache配置文件

在上文虛擬主機配置字段中添加如下兩行

  1. ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi 
  2. Alias /extman /var/www/extsuite/extman/html 

4.修改權限,使postfix能夠使用Ext族組件

  1. chown -R postfix.postfix /var/www/extsuite 

5.創建運行時所需的臨時文件

  1. mkdir  -pv  /tmp/extman 
  2. chown postfix.postfix  /tmp/extman 

九、圖形化日誌啓用

1.按照如下安裝順序安裝以下3個軟件包

  1. tar zxvf Time-HiRes-1.9707.tar.gz 
  2. cd Time-HiRes-1.9707 
  3. perl Makefile.PL 
  4. make 
  5. make test 
  6. make install 
  7. #安裝time-hires 
  8. tar zxvf File-Tail-0.99.3.tar.gz 
  9. cd File-Tail-0.99.3 
  10. perl Makefile 
  11. make 
  12. make test 
  13. make install 
  14. #安裝file-tail 
  15. tar zxvf rrdtool-1.4.5.tar.gz 
  16. cd rrdtool-1.4.5 
  17. ./configure --prefix=/usr/local/rrdtool 
  18. make 
  19. make install 
  20. #安裝rrdtool 

2.創建必須得符號鏈接

  1. ln -vs /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/auto/RRDs/RRDs.so /usr/lib/perl5/5.8.8/i386-linux-thread-multi/ 
  2. ln -vs /usr/local/rrdtool/lib/perl/5.8.8/RRDp.pm /usr/lib/perl5/5.8.8/ 
  3. ln -vs /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/RRDs.pm /usr/lib/perl5/5.8.8/ 

3.調整文件並啓動服務

  1. cp -r /var/www/extsuite/extman/addon/mailgraph_ext  /usr/local   
  2. #複製mailgraph_ext到/usr/local 
  3. /usr/local/mailgraph_ext/mailgraph-init start  
  4. #啓動服務 
  5.  /var/www/extsuite/extman/daemon/cmdserver --daemon 
  6. #啓動cmdserver在後臺顯示系統信息 
  7.  
  8. echo “/usr/local/mailgraph_ext/mailgraph-init start” >> /etc/rc.d/rc.local 
  9. echo “/var/www/extsuite/extman/daemon/cmdserver -v -d” >> /etc/rc.d/rc.local  
  10. #添加這兩條,使其能夠在系統初始化完成後實行啓動腳本 

 到此我們的配置就已經完成了,由於作者使用的是VMware虛擬機故這裏將物理機首選DNS指向虛擬機ip,瀏覽器中輸入郵件服務器域名即可登入。

首次登陸:使用管理員賬號/密碼

管理帳號爲:[email protected]  密碼爲:extmail*123*

 

 圖形化統計日誌

 

 Ps:此時,只能在本域中發送郵件;若要實現向外域發送郵件的功能,在DNS配置文件中添加轉發即可。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章