免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2654 | 回复: 6
打印 上一主题 下一主题

[ldap] help, postfix openldap [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-06-05 22:06 |只看该作者 |倒序浏览
Hello All,
    Having an issue with postfix using LDAP.  Running postfix-2.1.1 and openldap-stable-20040421 on FreeBSD 4.10.
My accounts.conf is below:
________________________________________________________________________
server_host = 127.0.0.1
search_base = o=Postfix,dc=example,dc=com
query_filter = (&(&(objectClass=inetMailUser)(mail=%s))(accountStatus=active))
result_attribute = mailMessageStore
cache = no
bind = no
scope = sub

________________________________________________________________________

I send an email to liuli-@263.net and I get the following in my logs...

/var/log/maillog:
Jun  5 23:01:53 mail postfix/smtpd[478]: dict_ldap_open: Using LDAP source /etc/postfix/accounts.conf
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: server_host = 127.0.0.1
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: server_port = 389
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: version = 3
Jun  5 23:01:53 mail postfix/smtpd[478]: dict_ldap_open: /etc/postfix/accounts.conf server_host URL is ldap://127.0.0.1:389
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: scope = sub
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: search_base = o=Postfix,dc=example,dc=com
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: domain =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: timeout = 10
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: query_filter = (&(&(objectClass=inetMailAlias)(mailLocalAddress=%s))(accountStatus=active))
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: result_filter = %s
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: result_attribute = mail
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: special_result_attribute =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_bool: /etc/postfix/accounts.conf: bind = off
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: bind_dn =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: bind_pw =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_bool: /etc/postfix/accounts.conf: cache = off
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: cache_expiry = -1
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: cache_size = -1
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: recursion_limit = 1000
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: expansion_limit = 0
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: size_limit = 0
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: dereference = 0
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_bool: /etc/postfix/accounts.conf: chase_referrals = off
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_bool: /etc/postfix/accounts.conf: start_tls = off
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_bool: /etc/postfix/accounts.conf: tls_require_cert = off
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: tls_ca_cert_file =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: tls_ca_cert_dir =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: tls_cert =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: tls_key =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: tls_random_file =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_str: /etc/postfix/accounts.conf: tls_cipher_suite =
Jun  5 23:01:53 mail postfix/smtpd[478]: cfg_get_int: /etc/postfix/accounts.conf: debuglevel = 0
Jun  5 23:01:53 mail postfix/smtpd[478]: dict_open: ldap:/etc/postfix/accounts.conf
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: smtpd_access_maps ~? debug_peer_list
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: smtpd_access_maps ~? fast_flush_domains
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: smtpd_access_maps ~? mynetworks
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: smtpd_access_maps ~? permit_mx_backup_networks
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: smtpd_access_maps ~? qmqpd_authorized_clients
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: smtpd_access_maps ~? relay_domains
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: smtpd_access_maps ~? smtpd_access_maps
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: fast_flush_domains ~? debug_peer_list
Jun  5 23:01:53 mail postfix/smtpd[478]: match_string: fast_flush_domains ~? fast_flush_domains
Jun  5 23:01:53 mail postfix/smtpd[478]: watchdog_create: 0x8087c08 18000
Jun  5 23:01:53 mail postfix/smtpd[478]: watchdog_stop: 0x8087c08
Jun  5 23:01:53 mail postfix/smtpd[478]: watchdog_start: 0x8087c08
Jun  5 23:01:53 mail postfix/smtpd[478]: connection established
Jun  5 23:01:53 mail postfix/smtpd[478]: master_notify: status 0
Jun  5 23:01:53 mail postfix/smtpd[478]: name_mask: resource
Jun  5 23:01:53 mail postfix/smtpd[478]: name_mask: software
Jun  5 23:02:13 mail postfix/trivial-rewrite[479]: warning: dict_ldap_lookup: Search error 32: No such object
Jun  5 23:02:13 mail postfix/trivial-rewrite[479]: fatal: ldap:/etc/postfix/accounts.conf(0,100): table lookup problem
Jun  5 23:02:13 mail postfix/trivial-rewrite[480]: warning: dict_ldap_lookup: Search error 32: No such object
Jun  5 23:02:13 mail postfix/trivial-rewrite[480]: fatal: ldap:/etc/postfix/accounts.conf(0,100): table lookup problem
Jun  5 23:02:13 mail postfix/trivial-rewrite[481]: warning: dict_ldap_lookup: Search error 32: No such object
Jun  5 23:02:13 mail postfix/trivial-rewrite[481]: fatal: ldap:/etc/postfix/accounts.conf(0,100): table lookup problem
Jun  5 23:02:14 mail postfix/smtpd[249]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Jun  5 23:02:14 mail postfix/smtpd[188]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Jun  5 23:02:14 mail postfix/smtpd[188]: warning: problem talking to service rewrite: Unknown error: 0
Jun  5 23:02:14 mail postfix/master[183]: warning: process /usr/libexec/postfix/trivial-rewrite pid 479 exit status 1
Jun  5 23:02:14 mail postfix/master[183]: warning: /usr/libexec/postfix/trivial-rewrite: bad command startup -- throttling
Jun  5 23:02:14 mail postfix/smtpd[249]: warning: problem talking to service rewrite: Unknown error: 0
Jun  5 23:02:14 mail postfix/qmgr[438]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Jun  5 23:02:14 mail postfix/smtpd[323]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Jun  5 23:02:14 mail postfix/smtpd[323]: warning: problem talking to service rewrite: Unknown error: 0
Jun  5 23:02:14 mail postfix/master[183]: warning: process /usr/libexec/postfix/trivial-rewrite pid 480 exit status 1
Jun  5 23:02:14 mail postfix/qmgr[438]: warning: problem talking to service rewrite: Unknown error: 0
Jun  5 23:02:14 mail postfix/smtpd[398]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Jun  5 23:02:14 mail postfix/master[183]: warning: process /usr/libexec/postfix/trivial-rewrite pid 481 exit status 1
Jun  5 23:02:14 mail postfix/smtpd[398]: warning: problem talking to service rewrite: Unknown error: 0
Jun  5 23:02:15 mail postfix/smtpd[188]: rewrite stream disconnect
Jun  5 23:02:15 mail postfix/smtpd[249]: rewrite stream disconnect
Jun  5 23:02:15 mail postfix/smtpd[249]: connect to subsystem private/rewrite
Jun  5 23:02:15 mail postfix/smtpd[188]: connect to subsystem private/rewrite
Jun  5 23:02:15 mail postfix/smtpd[249]: send attr request = resolve
Jun  5 23:02:15 mail postfix/smtpd[188]: send attr request = resolve
Jun  5 23:02:15 mail postfix/smtpd[249]: send attr address = wangmd@sww.com.cn
Jun  5 23:02:15 mail postfix/smtpd[188]: send attr address = wangmd@sww.com.cn
Jun  5 23:02:15 mail postfix/smtpd[249]: private/rewrite socket: wanted attribute: transport
Jun  5 23:02:15 mail postfix/smtpd[188]: private/rewrite socket: wanted attribute: transport
Jun  5 23:02:15 mail postfix/smtpd[323]: rewrite stream disconnect
Jun  5 23:02:15 mail postfix/smtpd[323]: connect to subsystem private/rewrite
Jun  5 23:02:15 mail postfix/smtpd[323]: send attr request = resolve
Jun  5 23:02:15 mail postfix/smtpd[323]: send attr address = wangmd@sww.com.cn
Jun  5 23:02:15 mail postfix/smtpd[323]: private/rewrite socket: wanted attribute: transport
Jun  5 23:02:15 mail postfix/smtpd[398]: rewrite stream disconnect
Jun  5 23:02:15 mail postfix/smtpd[398]: connect to subsystem private/rewrite
Jun  5 23:02:15 mail postfix/smtpd[398]: send attr request = resolve
Jun  5 23:02:15 mail postfix/smtpd[398]: send attr address = wangmd@sww.com.cn
Jun  5 23:02:15 mail postfix/smtpd[398]: private/rewrite socket: wanted attribute: transport

openldap of log:
=>; ldap_bv2dn(o=Postfix,dc=example,dc=com,0)
conn=191 op=0 SRCH base="o=Postfix,dc=example,dc=com" scope=2 filter="(&(&(objectClass=inetMailAlias)(mailLocalAddress=sww.com.cn))(accountStatus=active))"
conn=191 op=0 SRCH attr=mail
<= ldap_bv2dn(o=Postfix,dc=example,dc=com,0)=0
send_ldap_result: conn=191 op=0 p=3
send_ldap_result: err=10 matched="" text=""
=>; ldap_dn2bv(272)
send_ldap_response: msgid=1 tag=101 err=32
ber_flush: 14 bytes to sd 14
<= ldap_dn2bv(o=Postfix,dc=example,dc=com,272)=0
  0000:  30 0c 02 01 01 65 07 0a  01 20 04 00 04 00         0....e... ....   
=>; ldap_dn2bv(272)
ldap_write: want=14, written=14
<= ldap_dn2bv(o=postfix,dc=example,dc=com,272)=0
  0000:  30 0c 02 01 01 65 07 0a  01 20 04 00 04 00         0....e... ....   
<<< dnPrettyNormal: <o=Postfix,dc=example,dc=com>;, <o=postfix,dc=example,dc=com>;
SRCH "o=Postfix,dc=example,dc=com" 2 0conn=191 op=0 RESULT tag=101 err=32 text=
    0 0 0
begin get_filter
AND
begin get_filter_list
begin get_filter
AND
begin get_filter_list
begin get_filter
EQUALITY
ber_scanf fmt ({mm}) ber:
ber_dump: buf=0x08f4c800 ptr=0x08f4c836 end=0x08f4c895 len=95
  0000:  a3 1c 04 0b 6f 62 6a 65  63 74 43 6c 61 73 73 04   ....objectClass.  
  0010:  0d 69 6e 65 74 4d 61 69  6c 41 6c 69 61 73 a3 1e   .inetMailAlias..  
  0020:  04 10 6d 61 69 6c 4c 6f  63 61 6c 41 64 64 72 65   ..mailLocalAddre  
  0030:  73 73 04 0a 73 77 77 2e  63 6f 6d 2e 63 6e a3 17   ss..sww.com.cn..  
  0040:  04 0d 61 63 63 6f 75 6e  74 53 74 61 74 75 73 04   ..accountStatus.  
daemon: activity on 1 descriptors
daemon: activity on:  0050:  06 61 63 74 69 76 65 30  06 04 04 6d 61 69 6c      .active0...mail   
14r
end get_filter 0
daemon: read activity on 14
begin get_filter
connection_get(14)
EQUALITY
connection_get(14): got connid=191
ber_scanf fmt ({mm}) ber:
connection_read(14): checking for input on id=191
ber_get_next
ber_dump: buf=0x08f4c800 ptr=0x08f4c854 end=0x08f4c895 len=65
ldap_read: want=8, got=7
  0000:  00 1e 04 10 6d 61 69 6c  4c 6f 63 61 6c 41 64 64   ....mailLocalAdd  
  0000:  30 05 02 01 02 42 00                               0....B.           
  0010:  72 65 73 73 04 0a 73 77  77 2e 63 6f 6d 2e 63 6e   ress..sww.com.cn  
ber_get_next: tag 0x30 len 5 contents:
  0020:  a3 17 04 0d 61 63 63 6f  75 6e 74 53 74 61 74 75   ....accountStatu  
ber_dump: buf=0x0828b320 ptr=0x0828b320 end=0x0828b325 len=5
  0030:  73 04 06 61 63 74 69 76  65 30 06 04 04 6d 61 69   s..active0...mai  
  0000:  02 01 02 42 00                                     ...B.            
  0040:  6c                                                 l                 
ber_get_next
end get_filter 0
do_unbind
end get_filter_list
conn=191 op=1 UNBIND
ldap_read: want=8, got=0
end get_filter 0
begin get_filter

EQUALITY
ber_scanf fmt ({mm}) ber:
ber_get_next on fd 14 failed errno=0 (Undefined error: 0)
connection_read(14): input error=-2 id=191, closing.
ber_dump: buf=0x08f4c800 ptr=0x08f4c874 end=0x08f4c895 len=33
connection_closing: readying conn=191 sd=14 for close
connection_close: deferring conn=191 sd=14
  0000:  00 17 04 0d 61 63 63 6f  75 6e 74 53 74 61 74 75   ....accountStatu  
  0010:  73 04 06 61 63 74 69 76  65 30 06 04 04 6d 61 69   s..active0...mai  
  0020:  6c                                                 l                 
end get_filter 0
end get_filter_list
end get_filter 0
    filter: (&(&(objectClass=inetMailAlias)(mailLocalAddress=sww.com.cn))(accountStatus=active))
ber_scanf fmt ({M}}) ber:
ber_dump: buf=0x08f4c800 ptr=0x08f4c88d end=0x08f4c895 len=8
  0000:  00 06 04 04 6d 61 69 6c                            ....mail         
    attrs: mail
conn=192 op=0 SRCH base="o=Postfix,dc=example,dc=com" scope=2 filter="(&(&(objectClass=inetMailAlias)(mailLocalAddress=sww.com.cn))(accountStatus=active))"
conn=192 op=0 SRCH attr=mail
send_ldap_result: conn=192 op=0 p=3
send_ldap_result: err=10 matched="" text=""
send_ldap_response: msgid=1 tag=101 err=32
ber_flush: 14 bytes to sd 15
  0000:  30 0c 02 01 01 65 07 0a  01 20 04 00 04 00         0....e... ....   
ldap_write: want=14, written=14
  0000:  30 0c 02 01 01 65 07 0a  01 20 04 00 04 00         0....e... ....   
conn=192 op=0 RESULT tag=101 err=32 text=
connection_resched: attempting closing conn=191 sd=14
connection_close: conn=191 sd=14
daemon: removing 14
conn=191 fd=14 closed
daemon: select: listen=8 active_threads=0 tvp=NULL
daemon: activity on 2 descriptors
daemon: select: listen=8 active_threads=0 tvp=NULL
daemon: activity on 1 descriptors
daemon: activity on: 15r
daemon: read activity on 15
connection_get(15)
connection_get(15): got connid=192
connection_read(15): checking for input on id=192
ber_get_next
ldap_read: want=8, got=7
  0000:  30 05 02 01 02 42 00                               0....B.           
