postfix+extmail+openldap

1. openldap
 a. Installation
  a1. yum -y install openldap-{clients,servers}
 b. Configuration
  b1. rm -rf /etc/openldap/slapd.d     #删除这个目录不然slapd启动的时候不会读取/etc/openldap/slapd.conf
  b2. cp /usr/share/doc/openldap-servers-2.4.19/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
  b3. vim /etc/openldap/slapd.conf
#include                /etc/openldap/schema/misc.schema #注释这一行,它和下面的文件会有冲突
include         /etc/openldap/schema/extmail.schema      # 加上这一行,文件后面会复制

database        bdb
suffix          "dc=extmail.org"   # 为了和extmail提供的模板匹配
checkpoint      1024 15
rootdn          "cn=Manager,dc=extmail.org"
rootpw          westos

2. extmail
useradd -s /sbin/nologin -u 600 email
 a. extmail
  a1. mkdir /var/www/extsuite
  a2. tar xf /root/extmail-1.2.tar.gz -C /var/www/extsuite/
  a3. cd /var/www/extsuite
  a4. mv extmail-1.2 extmail
  a5. cd extmail
  a6. cp webmail.cf.default webmail.cf
  a6. vim webmail.cf
SYS_LOG_ON = 0  # 关闭日志功能
SYS_AUTH_TYPE = ldap
SYS_MAILDIR_BASE = /home/email
SYS_LDAP_BASE = o=extmailAccount,dc=extmail.org
SYS_LDAP_RDN = cn=Manager,dc=extmail.org
SYS_LDAP_PASS = westos
SYS_G_ABOOK_LDAP_BASE = ou=AddressBook,dc=extmail.org
SYS_G_ABOOK_LDAP_ROOTDN = cn=Manager,dc=extmail.org
SYS_G_ABOOK_LDAP_ROOTPW = westos
  a7. chown -R email.email cgi

 b. extman
  b1. tar xf /root/extman-1.1.tar.gz -C /var/www/extsuite/
  b2. cd /var/www/extsuite
  b3. mv extman-1.1 extman
  b4. cd extman
  b5. cp webman.cf.default webman.cf
  b6. vim webman.cf
SYS_MAILDIR_BASE = /home/email  # 邮件存放在用户email家目录
SYS_SESS_DIR = /tmp/
SYS_CAPTCHA_ON = 0      # 关闭验证码功能
SYS_BACKEND_TYPE = ldap
SYS_LDAP_BASE = dc=extmail.org
SYS_LDAP_RDN = cn=Manager,dc=extmail.org
SYS_LDAP_PASS = westos #ldap
  b7. chown -R email.email cgi
  b8. cd docs
  b9. cp extmail.schema /etc/openldap/schema/
  b10. /etc/init.d/slapd start
  b11. ldapadd -x -D "cn=Manager,dc=extmail.org" -W -f init.ldif
  b12. cp ldap_virtual_{alias,domains,mailbox}_maps.cf /etc/postfix/  # 复制postfix要用的文件

3. postfix
 a. Installation
  a1. yum -y install postfix
 b. Configuration
  b1. postconf -e virtual_mailbox_base=/home/email
  b2. postconf -e virtual_uid_maps=static:501
  b3. postconf -e virtual_gid_maps=static:501
  b4. postconf -e virtual_alias_maps=ldap:/etc/postfix/ldap_virtual_alias_maps.cf
  b5. postconf -e virtual_mailbox_domains=ldap:/etc/postfix/ldap_virtual_domains_maps.cf
  b6. postconf -e virtual_mailbox_maps=ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf
  b7. /etc/init.d/postfix restart

4. Others
extmail用perl编写,所以要安装 perl-CGI perl-LDAD
yum -y install perl-CGI perl-LDAP
SELinux 也要安掉:
setenforce 0

默认的邮件用户是[email protected] 密码是extmail


后台管理员用户是[email protected] 密码是extmail*123*

你可能感兴趣的:(linux,职场,openLdap,postfix,休闲)