设为首页 收藏本站
查看: 1281|回复: 0

[经验分享] CentOS 5.6+Postfix+LDAP(虚拟域)+ExtMail+BIND9+Dovecot

[复制链接]

尚未签到

发表于 2015-11-24 10:43:25 | 显示全部楼层 |阅读模式
Mail Server建置很久了,今天帖上来,记录建置邮件服务器的全过程,中间图片还在插进来就不帖上了
一,Setup OS
图:省略,默认安装即可
二,BIND9 Named Setup (可以不用做,一樣可以收發郵件)
[iyunv@mail chroot]# yum install bind-libbind-devel[iyunv@mail chroot]# yum install bind-devel[iyunv@mail chroot]#yum install caching-nameserver[iyunv@mail chroot]# rpm -qa | grep bindbind-utils-9.3.6-16.P1.el5ypbind-1.19-12.el5bind-chroot-9.3.6-16.P1.el5bind-9.3.6-16.P1.el5bind-libs-9.3.6-16.P1.el5bind-libbind-devel-9.3.6-16.P1.el5bind-devel-9.3.6-16.P1.el5[iyunv@mail chroot]#[iyunv@mail chroot]# more /etc/named.caching-nameserver.conf//// named.caching-nameserver.conf//// Provided by Red Hat caching-nameserver package to configure the// ISC BIND named(8) DNS server as a caching only nameserver // (as a localhost DNS resolver only). //// See /usr/share/doc/bind*/sample/ for example named configuration files.//// DO NOT EDIT THIS FILE - use system-config-bind or an editor// to create named.conf - edits to this file will be lost on // caching-nameserver package upgrade.//options {        listen-on port 53 { any; };        listen-on-v6 port 53 { ::1; };        directory       "/var/named";        dump-file       "/var/named/data/cache_dump.db";        statistics-file "/var/named/data/named_stats.txt";        memstatistics-file "/var/named/data/named_mem_stats.txt";
        // Those options should be used carefully because they disable port        // randomization        // query-source    port 53;        // query-source-v6 port 53;
        allow-query     { any; };        allow-query-cache { any; };};logging {        channel default_debug {                file "data/named.run";                severity dynamic;        };};view localhost_resolver {        match-clients      { any; };        match-destinations { any; };        recursion yes;        include "/etc/named.rfc1912.zones";};
[iyunv@mail etc]# vi /var/named/chroot/etc/named.rfc1912.zones    //add zone "wht.com" IN {        type master;        file "wht.com.zone";        allow-update { none; };};
zone "86.16.172.in-addr.arpa" IN {        type master;        file "named.172.16.86";        allow-update { none; };};
[iyunv@mail named]# cd /var/named/chroot/var/named[iyunv@mail named]#cp named.local named.172.16.86[iyunv@mail named]#cp localhost.zone wht.com.zone[iyunv@mail named]#vi named.172.16.86 $TTL    86400@       IN      SOA     mail.wht.com. root.wht.com.  (                                      1997022700 ; Serial                                      28800      ; Refresh                                      14400      ; Retry                                      3600000    ; Expire                                      86400 )    ; Minimum          IN      NS      mail.wht.com.103       IN      PTR     mail.wht.com.103       IN      PTR     www.wht.com.[iyunv@mail named]#[iyunv@mail named]# vi wht.com.zone $TTL    86400@       IN SOA  mail.wht.com root.wht.com. (                    42      ; serial (d. adams)                    3H      ; refresh                    15M     ; retry                    1W      ; expiry                    1D )        ; minimum            IN NS       www.wht.com.        IN MX 5     mail.wht.com.www     IN A        172.16.86.103mail    IN A        172.16.86.103[iyunv@mail named]#[iyunv@mail named]#chown –R root.named /var/named/chroot/var/named[iyunv@mail named]#service named start[iyunv@mail named]# host www.wht.comwww.wht.com has address 172.16.86.103[iyunv@mail named]# host 172.16.86.103103.86.16.172.in-addr.arpa domain name pointer mail.wht.com.103.86.16.172.in-addr.arpa domain name pointer www.wht.com.[iyunv@mail named]# host -t mx mail.wht.commail.wht.com has no MX record[iyunv@mail named]# host -t mx wht.com     wht.com mail is handled by 5 mail.wht.com.[iyunv@mail named]# pwd/var/named/chroot/var/named[iyunv@mail named]#

三,OpenLDAP setup[iyunv@mail ~]# rpm -qa|grep openldapopenldap-clients-2.3.43-12.el5_5.3openldap-2.3.43-12.el5_5.3[iyunv@mail ~]# yum install openldap-*(只安裝下面藍色部分也行)Dependencies Resolved
==================================================================================================================================== Package                                    Arch                  Version                            Repository                Size====================================================================================================================================Installing: openldap-devel                             i386                  2.3.43-12.el5_7.9                  updates                  1.5 M openldap-servers                           i386                  2.3.43-12.el5_7.9                  updates                  3.1 M openldap-servers-overlays                  i386                  2.3.43-12.el5_7.9                  updates                  194 k openldap-servers-sql                       i386                  2.3.43-12.el5_7.9                  updates                  120 kInstalling for dependencies: cyrus-sasl-devel                           i386                  2.1.22-5.el5_4.3                   base                     1.4 M
Transaction Summary====================================================================================================================================Install       5 Package(s)Upgrade       0 Package(s)
Total download size: 6.3 MIs this ok [y/N]: y[iyunv@mail config]# vi /etc/openldap/ldap.confBASE    dc=wht.comURI     ldap://172.16.86.103SIZELIMIT       12TIMELIMIT       15DEREF           never
[iyunv@mail openldap]# vi /etc/openldap/slapd.confinclude         /etc/openldap/schema/core.schemainclude         /etc/openldap/schema/cosine.schemainclude         /etc/openldap/schema/inetorgperson.schemainclude         /etc/openldap/schema/nis.schemaallow bind_v2pidfile         /var/run/openldap/slapd.pidargsfile        /var/run/openldap/slapd.argsaccess to dn.base="" by * readaccess to dn.base="cn=Subschema" by * readaccess to *             by self write         by users read         by anonymous auth // by anonymous read        by * none后续这两行要更改及加入,否则extmail默认匿名存取ldap,将得不到ldap的数据,造成邮件无法收寄,这里搞了好久。//database        bdbsuffix          "dc=wht.com"             //这个一定要和ExtMail中init.ldif设置一样,否则init.ldif无法改入rootdn          "cn=Manager,dc=wht.com"rootpw         {SSHA}{MD5}EehorLTQ01Upk2R8Av/HXw== (密碼postfix,使用slappasswd –h {MD5}前面不能有空格,否則會出現錯誤:ldap_bind: Invalid credentials (49))directory       /var/lib/ldapindex objectClass                       eq,presindex ou,cn,mail,surname,givenname      eq,pres,subindex uidNumber,gidNumber,loginShell    eq,presindex uid,memberUid                     eq,pres,subindex nisMapName,nisMapEntry            eq,pres,subloglevel 256  //注意要用TAB分開,不能用空格,否則產生不了日志
[iyunv@mail openldap]# slaptestbdb_db_open: Warning - No DB_CONFIG file found in directory /var/lib/ldap: (2)Expect poor performance for suffix dc=wht,dc=com.config file testing succeeded[iyunv@mail openldap]#[iyunv@mail ldap]#cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG[iyunv@mail ldap]# service ldap restart正在停止 slapd: [  確定  ]正在為 slapd 檢查設定檔案:  config file testing succeeded[  確定  ]正在啟動 slapd: [  確定  ]

[iyunv@mail soft]# vi wht.com.ldif  //这个只是测试没有什么实际意义,可以不做,下步导入ExtMail的init.ldif才是最主要的dn: dc=wht,dc=comdc: whto:  wht.comobjectClass: topobjectClass: domain
dn: ou=mail,dc=wht,dc=comou: mailobjectClass: topobjectClass: organizationalUnit
dn: cn=Manager,dc=wht,dc=comobjectClass: topobjectClass: organizationalRolecn: Manager [iyunv@mail soft]#

[iyunv@mail soft]# ldapadd -x -D "cn=Manager,dc=wht,dc=com" -w postfix -f wht.com.ldifadding new entry "dc=wht,dc=com"adding new entry "ou=mail,dc=wht,dc=com"
啟用LDAP Log功能 [iyunv@mail log]# vi /etc/openldap/slapd.conf Loglevel 256  //注意要用TAB分開,不能用空格,否則產生不了日志
[iyunv@mail log]# vi /etc/syslog.conf#Save OpenLDAP.loglocal4.*                                                /var/log/openldap.log[iyunv@mail log]# touch /var/log/openldap.log[iyunv@mail log]# chown ldap.ldap /var/log/openldap.log[iyunv@mail log]# service syslog restart[iyunv@mail log]# service ldap restart

安裝phpldapadmin[iyunv@mail soft]# tar -zxvf phpldapadmin-0.9.8.5.tar.gz[iyunv@mail soft]# mv  phpldapadmin-0.9.8.5 /var/www/html/phpldapadmin[iyunv@mail soft]# cd /var/www/html/ phpldapadmin/conf[iyunv@mail config]# cp config.php.example config.php#vi config.php$config->custom->appearance['language'] = 'zh_TW';$ldapservers->SetValue($i,'server','name','wht.com LDAP Server');$ldapservers->SetValue($i,'server','host','localhost');$ldapservers->SetValue($i,'server','port','389');$ldapservers->SetValue($i,'server','base',array('dc=wht,dc=com'));$ldapservers->SetValue($i,'server','auth_type','cookie');$ldapservers->SetValue($i,'login','dn','cn=Manager, dc=umec,dc=com');#service httpd restart


安裝webmin
[iyunv@mail soft]# rpm -ivh webmin-1.520-1.noarch.rpm警告:webmin-1.520-1.noarch.rpm: 表頭 V3 DSA 簽名:NOKEY, key ID 11f63c51正在準備…             ########################################### [100%]Operating system is CentOS Linux   1:webmin                 ########################################### [100%]Webmin install complete. You can now login to https://mail.wht.com:10000/as root with your root password.  
為VIM增加顏色[iyunv@mail soft]# yum install vim-common vim-enhancedLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.comSetting up Install ProcessPackage 2:vim-common-7.0.109-7.el5.i386 already installed and latest versionPackage 2:vim-enhanced-7.0.109-7.el5.i386 already installed and latest versionNothing to doexport TERM=xterm-color
[iyunv@mail soft]# mv /bin/vi /bin/vi.bak[iyunv@mail soft]# ln -s /usr/bin/vim /bin/vi

四,Postfix setup
[iyunv@mail extsuite]# rpm -e sendmail --nodeps警告:/var/log/mail/statistics 已被另存為 /var/log/mail/statistics.rpmsave[iyunv@mail ~]# more /etc/yum.conf#proxy serverproxy=http://172.16.86.253:3128
//这里实际上要设置postfix的uid gid都是extmail默认的1000,否则将来收发邮件时,出现一些莫名的问题,后来懒的改了,就重新安装postfix,设置uid及gid为1000才没有出现其它问题。
[iyunv@mail backup]#groupdel postfix[iyunv@mail backup]#userdel postfix[iyunv@mail home]# groupadd -g 1000 postfix[iyunv@mail home]# useradd postfix -g postfix -u 1000 -G postdrop -c "Postfix User" -d /dev/null -s /sbin/nologin//
[iyunv@mail ~]# yum install postfix[iyunv@mail extsuite]# id postfixuid=89(postfix) gid=89(postfix) groups=89(postfix),12(mail)[iyunv@mail extsuite]# mkdir -p /home/vmail[iyunv@mail extsuite]# chown -R postfix.postfix /home/vmail[iyunv@mail extsuite]# postconf -mbtreecidrenvironhashldap  //支持LDAPnispcreproxyregexpstaticunix[iyunv@mail extsuite]# alternatives --display mtamta - 狀態是自動的。 目前連結指向 /usr/sbin/sendmail.postfix/usr/sbin/sendmail.postfix - 優先順序 30 從屬裝置 mta-pam: /etc/pam.d/smtp.postfix 從屬裝置 mta-mailq: /usr/bin/mailq.postfix 從屬裝置 mta-newaliases: /usr/bin/newaliases.postfix 從屬裝置 mta-rmail: /usr/bin/rmail.postfix 從屬裝置 mta-sendmail: /usr/lib/sendmail.postfix 從屬裝置 mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz 從屬裝置 mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz 從屬裝置 mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz 從屬裝置 mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz目前 `最好的' 版本是 /usr/sbin/sendmail.postfix。[iyunv@mail extsuite]# alternatives --config mta
有 1 程式提供 'mta'。
  選擇        指令-----------------------------------------------*+ 1           /usr/sbin/sendmail.postfix
