Bug 840706 - procmail denied access to Maildir folders
procmail denied access to Maildir folders
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-07-16 22:39 EDT by Alan Hamilton
Modified: 2012-07-21 18:52 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-07-21 18:52:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alan Hamilton 2012-07-16 22:39:36 EDT
Description of problem:
procmail is unable to write to /home/user/Maildir folders as it does not have write access to the mail_home_rw_t context.

How reproducible:
Run mail through procmail and have it deliver to a Maildir folder in a user's home directory.

Steps to Reproduce:
1. Create .procmairc with MAILDIR=$HOME/Maildir
2. Send mail to user.
Actual results:
Mail is not delivered. procmail's log shows:
procmail: Error while writing to "/home/alanh/Maildir/tmp/1342487394.10921_0.starfall.dynip.com"
procmail: Couldn't create or rename temp file "/home/alanh/Maildir/tmp/1342487394.10921_0.starfall.dynip.com"

And the system log shows (among many others):
Jul 16 18:32:25 starfall kernel: [124408.763381] type=1400 audit(1342488745.221:48): avc:  denied  { write } for  pid=11084 comm="procmail" name="tmp" dev="dm-3" ino=262146 scontext=system_u:system_r:procmail_t:s0 tcontext=unconfined_u:object_r:mail_home_rw_t:s0 tclass=dir

Expected results:
Mail delivered to Maildir folder.

Additional info:
Running in permissive mode and then running audit2allow shows:

#============= procmail_t ==============
#!!!! The source type 'procmail_t' can write to a 'dir' of the following types:
# data_home_t, var_log_t, user_home_dir_t, mail_spool_t, tmp_t, user_home_t

allow procmail_t mail_home_rw_t:dir { write remove_name add_name };
#!!!! The source type 'procmail_t' can write to a 'file' of the following types:
# data_home_t, procmail_tmp_t, mail_spool_t, user_home_t

allow procmail_t mail_home_rw_t:file { write open create unlink link };

This may be related to bug 830611 which caused the same issue with dovecot.
Comment 1 Alan Hamilton 2012-07-16 22:42:13 EDT
Also noting that running audit2allow -R shows

#============= procmail_t ==============
Comment 2 Miroslav Grepl 2012-07-17 03:05:28 EDT
Fixed in selinux-policy-3.10.0-140.fc17
Comment 3 Fedora Update System 2012-07-18 09:05:55 EDT
selinux-policy-3.10.0-140.fc17 has been submitted as an update for Fedora 17.
Comment 4 Fedora Update System 2012-07-19 05:12:44 EDT
Package selinux-policy-3.10.0-140.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-140.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 5 Alan Hamilton 2012-07-19 19:54:32 EDT
The test release fixed the issue. Thanks!
Comment 6 Fedora Update System 2012-07-21 18:52:53 EDT
selinux-policy-3.10.0-140.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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