ber_get_next: tag 0x30 len 5 contents:
ber_dump: buf=0x0828b260 ptr=0x0828b260 end=0x0828b265 len=5
  0000:  02 01 02 42 00                                     ...B.            
ber_get_next
ldap_read: want=8, got=0

ber_get_next on fd 15 failed errno=0 (Undefined error: 0)
connection_read(15): input error=-2 id=192, closing.
connection_closing: readying conn=192 sd=15 for close
connection_close: deferring conn=192 sd=15
do_unbind
conn=192 op=1 UNBIND
connection_resched: attempting closing conn=192 sd=15
connection_close: conn=192 sd=15
daemon: removing 15
conn=192 fd=15 closed
daemon: select: listen=8 active_threads=0 tvp=NULL
daemon: activity on 1 descriptors
daemon: select: listen=8 active_threads=0 tvp=NULL

why?
thanks!

论坛徽章:
0
2 [报告]
发表于 2004-06-05 22:16 |只看该作者

help, postfix openldap

en ==>; zh-cn(gb2312)

论坛徽章:
0
3 [报告]
发表于 2004-06-05 22:20 |只看该作者

help, postfix openldap

我安装postfix-2.1.1 和 openldap-stable-20040421 on FreeBSD 4.10。使用ldap存储postfix的数据,我的My accounts.conf内容如下:
________________________________________________________________________
server_host = 127.0.0.1
search_base = o=Postfix,dc=example,dc=com
query_filter = (&(&(objectClass=inetMailUser)(mail=%s))(accountStatus=active))
result_attribute = mailMessageStore
cache = no
bind = no
scope = sub