請輸入以保留目前的選擇[+],或輸入選擇號碼:[iyunv@mail extsuite]#[iyunv@mail postfix]# vi /etc/postfix/main.cf[iyunv@mail postfix]# postconf -nbroken_sasl_auth_clients = yescommand_directory = /usr/sbinconfig_directory = /etc/postfixdaemon_directory = /usr/libexec/postfixdebug_peer_level = 2html_directory = noinet_interfaces = allmail_owner = postfixmailbox_size_limit = 209715200  #邮箱大小限制200Mmailq_path = /usr/bin/mailq.postfixmanpage_directory = /usr/share/manmessage_size_limit = 14336000  #每个邮件最大尺寸10Mmydestination = $myhostname, localhost.$mydomain, localhostmydomain = wht.commyhostname = mail.wht.commynetworks = 172.16.0.0/16, 127.0.0.0/8myorigin = $mydomainnewaliases_path = /usr/bin/newaliases.postfixqueue_directory = /var/spool/postfixreadme_directory = /usr/share/doc/postfix-2.3.3/README_FILESsample_directory = /usr/share/doc/postfix-2.3.3/samplessendmail_path = /usr/sbin/sendmail.postfixsetgid_group = postdropsmtpd_banner = $myhostname ESMTP "Version not Available"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,                                permitsmtpd_sasl_auth_enable = yessmtpd_sasl_local_domain = $myhostnamesmtpd_sasl_path = /var/run/dovecot/auth-client  #与dovecot.conf中如下的的path一致smtpd_sasl_security_options = noanonymoussmtpd_sasl_type = dovecot    #使用dovecot进行验证unknown_local_recipient_reject_code = 550virtual_alias_domains = virtual_alias_maps = ldap:/etc/postfix/ldap/ldap_virtual_alias_maps.cfvirtual_gid_maps = static:89virtual_mailbox_base = /home/vmailvirtual_mailbox_domains = ldap:/etc/postfix/ldap/ldap_virtual_domains_maps.cfvirtual_mailbox_limit = 209715200 #虚拟邮箱大小限制200Mvirtual_mailbox_maps = ldap:/etc/postfix/ldap/ldap_virtual_mailbox_maps.cfvirtual_transport = virtualvirtual_uid_maps = static:89[iyunv@mail postfix]#[iyunv@mail postfix]# mkdir ldap
[iyunv@mail sasl2]# vi /usr/lib/sasl2/smtpd.conf pwcheck_method: saslauthdmech_list: PLAIN LOGIN[iyunv@mail sasl2]#
安裝 Extman,ExtMail[iyunv@mail soft]# tar zxvf extmail-1.1.1.tar.gz[iyunv@mail soft]# tar zxvf extman-1.0.1.tar.gz[iyunv@mail soft]# mkdir -pv /var/www/extsuitemkdir: created directory ‘/var/www/extsuite’[iyunv@mail soft]# mv extman-1.0.1 /var/www/extsuite/extman[iyunv@mail soft]# mv extmail-1.1.1 /var/www/extsuite/extmail
回到OpenLDAP setup[iyunv@mail docs]# cp /var/www/extsuite/extman/docs/extmail.schema /etc/openldap/schema[iyunv@mail docs]# vi /etc/openldap/slapd.conf  //add如下include         /etc/openldap/schema/extmail.schema
index objectClass                       eq,presindex mail,active,virtualDomain,mailLocalAddress        eq,pres
[iyunv@mail soft]# cat /etc/openldap/ldap.conf | grtep –v “#”BASE    dc=wht.comURI     ldap://172.16.86.103SIZELIMIT       12TIMELIMIT       15DEREF           never[iyunv@mail soft]# cat /etc/openldap/slapd.conf |grep -v "#"include         /etc/openldap/schema/core.schemainclude         /etc/openldap/schema/cosine.schemainclude         /etc/openldap/schema/inetorgperson.schemainclude         /etc/openldap/schema/nis.schemainclude         /etc/openldap/schema/extmail.schemaallow bind_v2pidfile         /var/run/openldap/slapd.pidargsfile        /var/run/openldap/slapd.argsaccess to dn.base="" by * readaccess to dn.base="cn=Subschema" by * readaccess to *             by self write         by users read         by anonymous auth
database        bdbsuffix          "dc=wht.com"rootdn          "cn=Manager,dc=wht.com"rootpw          {SSHA}wJeA7NVNB7XtXeC8/3PIKJnSuPYbkvKAdirectory       /var/lib/ldapindex objectClass                       eq,presindex mail,active,virtualDomain,mailLocalAddress        eq,presloglevel        256[iyunv@mail soft]#
[iyunv@mail docs]# cp init.ldif init-wht.ldif[iyunv@mail docs]# vi init-wht.ldif:%s/extmail.org/dc=wht.com/g
[iyunv@mail soft]# more init-wht.ldif # wht.comdn: dc=wht.com   //这个一定要和openldap中的设置一样,否则无法导入objectClass: organizationobjectClass: dcObjectdc: wht.como: wht.com
# Manager, wht.comdn: cn=Manager,dc=wht.comobjectClass: topobjectClass: organizationalRolecn: Manager
# domains + users: o=extmailAccount, dc=wht.comdn: o=extmailAccount,dc=wht.comobjectClass: organizationo: extmailAccount
# aliases: o=extmailAlias, dc=wht.comdn: o=extmailAlias,dc=wht.comobjectClass: organizationo: extmailAlias
# manager: o=extmailManager, dc=wht.comdn: o=extmailManager,dc=wht.comobjectClass: organizationo: extmailManager
# Domain: virtualDomain=wht.com, o=extmailAccount, dc=wht.comdn: virtualDomain=wht.com, o=extmailAccount, dc=wht.comvirtualDomain: wht.comdescription: A virtualDomain for wht.comhashDirPath: A0/B0Transport: virtual:domainMaxQuota: 1073741824domainMaxUsers: 50domainMaxAlias: 50domainMaxNetStore: 1073741824defaultQuota: 5242880defaultNetStore: 5242880defaultExpire: 1ydisablesmtpd: 0disablesmtp: 0disablewebmail: 0disablenetdisk: 0disableimap: 1disablepop3: 0active: 1expireDate: 2010-10-01createDate: 2007-02-14 13:47:56objectclass: topobjectclass: extmailDomain
# User: mail=postmaster@wht.com, virtualDomain=wht.com, o=extmailAccount, dc=wht.comdn: mail=postmaster@wht.com, virtualDomain=wht.com, o=extmailAccount, dc=wht.comcn: Test useruid: testmail: postmaster@wht.comvirtualDomain: wht.commailMessageStore: wht.com/postmaster/Maildir/homeDirectory: wht.com/postmasteruserName: postmaster@wht.commailQuota: 104857600SnetdiskQuota: 52428800SuidNumber: 1000                //默认为1000,此处最好改为id postfix的gid及uidgidNumber: 1000                //默认为1000,此处最好改为id postfix的gid及uiduserPassword: {CRYPT}$1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0active: 1disablesmtpd: 0disablesmtp: 0disablewebmail: 0disablenetdisk: 0disableimap: 0disablepop3: 0expireDate: 2010-10-01createDate: 2007-02-14 17:56:33objectClass: topobjectClass: uidObjectobjectClass: extmailUser
# Alias: mailLocalAddress=support@wht.com, o=extmailAlias, dc=wht.comdn: mailLocalAddress=support@wht.com, o=extmailAlias, dc=wht.commailLocalAddress: support@wht.comvirtualDomain: wht.commail: postmaster@wht.comactive: 1objectclass: extmailAlias//以下为域管理员的帐户及密码,可以在phpmyadmin中修改# Manager: mail=root@wht.com, o=extmailManager, dc=wht.comdn: mail=root@wht.com, o=extmailManager, dc=wht.comcn: Rootuid: rootmail: root@wht.comuserPassword: {CRYPT}$1$BrT9qxfB$Ha81Mb5YVV6rNKNN5jmtj1managerType: adminactive: 1question: who are you?answer: postmasterdisablePasswdChange: 0createDate: 2007-02-14 18:32:14expireDate: 2010-08-01objectclass: topobjectclass: extmailManager[iyunv@mail soft]#
[iyunv@mail docs]# ldapadd -x -D "cn=Manager,dc=wht,dc=com" -w postfix -f /var/www/extsuite/extman/docs/init-wht.ldif
adding new entry "dc=wht.com"
adding new entry "cn=Manager,dc=wht.com"
adding new entry "o=extmailAccount,dc=wht.com"
adding new entry "o=extmailAlias,dc=wht.com"
adding new entry "o=extmailManager,dc=wht.com"
adding new entry "virtualDomain=wht.com, o=extmailAccount, dc=wht.com"
adding new entry "mail=postmaster@wht.com, virtualDomain=wht.com, o=extmailAccount, dc=wht.com"
adding new entry "mailLocalAddress=support@wht.com, o=extmailAlias, dc=wht.com"
adding new entry "mail=root@wht.com, o=extmailManager, dc=wht.com"


回到Postfix setup[iyunv@mail docs]# cp ldap_*.cf /etc/postfix/ldap[iyunv@mail schema]# cd /etc/postfix/ldap/:%s/extmail.org/wht.com/g[iyunv@mail ldap]# cat ldap_virtual_alias_maps.cf server_host = localhostsearch_base = o=extmailAlias,dc=wht.comquery_filter = (&(objectClass=extmailAlias)(mailLocalAddress=%s)(active=1))result_attribute = mailcache = nobind = noscope = sub[iyunv@mail ldap]#[iyunv@mail ldap]# cat ldap_virtual_domains_maps.cf server_host = localhostsearch_base = o=extmailAccount,dc=wht.comquery_filter = (&(objectClass=extmailDomain)(virtualDomain=%s)(active=1))result_attribute = virtualDomaincache = nobind = noscope = sub[iyunv@mail ldap]#[iyunv@mail ldap]# cat ldap_virtual_limit_maps.cf server_host = localhostsearch_base = o=extmailAccount,dc=wht.comquery_filter = (&(objectClass=extmailUser)(mail=%s)(active=1))result_attribute = mailQuotacache = nobind = noscope = sub[iyunv@mail ldap]#[iyunv@mail ldap]# cat ldap_virtual_mailbox_maps.cf server_host = localhostsearch_base = o=extmailAccount,dc=wht.comquery_filter = (&(objectClass=extmailUser)(mail=%s)(active=1))result_attribute = mailMessageStorecache = nobind = noscope = sub[iyunv@mail ldap]#[iyunv@mail ldap]# cat ldap_virtual_sender_maps.cf server_host = localhostsearch_base = o=extmailAccount,dc=wht.comquery_filter = (&(objectClass=extmailUser)(mail=%s)(active=1))result_attribute = mailcache = nobind = noscope = sub[iyunv@mail ldap]#[iyunv@mail ldap]# cat ldap_virtual_alias_maps.cf server_host = localhostsearch_base = o=extmailAlias,dc=wht.comquery_filter = (&(objectClass=extmailAlias)(mailLocalAddress=%s)(active=1))result_attribute = mailcache = nobind = noscope = sub[iyunv@mail ldap]#


