免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: akid
打印 上一主题 下一主题

[Mail] maildirsize不存在时maildrop不会创建maildirsize的讨论 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2005-12-26 00:10 |只看该作者
谢谢hzqbbc老大的肯定!

另外发现一个问题:maildrop在“to ./Maildir/.Trash/”情况下,不会把邮件计算进Maildir/maildirsize,而是在在./Maildir/.Trash目录下建立了一个maildirsize文件记录垃圾邮件的quota!此时该垃圾邮件就没有计算进该用户的邮箱空间限额了!(注:我已经设置了--with-trashquota计算.Trash的quota)

变通一下,我在.mailfilter中“to ./Maildir/.Trash/”之前加上增加quota的功能,代码示例如下:
if (/^X-Spam-Status: Yes/:h)
{
ADDQUOTA = " $SIZE 1"
`echo $ADDQUOTA >> ./Maildir/maildirsize`
to ./Maildir/.Trash/
}
else
{
to ./Maildir/
}

经测试,一切OK!

当然,这个办法有些不足,就是对过滤进入.Trash的邮件不会即刻产生quota溢出的退信或警告(不过这也没什么意义)。除了修改maildrop的源码,不知道有没有别的更好的办法~~

[ 本帖最后由 akid 于 2005-12-26 00:26 编辑 ]

论坛徽章:
0
12 [报告]
发表于 2006-03-13 09:53 |只看该作者
|/usr/local/bin/maildrop -d test ./.mailfilter

这样不对吧?


-d user

Run maildrop in delivery mode for this user ID.

The system administrator may optionally restrict the -d option to be available to the mail system only, so it may not be available to you. In all cases, the -d option is allowed if user is the same user who is running maildrop. Also, for the -d option to work at all, maildrop must be executed by root, or maildrop must be a root-owned program with the setuid bit set. Absence of a filename on maildrop's command line implies the -d option for the user running maildrop.

If -d is not specified, the first argument following all the options is a name of the file containing filtering instructions. The remaining arguments, if any, are assigned to the variables $1, $2, and so on (see "Environment" and "Variable substitution").

我测试过,如果加上参数-d,邮件就收不到了!

[ 本帖最后由 红雨 于 2006-3-13 10:41 编辑 ]

论坛徽章:
0
13 [报告]
发表于 2006-03-13 13:06 |只看该作者
楼主的钻研很深,值得学习

论坛徽章:
0
14 [报告]
发表于 2006-04-14 20:24 |只看该作者
原帖由 红雨 于 2006-3-13 09:53 发表
|/usr/local/bin/maildrop -d test ./.mailfilter

这样不对吧?


   读读maildrop的源代码你就会发现,只有加上-d参数maildrop才有可能去读数据库。
  当.mailfile起不到应有作用时,可以手动调用maildrop进行邮件投递,比如在~vpopmail/domains/mydomain/test目录下cat ./Maildir/cur/1135234315.883.mail,S=1529:2, | /usr/local/bin/maildrop -d test ./.mailfilter。
  这样如果maildrop有什么错误会直接在终端上显示出来,排错简捷一些。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP