Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just created the /etc/maildroprc file to drop spam mails into a spamfolder. In my postfix master.cf I have the line:

maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}

The permissions of the /etc/maildroprc file look like this: (ls -l)

-rw------- vmail vmail /etc/maildroprc

The vmail user is in /etc/passwd :

vmail:x:5000:5000::/home/vmail:/usr/sbin/nologin

The problem is that every time an email is being processed the following error occurs in postfix (/var/log/mail.log):

(temporary failure. Command output: /usr/bin/maildrop: Error opening /etc/maildroprc. )

Do you have any idea what could be the reason for this behavior?

Edit: The contents of my maildroprc file (I changed it to this minimum and it didn't change anything on the error)

# Global maildrop filter file

# Uncomment this line to make maildrop default to ~/Maildir for
# delivery- this is where courier-imap (amongst others) will look.
DEFAULT="$HOME/Maildir"

Edit 2: The following command exits normally (executed as root)

maildrop -V < /testspam.txt

where this command throws the same error as postfix: (also executed as root)

maildrop -V -d myusername < /testspam.txt

Edit 3: It seems to be a permission problem. If I change the permission of /etc/maildroprc to 777 everything works. Any idea on how the permissions really should look like?

share|improve this question
    
What is the content of your maildroprc file? –  fboaventura Mar 2 '13 at 13:15
    
I added the contents but I don't think this is the reason for the error. –  Nicholas Mar 2 '13 at 13:26
    
can you try chgrp vmail /usr/bin/maildrop; chmod 2755 /usr/bin/maildrop; chgrp vmail /etc/maildroprc; chmod 660 /etc/maildroprc and see if this fix it? –  fboaventura Mar 2 '13 at 14:45
    
tried it but that doesn't fix it. still the same error –  Nicholas Mar 2 '13 at 17:41
    
@fboaventura Ok ... changed my master.cf back such that maildrop is executed by the vmail user (had changed it to root). Now your suggestion works! Thanks –  Nicholas Mar 2 '13 at 17:48

1 Answer 1

up vote 0 down vote accepted

can you try

chgrp vmail /usr/bin/maildrop
chmod 2755 /usr/bin/maildrop
chgrp vmail /etc/maildroprc
chmod 660 /etc/maildroprc

and see if this fix it?

share|improve this answer

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.