五,配置Dovecot
[iyunv@mail ldap]# rpm -qa |grep dovecotdovecot-1.0.7-7.el5[iyunv@mail ldap]# cp /etc/dovecot.conf /etc/dovecot.conf.bak[iyunv@mail ldap]# vi /etc/dovecot.confbase_dir = /var/run/dovecot/protocols = imap imaps pop3 pop3slisten = *log_path = /var/log/dovecot.loginfo_log_path =  /var/log/dovecot-info.logmail_location = maildir:/home/vmail/%d/%n/Maildirfirst_valid_uid = 89  //后来重新安装后改为1000auth_default_realm = wht.com //20120407增加,解决outlook中认证默认域名问题protocol imap {}protocol pop3 {}protocol lda {  postmaster_address = postmaster@example.com}auth default {  mechanisms = plain login  passdb pam {  }  passdb ldap {    args = /etc/dovecot-ldap.conf  }  userdb passwd {  }  userdb ldap {    args = /etc/dovecot-ldap.conf  }  user = root  socket listen {    client {      path = /var/run/dovecot/auth-client      mode = 0660      user = postfix      group = postfix    }  }}
dict {}
plugin {}[iyunv@mail ldap]#

[iyunv@mail ldap]# cat /etc/dovecot-ldap.conf hosts = 172.16.86.103:389dn = cn=Manager,dc=wht.comdnpass = postfixldap_version = 3base =  o=extmailAccount,dc=wht.comderef = neverscope = subtreeuser_attrs = mail,homeDirectory,,,uidNumber,gidNumberuser_filter = (&(objectClass=extmailUser)(mail=%u)(active=1))pass_attrs = mail,userPasswordpass_filter = (&(objectClass=extmailUser)(mail=%u)(active=1))default_pass_scheme = crypt#default_pass_scheme = plainuser_global_uid = postfixuser_global_gid = postfixauth_bind = yes[iyunv@mail ldap]#[iyunv@mail ldap]# service dovecot start
回到ExtMail,ExtMan setup
[iyunv@mail tmp]# mkdir /tmp/extmail[iyunv@mail tmp]# mkdir /tmp/extman[iyunv@mail tmp]# chown -R postfix.postfix extman/[iyunv@mail tmp]# chown -R postfix.postfix extmail/
#/tmp下的文件每次系统重启都会丢失,建议将webman.cf中SYS_SESS_DIR 修改为/var/tmp/extman/,然后创建/var/tmp/extman目录,修改权限,就不会出现这样的界面了。

[iyunv@mail ldap]# cd /var/www/extsuite/extmail/[iyunv@mail extmail]# cp webmail.cf.default webmail.cf[iyunv@mail extmail]# cat webmail.cf | grep -v "#"SYS_CONFIG = /var/www/extsuite/extmail/SYS_LANGDIR = /var/www/extsuite/extmail/langSYS_TEMPLDIR = /var/www/extsuite/extmail/htmlSYS_HTTP_CACHE = 0SYS_SMTP_HOST = 127.0.0.1SYS_SMTP_PORT = 25SYS_SMTP_TIMEOUT = 5SYS_SPAM_REPORT_ON = 0SYS_SPAM_REPORT_TYPE = dspamSYS_SHOW_WARN = 0SYS_PERMIT_NOQUOTA = 1SYS_SESS_DIR = /tmpSYS_UPLOAD_TMPDIR = /tmpSYS_LOG_ON = 1SYS_LOG_TYPE = fileSYS_LOG_FILE = /var/log/extmail.logSYS_SESS_TIMEOUT = 0SYS_SESS_COOKIE_ONLY = 1SYS_USER_PSIZE = 10SYS_USER_SCREEN = autoSYS_USER_LANG = zh_TWSYS_APP_TYPE = WebMailSYS_USER_TEMPLATE = defaultSYS_USER_CHARSET = utf-8SYS_USER_TRYLOCAL = 1SYS_USER_TIMEZONE = +0800SYS_USER_CCSENT = 1SYS_USER_SHOW_HTML = 1SYS_USER_COMPOSE_HTML = 1SYS_USER_CONV_LINK =1SYS_USER_ADDR2ABOOK = 1SYS_MESSAGE_SIZE_LIMIT = 5242880SYS_MIN_PASS_LEN = 2SYS_MFILTER_ON = 1SYS_NETDISK_ON = 1SYS_SHOW_SIGNUP = 1SYS_DEBUG_ON = 1SYS_AUTH_TYPE = ldapSYS_MAILDIR_BASE = /home/vmailSYS_AUTH_SCHEMA = virtualSYS_CRYPT_TYPE = cryptSYS_LDAP_BASE = o=extmailAccount,dc=wht.comSYS_LDAP_RDN = cn=Manager,dc=wht.comSYS_LDAP_PASS = postfixSYS_LDAP_HOST = localhostSYS_LDAP_ATTR_USERNAME = mailSYS_LDAP_ATTR_DOMAIN = virtualDomainSYS_LDAP_ATTR_PASSWD = userPasswordSYS_LDAP_ATTR_CLEARPW = clearPasswordSYS_LDAP_ATTR_QUOTA = mailQuotaSYS_LDAP_ATTR_NDQUOTA = netdiskQuotaSYS_LDAP_ATTR_HOME = homeDirectorySYS_LDAP_ATTR_MAILDIR = mailMessageStoreSYS_LDAP_ATTR_DISABLEWEBMAIL = disablewebmailSYS_LDAP_ATTR_DISABLENETDISK = disablenetdiskSYS_LDAP_ATTR_DISABLEPWDCHANGE = disablePasswdChangeSYS_LDAP_ATTR_ACTIVE = activeSYS_LDAP_ATTR_PWD_QUESTION = questionSYS_LDAP_ATTR_PWD_ANSWER = answerSYS_AUTHLIB_SOCKET = /var/spool/authdaemon/socketSYS_G_ABOOK_TYPE = ldapSYS_G_ABOOK_LDAP_HOST = localhostSYS_G_ABOOK_LDAP_BASE = ou=AddressBook,dc=wht.comSYS_G_ABOOK_LDAP_ROOTDN = cn=Manager,dc=wht.comSYS_G_ABOOK_LDAP_ROOTPW = postfixSYS_G_ABOOK_LDAP_FILTER = objectClass=OfficePersonSYS_G_ABOOK_FILE_PATH = /var/www/extsuite/extmail/globabook.cfSYS_G_ABOOK_FILE_LOCK = 1SYS_G_ABOOK_FILE_CONVERT = 0SYS_G_ABOOK_FILE_CHARSET = utf-8
[iyunv@mail extmail]# chown -R postfix.postfix cgi
[iyunv@mail extmail]# cd ../extman[iyunv@mail extman]# chown -R postfix.postfix cgi[iyunv@mail extman]# cp webman.cf.default webman.cf[iyunv@mail extman]# vi webman.cfSYS_CONFIG = /var/www/extsuite/extman/SYS_LANGDIR = /var/www/extsuite/extman/langSYS_TEMPLDIR = /var/www/extsuite/extman/htmlSYS_MAILDIR_BASE = /home/vmailSYS_SHOW_WARN = 0SYS_SESS_DIR = /tmp/extman/SYS_CAPTCHA_ON = 0  //ExtMan,ExtMail验证码不显示SYS_CAPTCHA_KEY = r3s9b6a7SYS_CAPTCHA_LEN = 6SYS_PURGE_DATA = 0SYS_PSIZE = 20SYS_APP_TYPE = ExtManSYS_TEMPLATE_NAME = defaultSYS_DEFAULT_EXPIRE = 1ySYS_GROUPMAIL_SENDER = postmaster@wht.comSYS_DEFAULT_SERVICES = webmail,smtpd,smtp,pop3,netdiskSYS_ISP_MODE = noSYS_DOMAIN_HASHDIR = yesSYS_DOMAIN_HASHDIR_DEPTH = 2x2SYS_USER_HASHDIR = yesSYS_USER_HASHDIR_DEPTH = 2x2SYS_MIN_UID = 500SYS_MIN_GID = 100SYS_DEFAULT_UID = 1000SYS_DEFAULT_GID = 1000SYS_QUOTA_MULTIPLIER = 1048576SYS_QUOTA_TYPE = courierSYS_DEFAULT_MAXQUOTA = 500SYS_DEFAULT_MAXALIAS = 100SYS_DEFAULT_MAXUSERS = 100SYS_DEFAULT_MAXNDQUOTA = 500SYS_USER_DEFAULT_QUOTA = 5SYS_USER_DEFAULT_NDQUOTA = 5SYS_USER_DEFAULT_EXPIRE = 1ySYS_BACKEND_TYPE = ldapSYS_CRYPT_TYPE = cryptSYS_LDAP_BASE = dc=wht.comSYS_LDAP_RDN = cn=Manager,dc=wht.comSYS_LDAP_PASS = postfixSYS_LDAP_HOST = localhostSYS_LDAP_ATTR_USERNAME = mailSYS_LDAP_ATTR_PASSWD = userPasswordSYS_RRD_DATADIR = /var/libSYS_RRD_TMPDIR = /tmp/viewlogSYS_RRD_QUEUE_ON = yesSYS_CMDSERVER_SOCK = /tmp/cmdserver.sock SYS_CMDSERVER_MAXCONN = 5SYS_CMDSERVER_PID = /var/run/cmdserver.pidSYS_CMDSERVER_LOG = /var/log/cmdserver.logSYS_CMDSERVER_AUTHCODE = your_auth_code_hereSYS_IGNORE_SERVER_LIST = web[iyunv@mail extman]#
[iyunv@mail extmail]# vi /etc/httpd/conf/httpd.confUser postfix          //默認為apacheGroup postfix         //默認為apache##Extmail## Directives to allow use of Extmail as a CGIScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi<Directory "/var/www/extsuite/extmail/cgi">     AllowOverride None     Options None     Order allow,deny     Allow from all</Directory># This is to permit URL access to scripts/files in Extmail directory.Alias /extmail /var/www/extsuite/extmail/html<Directory “/var/www/extsuite/extmail/html”>      Options Indexes FollowSymLinks      AllowOverride None      Order allow,deny      Allow from all</Directory>
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi<Directory "/var/www/extsuite//extman/cgi">     AllowOverride None     Options None     Order allow,deny     Allow from all</Directory>Alias /extman /var/www/extsuite/extman/htmlSuexecUserGroup postfix postfix<Directory “/var/www/extsuite/extman/html”>      Options Indexes FollowSymLinks      AllowOverride None      Order allow,deny      Allow from all</Directory>
[iyunv@mail extmail]# service httpd restart