当我发送邮件的时候,会有如下的报错信息:

Jun  6 00:38:26 mail postfix/trivial-rewrite[811]: fatal: ldap:/etc/postfix/accounts.conf(0,100): table lookup problem
Jun  6 00:39:27 mail postfix/trivial-rewrite[812]: fatal: ldap:/etc/postfix/accounts.conf(0,100): table lookup problem

具体的日志在上面,谢谢大家!

论坛徽章:
0
4 [报告]
发表于 2004-06-06 09:32 |只看该作者

help, postfix openldap

= 前后多了空格。

论坛徽章:
0
5 [报告]
发表于 2004-06-06 11:33 |只看该作者

help, postfix openldap

那里多了空格,我检查过了accounts.conf文件没有多余的空格?

论坛徽章:
0
6 [报告]
发表于 2004-06-06 11:36 |只看该作者

help, postfix openldap

最近终于可以安裝openldap了..真失策, 搞了那么久..
找天安个postfix 试试先..


[quote]原帖由 "xiaohua"]速成手册 http://www.dmail-x.com/doc/insdoc.pdf[/quote 发表:


这手冊实在是太牛了..
我太笨, 看不懂..     

论坛徽章:
0
7 [报告]
发表于 2004-06-06 18:27 |只看该作者

help, postfix openldap

原帖由 "kinux" 发表:


这手冊实在是太牛了..
我太笨, 看不懂..     


公开版本还删了很多东西,这最多只有 2/3
            
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP