postfix+dovecot+openldap+extmail+spamassassin+M...

系统环境:rhel6 x86_64 selinux and iptables disabled
postfix+dovecot+openldap+extmail+spamassassin+MailScanner+ClamAV - 了了 - 了了的博客
 
  1.使用extmail自带模板在openldap中创建数据库
     yum install openldap-servers openldap-clients -y
     cd /var/www/extsuite/
     tar zxf extmail-1.2.tar.gz
     tar zxf extman-1.1.tar.gz
     mv extmail-1.2 extmail
     mv extman-1.1 extman
     cd extman/docs/
     cp extmail.schema /etc/openldap/schema/
     cd /etc/openldap/;rm -fr slapd.d
     cp slapd.conf.bak slapd.conf
     chgrp ldap slapd.conf
     cp /usr/share/doc/openldap-servers-2.4.19/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
     chown ldap.ldap /var/lib/ldap/DB_CONFIG
     vi slapd.conf
**************************************************************
include         /etc/openldap/schema/corba.schema
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/duaconf.schema
include         /etc/openldap/schema/dyngroup.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/java.schema
#include                /etc/openldap/schema/misc.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/openldap.schema
include         /etc/openldap/schema/ppolicy.schema
include         /etc/openldap/schema/collective.schema
include         /etc/openldap/schema/extmail.schema

allow bind_v2

pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

database        bdb
suffix          "dc=extmail.org"
checkpoint      1024 15
rootdn          "cn=Manager,dc=extmail.org"
rootpw          westos

directory       /var/lib/ldap

index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub


database monitor

access to *
        by dn.exact="cn=Manager,dc=extmail.org" read
        by * none


**************************************************************
       /etc/init.d/slapd restart
       cd /var/www/extsuite/extman/docs/
       载入模板:
       ldapadd -W -x -D "cn=Manager,dc=extmail.org" -f init.ldif

   2.配置postfix,使用支持虚拟域。
      cd /var/www/extsuite/extman/docs/
      cp ldap_virtual_alias_maps.cf ldap_virtual_domains_maps.cf ldap_virtual_mailbox_maps.cf /etc/postfix/
      groupadd -g 600 vgroup
      useradd -u 600 -g vgroup -d /home/domains -s /sbin/nologin vuser
      postconf -e inet_interfaces=all
      postconf -e virtual_mailbox_base=/home/domains/
      postconf -e virtual_uid_maps=static:600
      postconf -e virtual_gid_maps=static:600
      postconf -e virtual_alias_maps=ldap:/etc/postfix/ldap_virtual_alias_maps.cf
      postconf -e virtual_mailbox_domains=ldap:/etc/postfix/ldap_virtual_domains_maps.cf
      postconf -e virtual_mailbox_maps=ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf
      /etc/init.d/postfix restart
      测试:
        echo "hello world" | mail -s test postmaster@extmail.org
        [root@desktop19 docs]# ll /home/domains/extmail.org/postmaster/Maildir/
        cur/ new/ tmp/  postfix配置成功!

   3.配置MDA(dovecot)
      yum install dovecot -y
      cd /etc/dovecot/conf.d
      vi 10-mail.conf
        mail_location = maildir:/home/domains/%d/%n/Maildir
        mail_uid =vuser
        mail_gid =vgroup
        first_valid_uid = 600
      vi 10-auth.conf
        #!include auth-system.conf.ext
        !include auth-ldap.conf.ext
      vi auth-ldap.conf.ext
        passdb {
             driver = ldap
             args = /etc/dovecot/dovecot-ldap.conf.ext
           }
        #userdb {
          #  driver = ldap
          #  args = /etc/dovecot/dovecot-ldap.conf.ext
          #}
      vi ../dovecot-ldap.conf.ext
         hosts =127.0.0.1:389
         dn = cn=Manager,dc=extmail.org
         dnpass =westos
         auth_bind = yes
         base = o=extmailAccount,dc=extmail.org
         deref = never
         scope = subtree
         pass_attrs = mail,userPassword
         pass_filter = (&(objectClass=extmailUser)(mail=%u)(active=1))
         default_pass_scheme = MD5-CRYPT
      /etc/init.d/dovecot restart
      测试:
*****************************************************
[root@desktop19 conf.d]# telnet localhost 110
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready. <24c0.1.5136b423.Eo8g5aUHBgTnBby9zU0KJw==@desktop19.example.com>
user postmaster@extmail.org
+OK
pass extmail
+OK Logged in.
list
+OK 1 messages:
1 574
.

*****************************************************
 
    4.配置extmail:
      vi /etc/httpd/conf/httpd.conf
*************************************************************
<VirtualHost *:80>
      ServerName www.example.com
      DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *:80>
      ServerName mail.extmail.org
      DocumentRoot /var/www/extsuite/extmail/html/
      ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
      Alias /extmail /var/www/extsuite/extmail/html
      ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
      Alias /extman /var/www/extsuite/extman/html
      SuexecUserGroup vmail vmail
</VirtualHost>
*************************************************************
     cd /var/www/extsuite/extmail
     chown -R vuser.vgroup cgi/
     cp webmail.cf.default webmail.cf
     vi webmail.cf
        SYS_LOG_ON = 1
        SYS_AUTH_TYPE = ldap
        SYS_MAILDIR_BASE = /home/domains
        SYS_CRYPT_TYPE = md5crypt
        SYS_LDAP_BASE = o=extmailAccount,dc=extmail.org
        SYS_LDAP_RDN = cn=Manager,dc=extmail.org
        SYS_LDAP_PASS = westos
        SYS_LDAP_HOST = localhost
    cd /var/www/extsuite/extman
    chown vmail.vmail cgi/ -R
    cp webman.cf.default webman.cf
    vi webman.cf
        SYS_MAILDIR_BASE = /home/domains
        SYS_SESS_DIR = /tmp
        SYS_CAPTCHA_ON = 1
        SYS_CAPTCHA_LEN = 4
        SYS_BACKEND_TYPE = ldap
        SYS_CRYPT_TYPE = md5crypt
        SYS_LDAP_BASE = dc=extmail.org
        SYS_LDAP_RDN = cn=Manager,dc=extmail.org
        SYS_LDAP_PASS = westos
        SYS_LDAP_HOST = localhost
    /var/www/extsuite/extman/daemon/cmdserver -d
    若出现下面的情况:不提供注册服务
      如图1
postfix+dovecot+openldap+extmail+spamassassin+MailScanner+ClamAV - 了了 - 了了的博客
  
    则在http://mail.extmail.org/extman/下开启
      如图2


postfix+dovecot+openldap+extmail+spamassassin+MailScanner+ClamAV - 了了 - 了了的博客

add a domain


postfix+dovecot+openldap+extmail+spamassassin+MailScanner+ClamAV - 了了 - 了了的博客



转载于:https://my.oschina.net/sharelinux/blog/112118

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值