[iyunv@mail Unix-Syslog-1.1]# tar -zxvf Unix-Syslog-1.1.tar.gz[iyunv@mail Unix-Syslog-1.1]# cd Unix-Syslog-1.1[iyunv@mail Unix-Syslog-1.1]# perl Makefile.PLWriting Makefile for Unix::Syslog[iyunv@mail Unix-Syslog-1.1]# makegcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"1.1\" -DXS_VERSION=\"1.1\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   Syslog.cSyslog.c: In function 「XS_Unix__Syslog_priorityname」:Syslog.c:324: 警告:未使用的變數 「targ」Syslog.c:323: 警告:未使用的變數 「RETVAL」Syslog.c:322: 警告:未使用的變數 「p」Syslog.c: In function 「XS_Unix__Syslog_facilityname」:Syslog.c:342: 警告:未使用的變數 「targ」Syslog.c:341: 警告:未使用的變數 「RETVAL」Syslog.c:340: 警告:未使用的變數 「f」Syslog.c: In function 「XS_Unix__Syslog_setlogmask」:Syslog.c:438: 警告:未使用的變數 「targ」Syslog.c:437: 警告:未使用的變數 「RETVAL」Running Mkbootstrap for Unix::Syslog ()chmod 644 Syslog.bsrm -f blib/arch/auto/Unix/Syslog/Syslog.sogcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib Syslog.o  -o blib/arch/auto/Unix/Syslog/Syslog.so    \           -lc          \          chmod 755 blib/arch/auto/Unix/Syslog/Syslog.socp Syslog.bs blib/arch/auto/Unix/Syslog/Syslog.bschmod 644 blib/arch/auto/Unix/Syslog/Syslog.bsManifying blib/man3/Unix::Syslog.3pm[iyunv@mail Unix-Syslog-1.1]# make installInstalling /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Unix/Syslog/Syslog.bsInstalling /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Unix/Syslog/Syslog.soFiles found in blib/arch: installing files in blib/lib into architecture dependent library treeInstalling /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Unix/Syslog.pmInstalling /usr/share/man/man3/Unix::Syslog.3pmWriting /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Unix/Syslog/.packlistAppending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod[iyunv@mail Unix-Syslog-1.1]#[iyunv@mail soft]# tar zxvf DBI-1.611.tar.gz[iyunv@mail soft]# cd DBI-1.611[iyunv@mail DBI-1.611]# perl Makefile.PL[iyunv@mail DBI-1.611]# make[iyunv@mail DBI-1.611]# make install安裝時有如下錯誤[iyunv@mail soft]# cd Unix-Syslog-1.1[iyunv@mail Unix-Syslog-1.1]# perl Makefile.PLChecking if your kit is complete...Looks goodWriting Makefile for Unix::Syslog[iyunv@mail Unix-Syslog-1.1]# makecp Syslog.pm blib/lib/Unix/Syslog.pm/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap  Syslog.xs > Syslog.xsc && mv Syslog.xsc Syslog.cgcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"1.1\" -DXS_VERSION=\"1.1\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   Syslog.c/bin/sh: gcc: command not foundmake: *** [Syslog.o] Error 127解決:gcc開發程式沒有安裝:[iyunv@mail log]# rpm -qa|grep gcclibgcc-4.1.2-51.el5[iyunv@mail Unix-Syslog-1.1]# yum install gcc[iyunv@mail Unix-Syslog-1.1]# yum install gcc-c++[iyunv@mail Unix-Syslog-1.1]# yum install gcc-gfortran[iyunv@mail log]# rpm -qa|grep gccgcc-c++-4.1.2-51.el5gcc-4.1.2-51.el5gcc-gfortran-4.1.2-51.el5libgcc-4.1.2-51.el5[iyunv@mail log]#


http://172.16.86.103/extman出現如下錯誤:Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.More information about this error may be available in the server error log.________________________________________Apache/2.2.3 (CentOS) Server at 172.16.86.103 Port 80

解決方法:[iyunv@mail log]# vi /etc/httpd/conf/httpd.conf    //注掉以下行#SuexecUserGroup postfix postfix[iyunv@mail log]# service httpd restart [iyunv@mail log]#touch /var/log/extmail.log[iyunv@mail log]# chown postfix.postfix /var/log/extmail.log否則訪問http://172.16.86.103/extmail時會出現下述錯誤/var/log/extmail.log not writable: Permission denied

进入ExtMan后,提示如下:系统信息无法显示:No such file or directory 解决方法:[iyunv@mail daemon]# /var/www/extsuite/extman/daemon/cmdserver --daemon[iyunv@mail daemon]# vi /etc/rc.local  //add/var/www/extsuite/extman/daemon/cmdserver --daemon

Extman,ExtMail问题一二三一,初始登入extman时默认用户名为root@wht.com,密码为extmail*123*即导入init-wht.ldif时密码,最后一个“dn: mail=root@wht.com, o=extmailManager, dc=wht.com”的密码,可以phpmyadmin中修改二,刚开始可能权限没有加到,导致ExtMan无法在/home/vmail中自动创建域wht.com的目录及邮箱目录,在登入ExtMan后,在管理员—>操作编辑root@wht.com&#61664;管理域名中加入所属域wht.com后,再创建用户就可以自动创建域目录wht.com及用户邮箱目录了
  错误提示:[iyunv@mail log]# tail dovecot.log dovecot: Oct 08 14:37:24 Error: POP3(wht@wht.com): mkdir(/home/vmail/wht.comwht/Maildir/cur) failed: Permission denieddovecot: Oct 08 14:37:24 Error: POP3(wht@wht.com): Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2011-10-08 14:37:24]解决:[iyunv@mail log]# vi /etc/dovecot.confmail_location = maildir:/home/vmail/%d/%n/Maildir上面在“%d%n”之间少加“/”,加上后即可。
错误提示:发送邮件接收不到,提示:[iyunv@mail log]# tail maillogOct  8 15:05:06 mail postfix/pickup[3741]: 42678D5808A: uid=0 from=<root>Oct  8 15:05:06 mail postfix/cleanup[3748]: 42678D5808A: message-id=<20111008070506.42678D5808A@mail.wht.com>Oct  8 15:05:06 mail postfix/qmgr[3742]: 42678D5808A: from=<root@wht.com>, size=279, nrcpt=1 (queue active)Oct  8 15:05:06 mail postfix/smtp[3750]: 42678D5808A: to=<wht@wht.com>, relay=none, delay=0.04, delays=0.02/0.02/0/0, dsn=5.4.6, status=bounced (mail for wht.com loops back to myself)Oct  8 15:05:06 mail postfix/cleanup[3748]: 4BEA4D5808D: message-id=<20111008070506.4BEA4D5808D@mail.wht.com>Oct  8 15:05:06 mail postfix/qmgr[3742]: 4BEA4D5808D: from=<>, size=1931, nrcpt=1 (queue active)Oct  8 15:05:06 mail postfix/bounce[3751]: 42678D5808A: sender non-delivery notification: 4BEA4D5808DOct  8 15:05:06 mail postfix/qmgr[3742]: 42678D5808A: removedOct  8 15:05:06 mail postfix/smtp[3750]: 4BEA4D5808D: to=<root@wht.com>, relay=none, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for wht.com loops back to myself)Oct  8 15:05:06 mail postfix/qmgr[3742]: 4BEA4D5808D: removed
[iyunv@mail ~]# vi /etc/postfix/main.cflocal_recipient_maps =          //addmydestination = $myhostname, localhost.$mydomain, localhost ,wht.com如下修改后提示如下
[iyunv@mail ~]# tail /var/log/maillogOct  8 17:54:23 mail postfix/local[4434]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabledOct  8 17:54:23 mail postfix/local[4436]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabledOct  8 17:54:23 mail postfix/local[4434]: 9BE27D58096: to=<t1@wht.com>, relay=local, delay=0.07, delays=0.04/0.02/0/0.02, dsn=5.1.1, status=bounced (unknown user: "t1")Oct  8 17:54:24 mail postfix/local[4436]: 9BE27D58096: to=<wht@wht.com>, relay=local, delay=0.92, delays=0.04/0.03/0/0.86, dsn=5.1.1, status=bounced (unknown user: "wht")Oct  8 17:54:24 mail postfix/cleanup[4431]: 86C78D58099: message-id=<20111008095424.86C78D58099@mail.wht.com>Oct  8 17:54:24 mail postfix/qmgr[4427]: 86C78D58099: from=<>, size=4451, nrcpt=1 (queue active)Oct  8 17:54:24 mail postfix/bounce[4435]: 9BE27D58096: sender non-delivery notification: 86C78D58099Oct  8 17:54:24 mail postfix/qmgr[4427]: 9BE27D58096: removedOct  8 17:54:24 mail postfix/local[4434]: 86C78D58099: to=<wht@wht.com>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "wht")Oct  8 17:54:24 mail postfix/qmgr[4427]: 86C78D58099: removed
用webmin联到postfix观察虚拟网域时发现。原来用postfixadmin+mysql做的,正常是: No mappings of this type have been defined yet.没有认到虚拟邮箱
点下去发现ldap是匿名登陆的,于是用ldap brower测试,发现匿名找不到ldap帐户  于是修改[iyunv@mail openldap]# vi /etc/openldap/slapd.confaccess to dn.base="" by * readaccess to dn.base="cn=Subschema" by * readaccess to *        by self write        by users read        by anonymous read   //原来是by anonymous auth        by * none[iyunv@mail openldap]# service ldap restart让匿名用户可以访问ldap再用ldap brower测试 ,正常
再后来,如果不修改ldap支持匿名查询,也可以通过修改/etc/postfix/ldap/ldap_virtual_*几个虚拟域的文件,添加登入ldap的dn及possword后也可以,只不过ldap_virtual_*五个虚拟域文件都要修改,比较麻烦,以下仅以ldap_virtual_alias_maps.cf文件作示需要添加登入ldap的内容。
[iyunv@mail ldap]# vi /etc/postfix/ldap/ldap_virtual_alias_maps.cf //增加以下蓝字内容。server_host = localhostsearch_base = o=extmailAlias,dc=wht.comquery_filter = (&(objectClass=extmailAlias)(mailLocalAddress=%s)(active=1))result_attribute = mailcache = nobind = yesscope = substart_tls = nobind_dn = cn=Manager,dc=wht.combind_pw = postfix原来ldap_virtual_alias_maps.cf的设置是[iyunv@mail ldap]# more ldap_virtual_alias_maps.cf server_host = localhostsearch_base = o=extmailAlias,dc=wht.comquery_filter = (&(objectClass=extmailAlias)(mailLocalAddress=%s)(active=1))result_attribute = mailcache = nobind = noscope = sub[iyunv@mail ldap]#
  再来,只找到一个support@wht.com,在进步,再查[iyunv@mail openldap]# mailq-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------B15F0D580A0      276 Mon Oct 10 12:25:00  root@wht.com                                             (mail system configuration error)                                         wht@test.com
37816D5809D      277 Mon Oct 10 11:45:05  root@wht.com                                             (mail system configuration error)                                         wht@wht.com
37611D58097      274 Mon Oct 10 09:20:56  root@wht.com                                             (mail system configuration error)                                         wht@wht.com
D8122D58096      275 Mon Oct 10 09:06:06  root@wht.com                                             (mail system configuration error)                                         wht@wht.com
A78E9D580A6      556 Mon Oct 10 12:26:31  t1@test.com                                             (mail system configuration error)                                         wht@test.com
-- 2 Kbytes in 5 Requests.[iyunv@mail openldap]#Oct 10 14:50:25 mail postfix/smtpd[14824]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabledOct 10 14:50:25 mail postfix/smtpd[14824]: connect from localhost.localdomain[127.0.0.1]Oct 10 14:50:25 mail postfix/smtpd[14824]: D4587D58096: client=localhost.localdomain[127.0.0.1]Oct 10 14:50:25 mail postfix/cleanup[14827]: D4587D58096: message-id=<20111010065025.D4587D58096@mail.wht.com>Oct 10 14:50:25 mail postfix/smtpd[14824]: disconnect from localhost.localdomain[127.0.0.1]Oct 10 14:50:25 mail postfix/qmgr[14772]: D4587D58096: from=<t1@wht.com>, size=658, nrcpt=1 (queue active)Oct 10 14:50:25 mail postfix/virtual[14828]: warning: recipient wht@wht.com: bad uid 89 in virtual_uid_mapsOct 10 14:50:26 mail postfix/virtual[14828]: D4587D58096: to=<wht@wht.com>, relay=virtual, delay=0.16, delays=0.08/0.01/0/0.08, dsn=4.3.5, status=deferred (mail system configuration error)Oct 10 14:50:33 mail postfix/smtpd[14824]: connect from unknown[172.16.100.10]Oct 10 14:50:33 mail postfix/smtpd[14824]: 925A8D58099: client=unknown[172.16.100.10]Oct 10 14:50:33 mail postfix/cleanup[14827]: 925A8D58099: message-id=<62F99912657D43D8A40A5830F6E4AABF@whtpc>Oct 10 14:50:33 mail postfix/qmgr[14772]: 925A8D58099: from=<wht@wht.com>, size=1304, nrcpt=1 (queue active)Oct 10 14:50:33 mail postfix/virtual[14828]: warning: recipient t1@wht.com: bad uid 89 in virtual_uid_mapsOct 10 14:50:33 mail postfix/smtpd[14824]: disconnect from unknown[172.16.100.10]Oct 10 14:50:33 mail postfix/virtual[14828]: 925A8D58099: to=<t1@wht.com>, relay=virtual, delay=0.05, delays=0.05/0/0/0, dsn=4.3.5, status=deferred (mail system configuration error)

解決方法://重新安装postfix,设置postfix的uid gid都是extmail默认的1000[iyunv@mail home]#cp /etc/postfix/main.cf ~/backup[iyunv@mail home]#cp /usr/lib/sasl2/smtpd.conf ~/backup[iyunv@mail backup]# service postfix stop[iyunv@mail backup]# yum remove postfix[iyunv@mail backup]#groupdel postfix[iyunv@mail backup]#userdel postfix[iyunv@mail home]# groupadd -g 1000 postfix[iyunv@mail home]# useradd postfix -g postfix -u 1000 -G postdrop -c "Postfix User" -d /dev/null -s /sbin/nologin[iyunv@mail wht.com]# id postfixuid=1000(postfix) gid=1000(postfix) groups=1000(postfix),90(postdrop)[iyunv@mail backup]# yum install postfix[iyunv@mail backup]# cp –y ~/backup/main.cf /etc/postfix[iyunv@mail backup]# cp –y ~/backup/smtpd.conf /usr/lib/sasl2/[iyunv@mail wht.com]# postconf -nbroken_sasl_auth_clients = yescommand_directory = /usr/sbinconfig_directory = /etc/postfixdaemon_directory = /usr/libexec/postfixdebug_peer_level = 2html_directory = noinet_interfaces = allmail_owner = postfixmailq_path = /usr/bin/mailq.postfixmanpage_directory = /usr/share/manmessage_size_limit = 5242880mydestination = $myhostname, localhost.$mydomain, localhostmydomain = wht.commyhostname = mail.wht.commynetworks = 172.16.0.0/16, 127.0.0.0/8myorigin = $mydomainnewaliases_path = /usr/bin/newaliases.postfixqueue_directory = /var/spool/postfixreadme_directory = nosample_directory = /usr/share/doc/postfix-2.3.3/samplessendmail_path = /usr/sbin/sendmail.postfixsetgid_group = postdropsmtpd_banner = $myhostname ESMTP "Version not Available"smtpd_client_restrictions = permit_sasl_authenticatedsmtpd_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,permitsmtpd_sasl_auth_enable = yessmtpd_sasl_local_domain = $myhostnamesmtpd_sasl_path = /var/run/dovecot/auth-clientsmtpd_sasl_security_options = noanonymoussmtpd_sasl_type = dovecotunknown_local_recipient_reject_code = 550virtual_alias_domains = virtual_alias_maps = ldap:/etc/postfix/ldap/ldap_virtual_alias_maps.cfvirtual_gid_maps = static:1000virtual_mailbox_base = /home/vmailvirtual_mailbox_domains = ldap:/etc/postfix/ldap/ldap_virtual_domains_maps.cfvirtual_mailbox_limit = 209715200virtual_mailbox_maps = ldap:/etc/postfix/ldap/ldap_virtual_mailbox_maps.cfvirtual_transport = virtualvirtual_uid_maps = static:1000
[iyunv@mail postfix]# cat /etc/dovecot.conf |grep -v "#"base_dir = /var/run/dovecot/protocols = imap imaps pop3 pop3slisten = *log_path = /var/log/dovecot.loginfo_log_path =  /var/log/dovecot-info.logmail_location = maildir:/home/vmail/%d/%n/Maildirfirst_valid_uid = 1000protocol imap {} protocol pop3 {}protocol lda {  postmaster_address = postmaster@wht.com}auth default {  mechanisms = plain login  passdb pam {  }  passdb ldap {    args = /etc/dovecot-ldap.conf  }  userdb passwd {  }  userdb ldap {    args = /etc/dovecot-ldap.conf  }  user = root  socket listen {    client {      path = /var/run/dovecot/auth-client      mode = 0660      user = postfix      group = postfix    }  }}dict {}plugin {}[iyunv@mail postfix]#
[iyunv@mail postfix]# cat /etc/dovecot-ldap.conf |grep -v "#"  hosts = 172.16.86.103:389dn = cn=Manager,dc=wht.comdnpass = postfixldap_version = 3base =  o=extmailAccount,dc=wht.comderef = neverscope = subtreeuser_attrs = mail,homeDirectory,,,uidNumber,gidNumberuser_filter = (&(objectClass=extmailUser)(mail=%u)(active=1))pass_attrs = mail,userPasswordpass_filter = (&(objectClass=extmailUser)(mail=%u)(active=1))default_pass_scheme = plainuser_global_uid = 1000user_global_gid = 1000auth_bind = yes[iyunv@mail postfix]#[iyunv@mail postfix]#service postfix start[iyunv@mail postfix]#service dovecot restart
[iyunv@mail home]# chown -R postfix.postfix /home/vmail[iyunv@mail home]# chown -R postfix.postfix /tmp/extmail[iyunv@mail home]# chown -R postfix.postfix /tmp/extman[iyunv@mail home]# chown -R postfix.postfix /tmp/sid_*[iyunv@mail postfix]# chown -R postfix.postfix /var/www/extsuite/extman/cgi[iyunv@mail postfix]# chown -R postfix.postfix /var/www/extsuite/extmail/cgi[iyunv@mail extman]# vi /var/www/extsuite/extman/webman.cfSYS_DEFAULT_UID = 1000SYS_DEFAULT_GID = 1000[iyunv@mail extman]#service httpd restart
[iyunv@mail extman]# cat /etc/openldap/slapd.conf |grep -v "#"include         /etc/openldap/schema/core.schemainclude         /etc/openldap/schema/cosine.schemainclude         /etc/openldap/schema/inetorgperson.schemainclude         /etc/openldap/schema/nis.schemainclude         /etc/openldap/schema/extmail.schemaallow bind_v2
pidfile         /var/run/openldap/slapd.pidargsfile        /var/run/openldap/slapd.argsaccess to dn.base="" by * readaccess to dn.base="cn=Subschema" by * readaccess to *             by self write         by users read         by anonymous read        by * nonedatabase        bdbsuffix          "dc=wht.com"rootdn          "cn=Manager,dc=wht.com"rootpw          {SSHA}wJeA7NVNB7XtXeC8/3PIKJnSuPYbkvKAdirectory       /var/lib/ldapindex objectClass                       eq,presindex mail,active,virtualDomain,mailLocalAddress        eq,presloglevel        256[iyunv@mail extman]#

[iyunv@mail extmail]# cat webmail.cf |grep -v "#"SYS_CONFIG = /var/www/extsuite/extmail/SYS_LANGDIR = /var/www/extsuite/extmail/langSYS_TEMPLDIR = /var/www/extsuite/extmail/htmlSYS_HTTP_CACHE = 0SYS_SMTP_HOST = 127.0.0.1SYS_SMTP_PORT = 25SYS_SMTP_TIMEOUT = 5SYS_SPAM_REPORT_ON = 0SYS_SPAM_REPORT_TYPE = dspamSYS_SHOW_WARN = 0SYS_PERMIT_NOQUOTA = 1SYS_SESS_DIR = /tmpSYS_UPLOAD_TMPDIR = /tmpSYS_LOG_ON = 1SYS_LOG_TYPE = fileSYS_LOG_FILE = /var/log/extmail.logSYS_SESS_TIMEOUT = 0SYS_SESS_COOKIE_ONLY = 1SYS_USER_PSIZE = 10SYS_USER_SCREEN = autoSYS_USER_LANG = zh_TWSYS_APP_TYPE = WebMailSYS_USER_TEMPLATE = defaultSYS_USER_CHARSET = utf-8SYS_USER_TRYLOCAL = 1SYS_USER_TIMEZONE = +0800SYS_USER_CCSENT = 1SYS_USER_SHOW_HTML = 1SYS_USER_COMPOSE_HTML = 1SYS_USER_CONV_LINK =1SYS_USER_ADDR2ABOOK = 1SYS_MESSAGE_SIZE_LIMIT = 5242880SYS_MIN_PASS_LEN = 2SYS_MFILTER_ON = 1
SYS_NETDISK_ON = 1SYS_SHOW_SIGNUP = 1SYS_DEBUG_ON = 1SYS_AUTH_TYPE = ldapSYS_MAILDIR_BASE = /home/vmailSYS_AUTH_SCHEMA = virtualSYS_CRYPT_TYPE = cryptSYS_MYSQL_USER = db_userSYS_MYSQL_PASS = db_passSYS_MYSQL_DB = extmailSYS_MYSQL_HOST = localhostSYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sockSYS_MYSQL_TABLE = mailboxSYS_MYSQL_ATTR_USERNAME = usernameSYS_MYSQL_ATTR_DOMAIN = domainSYS_MYSQL_ATTR_PASSWD = passwordSYS_MYSQL_ATTR_CLEARPW = clearpwdSYS_MYSQL_ATTR_QUOTA = quotaSYS_MYSQL_ATTR_NDQUOTA = netdiskquotaSYS_MYSQL_ATTR_HOME = homedirSYS_MYSQL_ATTR_MAILDIR = maildirSYS_MYSQL_ATTR_DISABLEWEBMAIL = disablewebmailSYS_MYSQL_ATTR_DISABLENETDISK = disablenetdiskSYS_MYSQL_ATTR_DISABLEPWDCHANGE = disablepwdchangeSYS_MYSQL_ATTR_ACTIVE = activeSYS_MYSQL_ATTR_PWD_QUESTION = questionSYS_MYSQL_ATTR_PWD_ANSWER = answerSYS_LDAP_BASE = o=extmailAccount,dc=wht.comSYS_LDAP_RDN = cn=Manager,dc=wht.comSYS_LDAP_PASS = postfixSYS_LDAP_HOST = localhostSYS_LDAP_ATTR_USERNAME = mailSYS_LDAP_ATTR_DOMAIN = virtualDomainSYS_LDAP_ATTR_PASSWD = userPasswordSYS_LDAP_ATTR_CLEARPW = clearPasswordSYS_LDAP_ATTR_QUOTA = mailQuotaSYS_LDAP_ATTR_NDQUOTA = netdiskQuotaSYS_LDAP_ATTR_HOME = homeDirectorySYS_LDAP_ATTR_MAILDIR = mailMessageStoreSYS_LDAP_ATTR_DISABLEWEBMAIL = disablewebmailSYS_LDAP_ATTR_DISABLENETDISK = disablenetdiskSYS_LDAP_ATTR_DISABLEPWDCHANGE = disablePasswdChangeSYS_LDAP_ATTR_ACTIVE = activeSYS_LDAP_ATTR_PWD_QUESTION = questionSYS_LDAP_ATTR_PWD_ANSWER = answerSYS_AUTHLIB_SOCKET = /var/spool/authdaemon/socketSYS_G_ABOOK_TYPE = ldapSYS_G_ABOOK_LDAP_HOST = localhostSYS_G_ABOOK_LDAP_BASE = ou=AddressBook,dc=wht.comSYS_G_ABOOK_LDAP_ROOTDN = cn=Manager,dc=wht.comSYS_G_ABOOK_LDAP_ROOTPW = postfixSYS_G_ABOOK_LDAP_FILTER = objectClass=OfficePersonSYS_G_ABOOK_FILE_PATH = /var/www/extsuite/extmail/globabook.cfSYS_G_ABOOK_FILE_LOCK = 1SYS_G_ABOOK_FILE_CONVERT = 0SYS_G_ABOOK_FILE_CHARSET = utf-8[iyunv@mail extmail]#

[iyunv@mail extman]# cat webman.cf |grep -v "#"  SYS_CONFIG = /var/www/extsuite/extman/SYS_LANGDIR = /var/www/extsuite/extman/langSYS_TEMPLDIR = /var/www/extsuite/extman/htmlSYS_MAILDIR_BASE = /home/vmailSYS_SHOW_WARN = 0SYS_SESS_DIR = /tmp/extman/SYS_CAPTCHA_ON = 0SYS_CAPTCHA_KEY = r3s9b6a7SYS_CAPTCHA_LEN = 6SYS_PURGE_DATA = 0SYS_PSIZE = 20SYS_APP_TYPE = ExtManSYS_TEMPLATE_NAME = defaultSYS_DEFAULT_EXPIRE = 1ySYS_GROUPMAIL_SENDER = postmaster@wht.comSYS_DEFAULT_SERVICES = webmail,smtpd,smtp,pop3,netdiskSYS_ISP_MODE = noSYS_DOMAIN_HASHDIR = yesSYS_DOMAIN_HASHDIR_DEPTH = 2x2SYS_USER_HASHDIR = yesSYS_USER_HASHDIR_DEPTH = 2x2SYS_MIN_UID = 500SYS_MIN_GID = 100SYS_DEFAULT_UID = 1000SYS_DEFAULT_GID = 1000SYS_QUOTA_MULTIPLIER = 1048576SYS_QUOTA_TYPE = courierSYS_DEFAULT_MAXQUOTA = 500SYS_DEFAULT_MAXALIAS = 100SYS_DEFAULT_MAXUSERS = 100SYS_DEFAULT_MAXNDQUOTA = 500SYS_USER_DEFAULT_QUOTA = 5SYS_USER_DEFAULT_NDQUOTA = 5SYS_USER_DEFAULT_EXPIRE = 1ySYS_BACKEND_TYPE = ldapSYS_CRYPT_TYPE = cryptSYS_MYSQL_USER = webmanSYS_MYSQL_PASS = webmanSYS_MYSQL_DB = extmailSYS_MYSQL_HOST = localhostSYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sockSYS_MYSQL_TABLE = managerSYS_MYSQL_ATTR_USERNAME = usernameSYS_MYSQL_ATTR_PASSWD = password
SYS_LDAP_BASE = dc=wht.comSYS_LDAP_RDN = cn=Manager,dc=wht.comSYS_LDAP_PASS = postfixSYS_LDAP_HOST = localhostSYS_LDAP_ATTR_USERNAME = mailSYS_LDAP_ATTR_PASSWD = userPasswordSYS_RRD_DATADIR = /var/libSYS_RRD_TMPDIR = /tmp/viewlogSYS_RRD_QUEUE_ON = yesSYS_CMDSERVER_SOCK = /tmp/cmdserver.sock SYS_CMDSERVER_MAXCONN = 5SYS_CMDSERVER_PID = /var/run/cmdserver.pidSYS_CMDSERVER_LOG = /var/log/cmdserver.logSYS_CMDSERVER_AUTHCODE = your_auth_code_hereSYS_IGNORE_SERVER_LIST = web[iyunv@mail extman]#



使Apache支持suEXEC,避免user apache & postfix相冲突,导致部分网页显示不正常[iyunv@mail extmail]# vi /etc/httpd/conf/httpd.confLoadModule suexec_module        lib/apache/mod_suexec.soUser apacheGroup apache
<VirtualHost *:80>##Extmail## Directives to allow use of Extmail as a CGIScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi<Directory "/var/www/extsuite/extmail/cgi">     AllowOverride None     Options None     Order allow,deny     Allow from all</Directory># This is to permit URL access to scripts/files in Extmail directory.Alias /extmail /var/www/extsuite/extmail/html<Directory “/var/www/extsuite/extmail/html”>      Options Indexes FollowSymLinks      AllowOverride None      Order allow,deny      Allow from all</Directory>
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi<Directory "/var/www/extsuite//extman/cgi">     AllowOverride None     Options None     Order allow,deny     Allow from all</Directory>Alias /extman /var/www/extsuite/extman/htmlSuexecUserGroup postfix postfix<Directory “/var/www/extsuite/extman/html”>      Options Indexes FollowSymLinks      AllowOverride None      Order allow,deny      Allow from all</Directory>
</VirtualHost>[iyunv@mail extmail]# service httpd restart

ExtMail验证证无法显示

[iyunv@mail extman]# vi /var/www/extsuite/extman/webman.cf
省事的办法是关掉验证码,找到/extman/webman.cfSYS_CAPTCHA_ON = 1  //0为关闭验证码SYS_CAPTCHA_KEY = 7d7af0SYS_CAPTCHA_LEN = 6(验证码位数)治本的办法是安装perl-GD,安装方式如下“
[iyunv@mail ~]# rpm -qa|grep gdgd-2.0.33-9.4.el5_4.2gdm-2.16.0-56.el5.centosgdbm-1.8.0-26.2.1sysklogd-1.4.1-46.el5[iyunv@mail ~]# yum install gd-devel
[iyunv@mail ~]# rpm -qa|grep gd      gd-2.0.33-9.4.el5_4.2gdm-2.16.0-56.el5.centosgdbm-1.8.0-26.2.1sysklogd-1.4.1-46.el5gd-devel-2.0.33-9.4.el5_4.2[iyunv@mail ~]#tail /var/log/httpd/error_log[Wed Oct 12 17:15:50 2011] [error] [client 172.16.100.10] BEGIN failed--compilation aborted at /var/www/extsuite/extman/libs/Ext/GD.pm line 14., referer: http://172.16.86.103/extman/cgi/index.cgi?__mode=show_login&error=vcode[iyunv@mail ~]#下载GDftp://ftp.cpan.org/pub/CPAN/modules/by-module/GD/GD-2.46.tar.gz[iyunv@mail soft]# tar zxvf GD-2.46.tar.gz[iyunv@mail soft]# cd GD-2.46[iyunv@mail GD-2.46]# perl Makefile.PL[iyunv@mail GD-2.46]# make [iyunv@mail GD-2.46]# make test[iyunv@mail GD-2.46]# make install



安装图形化日志(ExtMan,查看邮件流量)

