Chinaunix首页 | 论坛 | 博客
  • 博客访问: 34503
  • 博文数量: 8
  • 博客积分: 345
  • 博客等级: 一等列兵
  • 技术积分: 170
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-28 15:39
文章分类
文章存档

2012年(8)

我的朋友

分类: LINUX

2012-08-06 20:56:55

ldap postfix
=============

setenforce 0
iptables -F

config ldap


mkdir /var/www/extsuite

tar zxf extman-1.1.tar.gz -C /var/www/extsuite
tar zxf extmail-1.2.tar.gz -C /var/www/extsuite

cd /var/www/extsuite/extman/docs
cp extmail.schema /etc/openldap/schema/

vim /etc/openldap/slapd.conf
add
include         /etc/openldap/schema/extmail.schema

cd /etc/openldap/schema

vim extmail.schema

167 #attributetype ( 1.3.6.1.4.1.12461.1.1.21
168 #       NAME ( 'mailHost' )
169 #       DESC 'routing infomation for this recipient, like smtp:mx1.extmail.o    rg'
170 #       EQUALITY caseIgnoreIA5Match
171 #       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
172 #       )
173
174 #attributetype ( 1.3.6.1.4.1.12461.1.1.22
175 #       NAME ( 'mailLocalAddress' )
176 #       DESC 'RFC822 email address of this recipient, can contain @domain.tl    d value'
177 #       EQUALITY caseIgnoreIA5Match
178 #       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

186 #attributetype ( 1.3.6.1.4.1.12461.1.1.24
187 #       NAME ( 'mailRoutingAddress' )
188 #       DESC 'RFC822 routing address of this recipient'
189 #       EQUALITY caseIgnoreIA5Match
190 #       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256}
191 #       SINGLE-VALUE )

cd /var/www/extsuite/extman/docs

cp ldap_virtual_alias_maps.cf ldap_virtual_domains_maps.cf ldap_virtual_mailbox_maps.cf /etc/postfix/

useradd domains -s /sbin/nologin -u 600

postconf -e
inet_interfaces = all
virtual_alias_maps = ldap:/etc/postfix/ldap_virtual_alias_maps.cf
virtual_gid_maps = static:600
virtual_mailbox_base = /home/domains/
virtual_mailbox_domains = ldap:/etc/postfix/ldap_virtual_domains_maps.cf
virtual_mailbox_maps = ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf
virtual_uid_maps = static:600

vim ldap_virtual_mailbox_maps.cf ldap_virtual_domains_maps.cf ldap_virtual_alias_maps.cf

:%s/extmail.org/westos.org/g



vim init.ldif
:%s/extmail.org/westos.org/g

ldapadd -W -x -D "cn=manager,dc=westos.org" -f init.ldif

service postfix restart



dovecot support

yum install dovecot -y

cd /etc/dovecot/conf.d
add
mail_location = maildir:/home/domains/%d/%n/Maildir
mail_uid = domains
mail_gid = domains
first_valid_uid = 600


vim 10-auth.conf
modify
!include auth-ldap.conf.ext


vim auth-ldap.conf.ext
modify
#userdb {
#  driver = ldap
#  args = /etc/dovecot/dovecot-ldap.conf.ext
#}

cp /usr/share/doc/dovecot-2.0/example-config/dovecot-ldap.conf.ext /etc/dovecot

vim /etc/dovecot/dovecot-ldap.conf.ext
modify
hosts = 127.0.0.1
dn = cn=manager,dc=kefatong.org
dnpass = westos
auth_bind = yes
base = o=extmailAccount,dc=kefatong.org
deref = never
scope = subtree
pass_attrs = mail,userPassword
pass_filter = (&(objectClass=extmailUser)(mail=%u)(active=1))
default_pass_scheme = MD5-CRYPT

service dovecot restart

test
telnet localhost 110
user postmaster@kefatong.org
pass extmail


阅读(1046) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~