Bug 448256 - postfix+procmail ignores .procmailrc if selinux is enabled
Summary: postfix+procmail ignores .procmailrc if selinux is enabled
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 9
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-25 02:41 UTC by Paramjit Oberoi
Modified: 2008-05-27 02:25 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-05-27 02:25:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Paramjit Oberoi 2008-05-25 02:41:49 UTC
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-27 02:25:10 UTC
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.