- 论坛徽章:
- 0
|
请教大大们一个问题啊!!smtpd.conf中%u的值是怎么取的?
在sasl认证这块我的变量取值是错的,不知道怎么回事.配置文件如下:
=====================
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login
sql_engine: mysql
sql_hostnames: localhost
sql_user: postfix
sql_passwd: postfix
sql_database: postfix
sql_select: SELECT password FROM mailbox WHERE username='%u@%r' and domain='%r' and active='1'
=======================
因为sasl认证总是不能成功,查询日志message是 无法查询到结果.
Feb 13 21:29:25 hirain sshd(pam_unix)[4488]: session opened for user root by root(uid=0)
Feb 13 21:30:02 hirain postfix/smtpd[4372]: sql plugin: no result found
Feb 13 21:30:02 hirain postfix/smtpd[4372]: sql plugin: no result found
查看mysql查询日志.配置文件中username='%u@%r' 的取值是错的.
080213 22:23:15 243 Connect postfix@localhost on postfix
243 Quit
244 Connect postfix@localhost on postfix
244 Quit
245 Connect postfix@localhost on postfix
245 Query START TRANSACTION
245 Query SELECT password FROM mailbox WHERE username='hyang.com@domain.com' and domain='domain.com' and active='1'
245 Query SELECT password FROM mailbox WHERE username='hyang.com@domain.com' and domain='domain.com' and active='1'
245 Query COMMIT
245 Quit
================================
我要认证邮件是hyang@domain.com但是查询时用户名 %u 取值 成了 "hyang.com" 了. mysql数据库中是没问题的.
我就是想知道smtpd.conf中的 %u [被获取或存储属性的用户的用户名].这个用户名应该是 hyang 才对,不知道它是怎么取值的?我应该改什么?
是否能够支持表达式,把后边的.com去掉, 但是官方主业上说只支持4各变量: %u %r %p %v,没有其它的了..
我该怎么办,谁来救救我啊!!!!!!!!!!!!!!!!!
[ 本帖最后由 yh81521 于 2008-2-14 11:34 编辑 ] |
|