1)首先确认系统上是否安装gd,如果没有安装请安装gd
[iyunv@mail ~]# rpm -qa|grep gdgd-2.0.33-9.4.el5_4.2gdm-2.16.0-56.el5.centosgdbm-1.8.0-26.2.1sysklogd-1.4.1-46.el5[iyunv@mail ~]# //如果没有以下安装#tar xvf GD-2.45.tar.gz.gz# cd GD-2.45#./configure #make#make install
2)    安装Time-HiRes
# wget http://cpan.weepee.org/authors/id/J/JH/JHI/Time-HiRes-1.9721.tar.gz#tar xvf Time-HiRes-1.9721.tar.gz#cd Time-HiRes-1.9721#perl Makefile.PL#make#make test#make install3)    安装File-Tail
# wget http://ftp.belnet.be/mirror/ftp.cpan.org/authors/id/M/MG/MGRABNAR/File-Tail-0.99.3.tar.gz#tar xvf File-Tail-0.99.3.tar.gz#cd File-Tail-0.99.3#perl Makefile.PL#make #make test#make install
4)    安装rrdtools# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz#tar xvf    rrdtool-1.4.4_.tar.gz#cd  rrdtool-1.4.4#./configure --prefix=/usr/local/rrdtool#make#make install
编译rrdtool时会出现很多错误,照着出现的提示,下载lib包再安装即可,我的安装记录是yum install cairo-develyum install pango-devel// 或pango-* //实际上以下两个包libxml和glib,系统都有默认安装,只是不知道怎么认不到,后来采用tar方式安装才认到,因为先tar安装glib2.14,最后才yum install pango,后来查看安装pango时随带也安装glib2.12的版本,也许就不用再安装了,后来想一想也许应该是yum和tar安装路径不一样,tar设置的路径的符合rrdtool的要求罢了yum install libxml2yum install libxml2-develyum install glib*yum install glib-*
glib-2.0下载地址:http://oss.oetiker.ch/rrdtool/pub/libs/卸载自带的glib1.2.10版本,安装glib2.15.4Make时出现错误configure: error:*** GLIB 2.13.5 or better is required. The latest version of*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/. 参考网上的资料 是因为系统自带的GLIB的原因 处理的方法如下: cd glib-2.14.0 make uninstall 反安装 #rm /usr/bin/glib* //删除系统自带 #rm /usr/local/lib/glib-2.0 //同上
重新编译安装 glib-2.14.0 还在/usr/local目录下, 然后设置环境变量 #export LD_LIBRARY_PATH=/usr/local/lib #export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig./configure --prefix=$INSTALL_DIRmake make install
freetype安装过程freetype字体时出现make: Nothing to be done for `unix'. 这个错误不影响也可以如下操作# make clean# makepango
libxml2-2.6.32./configuremake make install
复制mailgraph_ext到/usr/local,并启动之# cp -r /var/www/extsuite/extman/addon/mailgraph_ext /usr/local
5)    复制启动脚本,并把其加入到自动启动列队中
#cp /usr/local/mailgraph_ext/mailgraph-init /etc/rc.d/init.d/mailgraph#chmod 700 /etc/rc.d/init.d/mailgraph#chkconfig --add mailgraph#chkconfig mailgraph on
[iyunv@mail init.d]# ./mailgraph startStarting mail statistics grapher: mailgraph_extCan't locate RRDs.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/mailgraph_ext/mailgraph_ext.pl line 292.BEGIN failed--compilation aborted at /usr/local/mailgraph_ext/mailgraph_ext.pl line 292.Starting queue statistics grapher: qmonitorCan't locate RRDs.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/mailgraph_ext/qmonitor.pl line 8.BEGIN failed--compilation aborted at /usr/local/mailgraph_ext/qmonitor.pl line 8.[iyunv@mail init.d]#
分析:[iyunv@mail init.d]# whereis rrdtoolrrdtool: /opt/rrdtool-1.4.4/bin/rrdtool[iyunv@mail rrdtool-1.4.4]cd /opt/rrdtool-1.4.4[iyunv@mail rrdtool-1.4.4]# find ./ -name "RRDs.pm"    ./lib/perl/5.8.8/i386-linux-thread-multi/RRDs.pm安装rrdtool时未指定路径,直接./configure,将rrdtool安装在系统默认在/opt/rrd-tool-1.4.4下,在linux为了方便,将其安装在/usr/local下,所以重新安装rrdtool,如果不重新安装直接到“解决”执行ln –sv也行[iyunv@mail rrdtool-1.4.4]make uninstall[iyunv@mail rrdtool-1.4.4]cd ..[iyunv@mail soft]# rf –rf  rrdtool-1.4.4[iyunv@mail soft]# # tar zxvf rrdtool-1.4.4.tar.gz[iyunv@mail soft]# cd rrdtool-1.4.4  [iyunv@mail rrdtool-1.4.4]# ./configure --prefix=/usr/local/rrdtool[iyunv@mail rrdtool-1.4.4]make & make install[iyunv@mail rrdtool-1.4.4]# whereis rrdtoolrrdtool: /usr/local/rrdtool[iyunv@mail soft]# find /usr/local/rrdtool -name "RRDs.pm"      /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/RRDs.pm
解决:[iyunv@mail 5.8.8]#ln -sv /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/RRDs.pm /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
[iyunv@mail i386-linux-thread-multi]# /etc/rc.d/init.d/mailgraph restartStarting mail statistics grapher: mailgraph_extCan't locate loadable object for module RRDs in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/mailgraph_ext/mailgraph_ext.pl line 292Compilation failed in require at /usr/local/mailgraph_ext/mailgraph_ext.pl line 292.BEGIN failed--compilation aborted at /usr/local/mailgraph_ext/mailgraph_ext.pl line 292.Starting queue statistics grapher: qmonitorCan't locate loadable object for module RRDs in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/mailgraph_ext/qmonitor.pl line 8Compilation failed in require at /usr/local/mailgraph_ext/qmonitor.pl line 8.BEGIN failed--compilation aborted at /usr/local/mailgraph_ext/qmonitor.pl line 8.解决:
[iyunv@mail 5.8.8]# ln -sv /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/auto/RRDs /RRDs.so /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
[iyunv@mail i386-linux-thread-multi]# /etc/rc.d/init.d/mailgraph restartStopping mail statistics grapher: mailgraph_extStopping queue statistics grapher: qmonitorStarting mail statistics grapher: mailgraph_extStarting queue statistics grapher: qmonitor
[iyunv@mail mailgraph_ext]# cd /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/[iyunv@mail i386-linux-thread-multi]# ll總計 364drwxr-xr-x 5 root root   4096 10月 12 10:18 autodrwxr-xr-x 2 root root   4096 10月  7 12:32 Bundledrwxr-xr-x 3 root root   4096 10月  7 12:32 DBDdrwxr-xr-x 8 root root   4096 10月  7 12:32 DBI-r--r--r-- 1 root root 306143  4月 15  2010 DBI.pm-r--r--r-- 1 root root   1533  7月 16  2007 dbixs_rev.pl-r--r--r-- 1 root root  15161  3月 26  2005 Roadmap.podlrwxrwxrwx 1 root root     65 10月 12 14:21 RRDs.pm -> /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/RRDs.pmlrwxrwxrwx 1 root root     75 10月 12 14:33 RRDs.so -> /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/auto/RRDs/RRDs.so-r--r--r-- 1 root root   1666  6月  8  2009 TASKS.poddrwxr-xr-x 2 root root   4096 10月  7 12:30 Unixdrwxr-xr-x 2 root root   4096 10月  7 12:32 Win32[iyunv@mail i386-linux-thread-multi]#[iyunv@mail i386-linux-thread-multi]#
  

[iyunv@mail rrdtool-1.4.4]# ./configure --prefix=/usr/local/rrdtool...Find 3rd-Party Librarieschecking for libdbi... nochecking for cairo_font_options_create in -lcairo... nochecking for pkg-config... pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no cairo-png.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of cairo-png. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libcairo and its header files. If  you have not installed cairo-png, you can get it either from its original home on
     http://cairographics.org/releases/
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of cairo-png is 1.4.6.
       LIBS=-lm    LDFLAGS=  CPPFLAGS=
----------------------------------------------------------------------------                checking for cairo_svg_surface_create in -lcairo... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no cairo-svg.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of cairo-svg. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libcairo and its header files. If  you have not installed cairo-svg, you can get it either from its original home on
     http://cairographics.org/releases/
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of cairo-svg is 1.4.6.
       LIBS=-lm    LDFLAGS=  CPPFLAGS=
----------------------------------------------------------------------------                checking for cairo_pdf_surface_create in -lcairo... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no cairo-pdf.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of cairo-pdf. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libcairo and its header files. If  you have not installed cairo-pdf, you can get it either from its original home on
     http://cairographics.org/releases/
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of cairo-pdf is 1.4.6.
       LIBS=-lm    LDFLAGS=  CPPFLAGS=
----------------------------------------------------------------------------                checking for cairo_ps_surface_create in -lcairo... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no cairo-ps.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of cairo-ps. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libcairo and its header files. If  you have not installed cairo-ps, you can get it either from its original home on
     http://cairographics.org/releases/
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of cairo-ps is 1.4.6.
       LIBS=-lm    LDFLAGS=  CPPFLAGS=
----------------------------------------------------------------------------                checking for glib_check_version in -lglib-2.0... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no glib-2.0.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of glib-2.0. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libglib-2.0 and its header files. If  you have not installed glib-2.0, you can get it either from its original home on
     ftp://ftp.gtk.org/pub/glib/2.12/
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of glib-2.0 is 2.12.12.
       LIBS=-lm    LDFLAGS=  CPPFLAGS=
----------------------------------------------------------------------------                checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no pangocairo.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of pangocairo. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libpangocairo-1.0 and its header files. If  you have not installed pangocairo, you can get it either from its original home on
     http://ftp.gnome.org/pub/GNOME/sources/pango/1.17
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of pangocairo is 1.17.
       LIBS=-lm    LDFLAGS=  CPPFLAGS=
----------------------------------------------------------------------------                checking for xmlParseFile in -lxml2... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no libxml-2.0.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of libxml-2.0. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libxml2 and its header files. If  you have not installed libxml-2.0, you can get it either from its original home on
     http://xmlsoft.org/downloads.html
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of libxml-2.0 is 2.6.31.
       LIBS=-lm    LDFLAGS=  CPPFLAGS= -I/usr/include/libxml2
----------------------------------------------------------------------------                configure: error: Please fix the library issues listed above and try again.
[iyunv@mail rrdtool-1.4.4]# rpm -qa|grep libxmllibxml2-python-2.6.26-2.1.2.8.el5_5.1libxml2-2.6.26-2.1.12[iyunv@mail rrdtool-1.4.4]# yum install cairo-devel==================================================================================================================================== Package                               Arch                  Version                                 Repository                Size====================================================================================================================================Installing: cairo-devel                           i386                  1.2.4-5.el5                             base                     131 kInstalling for dependencies: fontconfig-devel                      i386                  2.4.1-7.el5                             base                     168 k freetype-devel                        i386                  2.2.1-28.el5_5.1                        base                     148 k libX11-devel                          i386                  1.0.3-11.el5_7.1                        updates                  661 k libXau-devel                          i386                  1.0.1-3.1                               base                      11 k libXdmcp-devel                        i386                  1.0.1-2.1                               base                     7.5 k libXrender-devel                      i386                  0.9.1-3.1                               base                     8.8 k libpng-devel                          i386                  2:1.2.10-7.1.el5_7.5                    updates                  182 k mesa-libGL-devel                      i386                  6.5.1-7.8.el5                           base                     461 k xorg-x11-proto-devel                  i386                  7.1-13.el5                              base                     247 k zlib-devel                            i386                  1.2.3-4.el5                             base                     101 kUpdating for dependencies: libX11                                i386                  1.0.3-11.el5_7.1                        updates                  797 k libpng                                i386                  2:1.2.10-7.1.el5_7.5                    updates                  241 k
Transaction Summary====================================================================================================================================Install      11 Package(s)Upgrade       2 Package(s)
Total download size: 3.1 MIs this ok [y/N]: y再运行rrdtool configure 只剩下三个包没有安装了。[iyunv@mail rrdtool-1.4.4]# ./configure
configure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no glib-2.0.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of glib-2.0. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libglib-2.0 and its header files. If  you have not installed glib-2.0, you can get it either from its original home on
     ftp://ftp.gtk.org/pub/glib/2.12/
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of glib-2.0 is 2.12.12.
       LIBS=-lcairo -lcairo -lcairo -lm  -lcairo -lpng12     LDFLAGS=      CPPFLAGS= -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2  
----------------------------------------------------------------------------                checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no pangocairo.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of pangocairo. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libpangocairo-1.0 and its header files. If  you have not installed pangocairo, you can get it either from its original home on
     http://ftp.gnome.org/pub/GNOME/sources/pango/1.17
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of pangocairo is 1.17.
       LIBS=-lcairo -lcairo -lcairo -lm  -lcairo -lpng12     LDFLAGS=      CPPFLAGS= -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2  
----------------------------------------------------------------------------                checking for xmlParseFile in -lxml2... nochecking for pkg-config... (cached) pkg-configconfigure: WARNING:----------------------------------------------------------------------------* I found a copy of pkgconfig, but there is no libxml-2.0.pc file around.  You may want to set the PKG_CONFIG_PATH variable to point to its  location.----------------------------------------------------------------------------
configure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of libxml-2.0. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libxml2 and its header files. If  you have not installed libxml-2.0, you can get it either from its original home on
     http://xmlsoft.org/downloads.html
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of libxml-2.0 is 2.6.31.
       LIBS=-lcairo -lcairo -lcairo -lm  -lcairo -lpng12     LDFLAGS=      CPPFLAGS= -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2   -I/usr/include/libxml2
----------------------------------------------------------------------------                configure: error: Please fix the library issues listed above and try again.
再透过此方法卸载自带的glib1.2.10版本,安装glib2.15.4
安装glib-2.0下载地址:http://oss.oetiker.ch/rrdtool/pub/libs/Make时出现错误configure: error:*** GLIB 2.13.5 or better is required. The latest version of*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/. 参考网上的资料 是因为系统自带的GLIB的原因 处理的方法如下: cd glib-2.14.0 make uninstall 反安装 #rm /usr/bin/glib* //删除系统自带 #rm /usr/local/lib/glib-2.0 //同上
重新编译安装 glib-2.14.0 还在/usr/local目录下, 然后设置环境变量 #export LD_LIBRARY_PATH=/usr/local/lib #export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig./configure --prefix=$INSTALL_DIRmake make install

[iyunv@mail pango-1.17.5]# pkg-config --modversion pango 1.17.5
[iyunv@mail ~]# rpm -qa|grep glibglibc-2.5-65dbus-glib-0.73-10.el5_5glibc-common-2.5-65glib2-2.12.3-4.el5_3.1avahi-glib-0.6.16-9.el5_5NetworkManager-glib-0.7.0-10.el5_5.2glibc-headers-2.5-65glib2-devel-2.12.3-4.el5_3.1glibc-devel-2.5-65
[iyunv@mail lib]# tar zxvf libxml2-2.6.32.tar.tar[iyunv@mail lib]# cd libxml2-2.6.32[iyunv@mail libxml2-2.6.32]# ./configure[iyunv@mail libxml2-2.6.32]# make[iyunv@mail libxml2-2.6.32]# make install//libxml2安装上去后还剩下pango一个包了
[iyunv@mail rrdtool-1.4.4]# ./configureconfigure: WARNING:----------------------------------------------------------------------------* I could not find a working copy of pangocairo. Check config.log for hints on why  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately  so that compiler and the linker can find libpangocairo-1.0 and its header files. If  you have not installed pangocairo, you can get it either from its original home on
     http://ftp.gnome.org/pub/GNOME/sources/pango/1.17
  You can find also find an archive copy on
     http://oss.oetiker.ch/rrdtool/pub/libs
  The last tested version of pangocairo is 1.17.
       LIBS=-lcairo -lcairo -lcairo -lm  -lcairo -lpng12   -lglib-2.0     LDFLAGS=     -L/usr/local/lib      CPPFLAGS= -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/include/cairo -I/usr/include/libpng12   -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include  

[iyunv@mail rrdtool-1.4.4]# yum install pango-devel
Transaction Summary====================================================================================================================================Install       4 Package(s)Upgrade       0 Package(s)
Total download size: 1.6 MIs this ok [y/N]: yDownloading Packages:(1/4): libXft-devel-2.1.10-1.1.i386.rpm                                                                      |  16 kB     00:00     (2/4): libXext-devel-1.0.1-2.1.i386.rpm                                                                      |  57 kB     00:00     (3/4): pango-devel-1.14.9-8.el5.centos.3.i386.rpm                                                            | 275 kB     00:01     (4/4): glib2-devel-2.12.3-4.el5_3.1.i386.rpm                                                                 | 1.2 MB     00:02     


[iyunv@mail rrdtool-1.4.4]# ./configure----------------------------------------------------------------Config is DONE!
          With MMAP IO: yes      Build rrd_getopt: no       Static programs: no          Perl Modules: perl_piped perl_shared           Perl Binary: /usr/bin/perl          Perl Version: 5.8.8          Perl Options: PREFIX=/opt/rrdtool-1.4.4 LIB=/opt/rrdtool-1.4.4/lib/perl/5.8.8          Ruby Modules:            Ruby Binary: no          Ruby Options: sitedir=/opt/rrdtool-1.4.4/lib/ruby    Build Lua Bindings: no    Build Tcl Bindings: no Build Python Bindings: no          Build rrdcgi: yes       Build librrd MT: yes           Use gettext: yes           With libDBI: no
             Libraries: -lcairo -lcairo -lcairo -lm  -lcairo -lpng12   -lglib-2.0   -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0   -lxml2  
Type 'make' to compile the software and use 'make install' to install everything to: /opt/rrdtool-1.4.4.
       ... that wishlist is NO JOKE. If you find RRDtool usefulmake me happy. Go to http://tobi.oetiker.ch/wish andplace an order.
                               -- Tobi Oetiker <tobi@oetiker.ch>----------------------------------------------------------------[iyunv@mail rrdtool-1.4.4]# make & make install
至此RRDTOOL安装完成
虚拟邮箱wht.com发向test.com正常。
   
安装openwebmail(未测试)

安装openwebmail之前首先要安装perl-Text-Iconv这个组件在http://openwebmail.org/openwebmail/download/redhat/rpm/packages/下载,注意64位系统要安装64位的包,也可以在上面下载openwebmail的包(安装openwebmail需要两个包openwebmail-data-2.53-3.i386.rpm和openwebmail-2.53-3.i386.rpm)(1)首先要编辑yum的一个文件vi /etc/yum.repos.d/openwebmail.repo默认是不存在的(要是安装openwebmail RPM包的话可以省略1—2步)添加下面的数据[openwebmail]## Thomas Chung ## 2008.05.29name=Openwebmail for Fedora or Enterprise Linuxbaseurl=http://openwebmail.org/openwebmail/download/redhat/rpm/release/enabled=1gpgcheck=1gpgkey=http://openwebmail.org/openwebmail/download/redhat/rpm/release/RPM-GPG-KEY-openwebmail#metadata_expire=0(2)下载openwebmail [iyunv@ser etc]#yum -y  install openwebmail [iyunv@ser etc]#cd /var/www/cgi-bin/openwebmail/[iyunv@ser etc]#./openwebmail-tool.pl  --init  #出现Y/N时 ,按N.修改openwebmail 的一些配置文件[iyunv@ser etc]# vi dbm.conf dbm_ext                 .dbdbmopen_ext             .dbdbmopen_haslock         no[iyunv@ser etc]]# cd defaults/[iyunv@ser defaults]#  vi dbm.conf dbm_ext                 .dbdbmopen_ext             .dbdbmopen_haslock         yessmtpserver  192.168.1.2[iyunv@ser defaults]#  vi openwebmail.confdomainnames             ***.comsmtpserver              192.168.1.2authpop3_server         192.168.1.2 [iyunv@ser defaults]# cd  ../../openwebmail-tool.pl  --init  出现Y/N 时,按Y。11、配置httpd[iyunv@ser ~]# vi /etc/httpd/conf/httpd.conf ServerAdmin root@***.comServerName  mail.***.com:80 AddHandler cgi-script .cgi .plService httpd start12、测试登陆openwebmail在IE里输入mail.***.com/cgi-bin/openwebmail/openwebmail.pl, 这个地址是不是很长,那么我们来点短点的在  httpd的 配置文件中添加 下面 内容:ScriptAlias  /mail    /var/www/cgi-bin/openwebmail/openwebmail.pl这样在IE 中直接输入mail.yjw.com/mail 13、修改openwebmail的中文支持Vi /var/www/cgi-bin/openwebmail/etc/openwebmail.confDomainnames ltext.comDefault_language    zh_CM.GB2312 Default_iconset      Cool3D .Chinese.Simplified然后用登陆openwebmail测试如果还是英语,就新建一个用户试试。
PHP测试#vi /var/www/html/test.php<? phpinfo();?>http://172.16.86.103/test.php




ExtMail1.1.1 LDAP 全局地址本,手工维护1,增加LDAP Schema[iyunv@mail ~]# more /etc/openldap/schema/officeperson.schema objectClass ( 1.3.6.1.4.1.4203.666.100.1         NAME ( 'officePerson' )        SUP top STRUCTURAL        DESC 'extmail address book'        MUST ( cn )                MAY ( mail $ o $ telephoneNumber))[iyunv@mail ~]# 2,修改slapd.conf[iyunv@mail ~]# more /etc/openldap/slapd.conf|grep "include"include         /etc/openldap/schema/core.schemainclude         /etc/openldap/schema/cosine.schemainclude         /etc/openldap/schema/inetorgperson.schemainclude         /etc/openldap/schema/nis.schemainclude         /etc/openldap/schema/extmail.schemainclude         /etc/openldap/schema/officeperson.schema[iyunv@mail ~]#
3,确认Extmail配置文件webmail.cf中是否支持LDAP[iyunv@mail ~]# more /var/www/extsuite/extmail/webmail.cf | grep 'ABOOK' SYS_G_ABOOK_TYPE = ldap# if ldap, all relate parameters should prefix as SYS_G_ABOOK_LDAPSYS_G_ABOOK_LDAP_HOST = localhostSYS_G_ABOOK_LDAP_BASE = ou=AddressBook,dc=wht.comSYS_G_ABOOK_LDAP_ROOTDN = cn=Manager,dc=wht.comSYS_G_ABOOK_LDAP_ROOTPW = postfixSYS_G_ABOOK_LDAP_FILTER = objectClass=OfficePerson# if file, all relate parameters should prefix as SYS_G_ABOOK_FILESYS_G_ABOOK_FILE_PATH = /var/www/extsuite/extmail/globabook.cfSYS_G_ABOOK_FILE_LOCK = 1SYS_G_ABOOK_FILE_CONVERT = 0SYS_G_ABOOK_FILE_CHARSET = utf-8[iyunv@mail ~]# 3,重启LDAP服务#service ldap restart4,用PHPLDAPADMIN在增加OU=AddressBook,及添加第一个联系人打开phpldapadmin 添加一项ou=AddressBook(Create new entry here=>Custom=>objclass选organizationalRole,cn和sn随便填)(选organizationalRole纯属个人喜好,其实有很多都能选,只是作为上一层目录随便便可)然后点击ou=AddressBook=>Create a child entry=>Custom=>objclass选officeperson,然后那个表Required Attributes为必填,cn是你的名字,灰色那些栏可以选择,挑一个mail出来添上,然后你的extmail就可以查询到该全局地址本了...


ExtMail使用LDAP帐户信息作为全局通讯录,采用系统表,不须手工维护
说明:优点:此直接采用Postfix后台LDAP表,直接调用,不须手工维护。缺点:只能作一般通讯录,姓名,邮件地址,其它栏位没有,如果要添加可能要更改LDAP架构,在哪个文章上看过,没有试验过。
主要修改一下ExtMail的配置文档就可以了,直接使用虚拟域的OU,如下:[iyunv@mail extmail]# more webmail.cf|grep "ABOOK"SYS_G_ABOOK_TYPE = ldap# if ldap, all relate parameters should prefix as SYS_G_ABOOK_LDAPSYS_G_ABOOK_LDAP_HOST = localhost#SYS_G_ABOOK_LDAP_BASE = ou=AddressBook,dc=wht.comSYS_G_ABOOK_LDAP_BASE = o=extmailAccount,dc=wht.comSYS_G_ABOOK_LDAP_ROOTDN = cn=Manager,dc=wht.comSYS_G_ABOOK_LDAP_ROOTPW = postfix#SYS_G_ABOOK_LDAP_FILTER = objectClass=OfficePersonSYS_G_ABOOK_LDAP_FILTER = objectClass=extmailUser# if file, all relate parameters should prefix as SYS_G_ABOOK_FILESYS_G_ABOOK_FILE_PATH = /var/www/extsuite/extmail/globabook.cfSYS_G_ABOOK_FILE_LOCK = 1SYS_G_ABOOK_FILE_CONVERT = 0SYS_G_ABOOK_FILE_CHARSET = utf-8

这位仁兄还提到中文化显示乱码的问题,因为我的没有遇到,就没有测试了,但还是记录下来:如果进入extmail全局地址本后,全局地址本信息为乱码,需要修改extmail源代码并增加webmail.cf配置文件参数,方法如下:vi /usr/local/www/extmail/libs/Ext/App/GlobalAbook.pm修改:sub _init_obj { ......if ($type eq 'ldap') {        $obj = Ext::GlobalAbook->new(            type => 'ldap',            base => $sysconfig->{SYS_G_ABOOK_LDAP_BASE},            rootdn => $sysconfig->{SYS_G_ABOOK_LDAP_ROOTDN},            rootpw => $sysconfig->{SYS_G_ABOOK_LDAP_ROOTPW},            filter => $sysconfig->{SYS_G_ABOOK_LDAP_FILTER},            host => $sysconfig->{SYS_G_ABOOK_LDAP_HOST},            convert => 1, # XXX this must exist for LDAP v3            bind => 1,        );......}其中            convert => 1, # XXX this must exist for LDAP v3改为            #convert => 1, # XXX this must exist for LDAP v3接着加两行,内容如下:            convert => $sysconfig->{SYS_G_ABOOK_LDAP_CONVERT},            charset => $sysconfig->{SYS_G_ABOOK_LDAP_CHARSET},存盘退出vi /usr/local/www/extmail/webmail.cf加上:SYS_G_ABOOK_LDAP_CONVERT = 0SYS_G_ABOOK_LDAP_CHARSET = utf-8存盘退出


Extmail登陆时显示默认域:
#vi /var/www/extsuite/extmail/html/default/index.html主要修改162行如下:<TR>                <TD><%domain%></TD>                <TD><INPUT TYPE="text" class="input_n" NAME="domain" Value="wht.com"></TD>        </TR>

SASL认证,默认域问题,Outlook中使用完整用户名问题解决:

操作步骤:# vi /etc/dovecot.conf//707Line add如下auth_default_realm = wht.com# service dovecot restart


           阅读(2756) | 评论(1) | 转发(1) |0  上一篇:Extmail:SASL认证默认域名问题,解决OUTLOOK中用户名须设置邮箱全名问题
  下一篇:修改Oracle最大连接数
相关热门文章

  • 用PHP输出LDAP查询结果
  • postfix安装和设置
  • postfix日常维护
  • 基于postfix邮件解决方案...
  • <!--:zh-->VestaCP -&nbs...


  • 承接自动化测试培训、外包、实...
  • Solaris PowerTOP 1.0 发布
  • For STKMonitor
  • busybox的httpd使用CGI脚本(Bu...
  • 项目小体会


  • IBM DS3400 盘阵怎么查看是单...
  • 启动auditd时,报错如下,怎么...
  • CGSL系统中root密码正确,但无...
  • 在CGSL系统中,如何为不同的用...
  • CGSL系统如何设置交换分区的大...
给主人留下些什么吧!~~ DSC0000.jpg sjlcyy2012-07-02 17:08:37
很不错!!
回复 | 举报评论热议

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-142995-1-1.html 上篇帖子: Postfix+Cyrus-IMAP + Cyrus-SASL + MySQL + IMP 配置指南 下篇帖子: Postfix 配置完全版
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表