- 论坛徽章:
- 0
|
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! |
|