- 论坛徽章:
- 0
|
小弟在freebsd 4.10下 port安装 postfix (选 cyrus-sasl2 postgresql-7.4 bdb 41) cyrus-sasl2-saslauthd cyrus-imapd2 pam_pgsql
配置:
pam.conf
#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
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
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
cyrus unix - n n - - pipe
user=cyrus argv=/usr/bin/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
pgsql-mailbox.cf
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
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 = <NULL>;
May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: query = <NULL>;
May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: table = mailuser
May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: select_field = box
May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: where_field = addr
May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: additional_conditions =
May 30 22:41:58 s02 postfix/smtpd[216]: cfg_get_str: /usr/local/etc/postfix/pgsql-mailbox.cf: hosts = 127.0.0.1
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
May 30 22:41:58 s02 postfix/smtpd[216]: dict_open: pgsql:/usr/local/etc/postfix/pgsql-mailbox.cf
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? debug_peer_list
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? fast_flush_domains
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? mynetworks
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? permit_mx_backup_networks
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? qmqpd_authorized_clients
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? relay_domains
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: smtpd_access_maps ~? smtpd_access_maps
May 30 22:41:58 s02 postfix/smtpd[216]: smtpd_sasl_initialize: SASL config file is smtpd.conf
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: fast_flush_domains ~? debug_peer_list
May 30 22:41:58 s02 postfix/smtpd[216]: match_string: fast_flush_domains ~? fast_flush_domains
May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_create: 0x8099088 18000
May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_stop: 0x8099088
May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_start: 0x8099088
May 30 22:41:58 s02 postfix/smtpd[216]: connection established
May 30 22:41:58 s02 postfix/smtpd[216]: master_notify: status 0
May 30 22:41:58 s02 postfix/smtpd[216]: name_mask: resource
May 30 22:41:58 s02 postfix/smtpd[216]: name_mask: software
May 30 22:41:58 s02 postfix/smtpd[216]: name_mask: noanonymous
May 30 22:41:58 s02 postfix/smtpd[216]: connect from localhost[127.0.0.1]
May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: localhost: no match
May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: 127.0.0.1: no match
May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: localhost: no match
May 30 22:41:58 s02 postfix/smtpd[216]: match_list_match: 127.0.0.1: no match
May 30 22:41:58 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 220 localhost ESMTP Postfix
May 30 22:41:58 s02 postfix/smtpd[216]: watchdog_pat: 0x8099088
May 30 22:42:07 s02 postfix/smtpd[216]: < localhost[127.0.0.1]: ehlo localhost
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250-localhost
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250-PIPELINING
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250-SIZE 10240000
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250-VRFY
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250-ETRN
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250-AUTH LOGIN PLAIN
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250-AUTH=LOGIN PLAIN
May 30 22:42:07 s02 postfix/smtpd[216]: match_list_match: localhost: no match
May 30 22:42:07 s02 postfix/smtpd[216]: match_list_match: 127.0.0.1: no match
May 30 22:42:07 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 250 8BITMIME
May 30 22:42:07 s02 postfix/smtpd[216]: watchdog_pat: 0x8099088
May 30 22:42:45 s02 postfix/smtpd[216]: < localhost[127.0.0.1]: auth plain dGVzdDEAdGVzdDEAcGFzczE=
May 30 22:42:45 s02 postfix/smtpd[216]: smtpd_sasl_authenticate: sasl_method plain, init_response dGVzdDEAdGVzdDEAcGFzczE=
May 30 22:42:45 s02 postfix/smtpd[216]: smtpd_sasl_authenticate: decoded initial response test1
May 30 22:42:45 s02 postfix/smtpd[216]: warning: SASL authentication failure: Password verification failed
May 30 22:42:45 s02 postfix/smtpd[216]: warning: localhost[127.0.0.1]: SASL plain authentication failed
May 30 22:42:45 s02 postfix/smtpd[216]: >; localhost[127.0.0.1]: 535 Error: authentication failed
May 30 22:42:45 s02 postfix/smtpd[216]: watchdog_pat: 0x8099088
启动时messages信息
May 30 22:41:32 s02 master[137]: process started
May 30 22:41:33 s02 ctl_cyrusdb[140]: recovering cyrus databases
May 30 22:41:33 s02 ctl_cyrusdb[140]: done recovering cyrus databases
May 30 22:41:33 s02 master[137]: ready for work
May 30 22:41:33 s02 ctl_cyrusdb[167]: checkpointing cyrus databases
May 30 22:41:33 s02 ctl_cyrusdb[167]: done checkpointing cyrus databases
auth.log
May 30 22:42:45 s02 saslauthd[196]: the database, table and user_column options are required.
May 30 22:42:45 s02 saslauthd[196]: do_auth : auth failure: [user=test1] [service=smtp] [realm=] [mech=pam] [reason=PAM auth error]
pgsql里 无错误
databases = mail table = mailuser
id usr pass expired newtok addr box
1 test1 pass1 f f test1@zsufivehos.com test1
我不知错误出在哪里?如能指正万分感谢!!! |
|