免费注册 查看新帖 |

Chinaunix

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

[Mail] 求助 postmap查询mysql错误. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-14 15:30 |只看该作者 |倒序浏览
有一个mysql-recipient.cf文件内容如下:
user = root
password = zzzzz
dbname = postfix
hosts = 127.0.0.1
query = SELECT class FROM tbRecipientClasses WHERE id = '%s'

运行 postmap -q aaa@abc.com mysql:mysql-recipeint.cf 时报错: postmap: fatal: bad string length 0 < 1: mysql-recipient.cf_dbname =

我在mysql里面运行"SELECT class FROM tbRecipientClasses"没有问题, 真是百思不得其解.   

论坛徽章:
0
2 [报告]
发表于 2007-08-15 17:55 |只看该作者
原帖由 joeywong 于 2007-8-14 15:30 发表
有一个mysql-recipient.cf文件内容如下:
user = root
password = zzzzz
dbname = postfix
hosts = 127.0.0.1
query = SELECT class FROM tbRecipientClasses WHERE id = '%s'

运行 postmap -q aaa@a ...


这个不是用来postmap的。是在main.cf中用的。
如:smtpd_client_restrictions = mysql:/etc/postfix/mysql-recipient.cf

论坛徽章:
0
3 [报告]
发表于 2007-08-16 15:40 |只看该作者
这个cf文件是用于main.cf中的设定. 但应该可以用postmap测试它的运行结果吧?  ldap和hash的都可以, mysql的不行吗?

论坛徽章:
0
4 [报告]
发表于 2007-08-16 16:07 |只看该作者
http://www.postfix.org/postmap.1.html
       as of Postfix 2.3 this  case
       folding  happens  only  with  tables whose lookup keys are
       fixed-case strings such as btree:,  dbm:  or  hash:.  With
       earlier  versions,  the  lookup  key  is  folded even with
       tables where a lookup field can match both upper and lower
       case  text,  such  as  regexp: and pcre:.

论坛徽章:
0
5 [报告]
发表于 2007-08-20 16:01 |只看该作者
原帖由 joeywong 于 2007-8-16 15:40 发表
这个cf文件是用于main.cf中的设定. 但应该可以用postmap测试它的运行结果吧?  ldap和hash的都可以, mysql的不行吗?


不好意思,上次是我弄错了.mysql也是可以的

今天刚好也碰到这个问题,于是测试了一下,发现是因为你没有在mysql:后面加上绝对路径:
比如正确的是: postmap -q test@test.com mysql:/root/test.cf
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP