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?
maildroprc
file?chgrp vmail /usr/bin/maildrop; chmod 2755 /usr/bin/maildrop; chgrp vmail /etc/maildroprc; chmod 660 /etc/maildroprc
and see if this fix it?