由 unicorncn 在 05-30-2004 23:27 发表:
postfix + cyrus +saslauthd2 pam postgresql 紧急求助!!!
小弟在freebsd 4.10下 port安装 postfix (选 cyrus-sasl2 postgresql-7.4 bdb 41) cyrus-sasl2-saslauthd cyrus-imapd2 pam_pgsql
配置:
pam.conf
> quote:
>
> * * *
>
>
>
> #imap auth required pam_unix.so try_first_pass
>
> #pop3 auth required pam_unix.so try_first_pass
>
> smtp auth required pam_pgsql.so debug
>
> smtp password required pam_pgsql.so debug
>
> smtp account required pam_pgsql.so debug
>
>
>
> imap auth required pam_pgsql.so debug
>
> imap password required pam_pgsql.so debug
>
> imap account required pam_pgsql.so debug
>
>
>
> * * *
pam_pgsql.conf
> quote:
>
> * * *
>
>
>
> host=127.0.0.1
>
> database=mail
>
> user=mail
>
> password=mail
>
> table=mailuser
>
> usr_column=usr
>
> pwd_column=pass
>
> expired_column=expired
>
> network_column=newtok
>
> debug
>
>
>
> * * *
postfix/main.cf
> quote:
>
> * * *
>
>
>
> mydomain = zsufivehos.com
>
> alias_maps = hash:/usr/local/etc/postfix/aliases
>
> alias_database = hash:/usr/local/etc/postfix/aliases
>
> virtual_transport = cyrus
>
> virtual_mailbox_maps = pgsql:/usr/local/etc/postfix/pgsql-mailbox.cf
>
> virtual_minimum_uid = 100
>
> virtual_uid_maps = static:5000
>
> virtual_gid_maps = static:5000
>
> smtpd_sasl_auth_enable = yes
>
> broken_sasl_auth_clients = yes
>
>
>
> * * *
master.cf
> quote:
>
> * * *
>
>
>
> cyrus unix - n n - - pipe
>
> user=cyrus argv=/usr/bin/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
>
>
>
> * * *
pgsql-mailbox.cf
> quote:
>
> * * *
>
>
>
> hosts = 127.0.0.1
>
> user = mail
>
> password = mail
>
> dbname = mail
>
> table = mailuser
>
> select_field = box
>
> where_field = addr
>
>
>
> * * *
netstat -an|grep LISTEN
22 25 110 443 5432 等端口均打开
psql -U mail -h 127.0.0.1 mail
能正常登陆查询
测试
telnet 127.0.0.1 25
maillog
> quote:
>
> * * *
>
>
>
> May 30 22:41:58 s02 postfix/smtpd[216]: mynetworks: 172.16.92.0/24 127.0.0.0/8
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: mynetworks ~? debug_peer_list
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: mynetworks ~? fast_flush_domains
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: mynetworks ~? mynetworks
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: relay_domains ~? debug_peer_list
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: relay_domains ~? fast_flush_domains
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: relay_domains ~? mynetworks
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: relay_domains ~? permit_mx_backup_networks
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: relay_domains ~? qmqpd_authorized_clients
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: relay_domains ~? relay_domains
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: permit_mx_backup_networks ~? debug_peer_list
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: permit_mx_backup_networks ~? fast_flush_domains
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: permit_mx_backup_networks ~? mynetworks
>
> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: permit_mx_backup_networks ~? permit_mx_backup_networks
>
> May 30 22:41:58 s02 postfix/smtpd[216]: connect to subsystem private/proxymap
>
> May 30 22:41:58 s02 postfix/smtpd[216]: send attr request = open
>
> May 30 22:41:58 s02 postfix/smtpd[216]: send attr table = unix:passwd.byname
>
> May 30 22:41:58 s02 postfix/smtpd[216]: send attr flags = 64
>
> May 30 22:41:58 s02 postfix/smtpd[216]: private/proxymap socket: wanted attribute: status
>
> May 30 22:41:58 s02 postfix/smtpd[216]: input attribute name: status
>
> May 30 22:41:58 s02 postfix/smtpd[216]: input attribute value: 0
>
> May 30 22:41:58 s02 postfix/smtpd[216]: private/proxymap socket: wanted attribute: flags
>
> May 30 22:41:58 s02 postfix/smtpd[216]: input attribute name: flags
>
> May 30 22:41:58 s02 postfix/smtpd[216]: input attribute value: 80
>
> May 30 22:41:58 s02 postfix/smtpd[216]: private/proxymap socket: wanted attribute: (list terminator)
>
> May 30 22:41:58 s02 postfix/smtpd[216]: input attribute name: (end)
>
> May 30 22:41:58 s02 postfix/smtpd[216]: dict_proxy_open: connect to map=unix:passwd.byname status=0 server_flags=0120
>
> May 30 22:41:58 s02 postfix/smtpd[216]: dict_open: proxy:unix:passwd.byname
>
> May 30 22:41:58 s02 postfix/smtpd[216]: dict_open: hash:/usr/local/etc/postfix/aliases
>
> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: user = mail
>
> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: password = mail
>
> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: dbname = mail
>
> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: select_function =
1<null>
2>
3> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: query = <null>
4>
5> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: table = mailuser
6>
7> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: select_field = box
8>
9> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: where_field = addr
10>
11> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: additional_conditions =
12>
13> May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: hosts = 127.0.0.1
14>
15> May 30 22:41:58 s02 postfix/smtpd[216]: pgsqlname_parse: /usr/local/etc/postfix/pgsql-mailbox.cf: adding host '127.0.0.1' to list of pgsql server hosts
16>
17> May 30 22:41:58 s02 postfix/smtpd[216]: dict_open: pgsql:/usr/local/etc/postfix/pgsql-mailbox.cf
18>
19> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? debug_peer_list
20>
21> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? fast_flush_domains
22>
23> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? mynetworks
24>
25> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? permit_mx_backup_networks
26>
27> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? qmqpd_authorized_clients
28>
29> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? relay_domains
30>
31> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? smtpd_access_maps
32>
33> May 30 22:41:58 s02 postfix/smtpd[216]: smtpd_sasl_initialize: SASL config file is smtpd.conf
34>
35> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: fast_flush_domains ~? debug_peer_list
36>
37> May 30 22:41:58 s02 postfix/smtpd[216]: match_string: fast_flush_domains ~? fast_flush_domains
38>
39> May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_create: 0x8099088 18000
40>
41> May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_stop: 0x8099088
42>
43> May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_start: 0x8099088
44>
45> May 30 22:41:58 s02 postfix/smtpd[216]: connection established
46>
47> May 30 22:41:58 s02 postfix/smtpd[216]: master_notify: status 0
48>
49> May 30 22:41:58 s02 postfix/smtpd[216]: name_mask: resource
50>
51> May 30 22:41:58 s02 postfix/smtpd[216]: name_mask: software
52>
53> May 30 22:41:58 s02 postfix/smtpd[216]: name_mask: noanonymous
54>
55> May 30 22:41:58 s02 postfix/smtpd[216]: connect from localhost[127.0.0.1]
56>
57> May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: localhost: no match
58>
59> May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: 127.0.0.1: no match
60>
61> May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: localhost: no match
62>
63> May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: 127.0.0.1: no match
64>
65> May 30 22:41:58 s02 postfix/smtpd[216]: > localhost[127.0.0.1]: 220 localhost ESMTP Postfix
66>
67> May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_pat: 0x8099088
68>
69> May 30 22:42:07 s02 postfix/smtpd[216]: < localhost[127.0.0.1]: ehlo localhost
70>
71> May 30 22:42:07 s02 postfix/smtpd[216]: > localho</null></null>