Bug 448256 - postfix+procmail ignores .procmailrc if selinux is enabled
postfix+procmail ignores .procmailrc if selinux is enabled
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
9
All Linux
low Severity high
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-24 22:41 EDT by Paramjit Oberoi
Modified: 2008-05-26 22:25 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-26 22:25:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Paramjit Oberoi 2008-05-24 22:41:49 EDT
Description of problem:
I use postfix and procmail for my email.  I uninstalled sendmail, installed postfix and procmail 
and configured postfix to use procmail.  procmail was being invoked (postfix was logging 
invocation of procmail), but it was ignoring my .procmailrc.

I'm not sure if this should be classified as a procmail bug or an selinux policy bug.

Version-Release number of selected component (if applicable):
procmail-3.22-21.fc9.i386

How reproducible:
Install postfix and procmail.  Add the line "mailbox_command = /usr/bin/procmail" to /etc/postfix/
main.cf.  Start postfix.  Create a $HOME/.procmailrc file containing the following lines:

MAILDIR=/home/<username>/Maildir
DEFAULT=INBOX/

Send yourself email using the command "mail <username>".  The mail will be delivered to /var/
spool/mail/<username> instead of the maildir specified in the .procmailrc file.
  
Actual results:
Mail is delivered to /var/spool/mail/<username>

Expected results:
Mail should be delivered to Maildir/INBOX

Additional info:

It turned out to be an selinux problem.  I had to add the following selinux policy module to get it 
to work:

----------

module local 1.0;

require {
        type file_t;
        type procmail_t;
        class file { write getattr link read create unlink append };
        class dir { write remove_name add_name };
}

#============= procmail_t ==============
allow procmail_t file_t:dir { write remove_name add_name };
allow procmail_t file_t:file { write getattr link read create unlink append };

----------

I used the instructions at http://www.linuxquestions.org/questions/fedora-35/selinux-errors-when-
a-php-program-attempts-to-send-out-email-624309/ to debug the problem and figure out how to 
generate and load a selinux policy module.
Comment 1 Paramjit Oberoi 2008-05-26 22:25:10 EDT
Never mind - it was a labelling problem.  A relabel fixed it.

I installed Fedora 9 from scratch, but I had an old home partition that had no
labels.  I told the installer about that partition, but I think the installer
did not re-label it.

Note You need to log in before you can comment on or make changes to this bug.