Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to setup postfix, dovecot and procmail to work together with virtual users. In the end I want to have virtual users and the possibility to add rules to sort incoming rules. For the last thing, I need procmail (right?).

When I send an email to my server, I don't get it in my Maildir, and see this in 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=<DUB115-W85D8D79486AEC1D4346693C0830@phx.gbl>
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

How can I fix the line "Denying special privileges" procmail spits out?

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

Here's my /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}

I'm on Ubuntu Server 13.04.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

man procmail states:

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.

I the presented case the error message is caused by variable assignments on the command line e.g. E_SENDER=$sender.

Possible Fixes:

Use another "non special to procmail" directory to store the script instead of /etc/procmailrcs
(As I understand /etc/procmailrcs magic is not required in the case)
OR
Pass use positional parameters on the command line and assigment in *.rc file

procmail script invocation:

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

procmail script (initial part):

# DROPRIV - procmail magical variable, assigment causes side effects
DROPPRIV=yes

E_SENDER=$1 
E_RECIPIENT=$2 
ER_USER=$3 
ER_DOMAIN=$4 
ER_DETAIL=$5 
NEXTHOP=$6
share|improve this answer
    
Thanks! The error is gone since I moved the file. However, the mail isn't delivered in my Maildir - do you also know why that is? –  Camil Staps Jun 17 '13 at 19:47
    
Use LOGFILE, VERBOSE and (optionally) LOGABSTRACT in your procmail script to locate the problems (see man procmailrc) –  Andrzej A. Filip Jun 17 '13 at 19:51
    
Thanks! That really helped. The problem was procmail used the mbox format, not the Maildir format. I solved it by adding a slash (/) to the end of DEFAULT in the procmail script. (You might want to edit that in somehow, perhaps on askubuntu as well). Everything's working now, thanks a lot! –  Camil Staps Jun 17 '13 at 19:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.