免费注册 查看新帖 |

Chinaunix

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

[Mail] postfix + cyrus +saslauthd2 pam postgresql 紧急求助!!! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-05-30 23:25 |只看该作者 |倒序浏览
小弟在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


我不知错误出在哪里?如能指正万分感谢!!!

论坛徽章:
0
2 [报告]
发表于 2004-05-30 23:54 |只看该作者

postfix + cyrus +saslauthd2 pam postgresql 紧急求助!!!

May 30 22:42:45 s02 saslauthd[196]: the database, table and user_column options are required.

这行说明问题了....
你的pam没指定数据库,表名,各个字段等

论坛徽章:
0
3 [报告]
发表于 2004-05-31 08:47 |只看该作者

postfix + cyrus +saslauthd2 pam postgresql 紧急求助!!!

原帖由 "yejr" 发表:
e database, table and user_column options are required.

这行说明问题了....
你的pam没指定数据库,表名,各个字段等


谢谢解答

修改了i我的
pam_pgsql.conf
host=127.0.0.1
database=mail
user=mail
password=mail
table=mailuser
user_column=usr
pwd_column=pass
expired_column=expired
network_column=newtok
debug  


auth.log里显示
May 30 22:42:45 s02 saslauthd[196]: do_auth : auth failure: [user=test1] [service=smtp] [realm=] [mech=pam] [reason=PAM auth error]

其他还是上面错误


maillog 里
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


这里说明什么问题吗?谢谢![/quote]

论坛徽章:
0
4 [报告]
发表于 2004-05-31 19:05 |只看该作者

postfix + cyrus +saslauthd2 pam postgresql 紧急求助!!!

我是用mysql做的数据库,我是在/etc/pam.d/smtp文件里设定这些的,你的pg_pam.conf是放在哪里的,做什么用的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP