Procmail:拒绝“/etc/procmailrcs/default.rc”的特殊权限

Procmail:拒绝“/etc/procmailrcs/default.rc”的特殊权限

我正在尝试设置 postfix、dovecot 和 procmail 以便与虚拟用户一起工作。最后,我希望拥有虚拟用户以及添加规则以对传入规则进行排序的可能性。最后一件事,我需要 procmail(对吗?)。

当我向我的服务器发送电子邮件时,我没有在 Maildir 中收到它,并且在 mail.log 中看到以下内容:

Jun 17 21:01:03 cs postfix/smtpd[24811]: connect from dub0-omc2-s13.dub0.hotmail.com[157.55.1.152]
Jun 17 21:01:03 cs postfix/smtpd[24811]: D8C9F44D88: client=dub0-omc2-s13.dub0.hotmail.com[157.55.1.152]
Jun 17 21:01:03 cs postfix/cleanup[24816]: D8C9F44D88: message-id=<[email protected]>
Jun 17 21:01:04 cs postfix/qmgr[24806]: D8C9F44D88: from=<my-test-email>, size=1617, nrcpt=1 (queue active)
Jun 17 21:01:04 cs procmail[24818]: Denying special privileges for "/etc/procmailrcs/default.rc"
Jun 17 21:01:04 cs postfix/smtpd[24811]: disconnect from dub0-omc2-s13.dub0.hotmail.com[157.55.1.152]
Jun 17 21:01:04 cs postfix/pipe[24817]: D8C9F44D88: to=<my-virtual-email>, relay=virtualprocmail, delay=0.18, delays=0.15/0/0/0.02, dsn=2.0.0, status=sent (delivered via virtualprocmail service)
Jun 17 21:01:04 cs postfix/qmgr[24806]: D8C9F44D88: removed

如何修复 procmail 吐出的“拒绝特殊权限”行?

camilstaps@cs:/# ls -al /etc/procmailrcs
total 12
drwxr-xr-x  2 root  vmail   4096 Jun 17 19:48 .
drwxr-xr-x 97 root  root    4096 Jun 17 19:47 ..
-rw-------  1 vmail postfix   44 Jun 17 19:48 default.rc

这是我的/etc/postfix/master.cf

smtp      inet  n       -       -       -       -       smtpd
submission inet  n       -       n       -       -       smtpd
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
virtualprocmail unix - n n - - pipe flags=DRXhuq user=vmail
  argv=/usr/bin/procmail -m E_SENDER=$sender E_RECIPIENT=$recipient ER_USER=$user ER_DOMAIN=$domain ER_DETAIL=$extension NEXTHOP=$nexthop /etc/procmailrcs/default.rc
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

我使用的是 Ubuntu 服务器 13.04。

答案1

man procmail状态:

Denying special privileges for "x"
  Procmail will not take on the identity that comes with the rcfile because 
  a security violation was found (e.g.  -p or variable assignments on the
  command line) or procmail had insufficient privileges to do so.

在所呈现的情况下,错误消息是由variable assignments on the command line例如引起的E_SENDER=$sender

可能的修复:

使用另一个“非 procmail 特殊”目录来存储脚本而不是 /etc/procmailrcs
(据我所知,在这种情况下不需要 /etc/procmailrcs 魔法)
或者
在命令行上传递使用位置参数并在 *.rc 文件中分配

procmail 脚本调用:

/usr/bin/procmail -m /etc/procmailrcs/default.rc $sender $recipient $user $domain $extension $nexthop 

procmail 脚本(初始部分):

# DROPRIVS - procmail magical variable, assigment causes side effects
DROPPRIVS=yes

E_SENDER=$1 
E_RECIPIENT=$2 
ER_USER=$3 
ER_DOMAIN=$4 
ER_DETAIL=$5 
NEXTHOP=$6

相关内容