Bug 840706 - procmail denied access to Maildir folders
Summary: procmail denied access to Maildir folders
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-17 02:39 UTC by Alan Hamilton
Modified: 2012-07-21 22:52 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-21 22:52:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alan Hamilton 2012-07-17 02:39:36 UTC
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-17 02:42:13 UTC
Also noting that running audit2allow -R shows

#============= procmail_t ==============
mta_manage_home_rw(procmail_t)

Comment 2 Miroslav Grepl 2012-07-17 07:05:28 UTC
Fixed in selinux-policy-3.10.0-140.fc17

Comment 3 Fedora Update System 2012-07-18 13:05:55 UTC
selinux-policy-3.10.0-140.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-140.fc17

Comment 4 Fedora Update System 2012-07-19 09:12:44 UTC
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:
https://admin.fedoraproject.org/updates/FEDORA-2012-10840/selinux-policy-3.10.0-140.fc17
then log in and leave karma (feedback).

Comment 5 Alan Hamilton 2012-07-19 23:54:32 UTC
The test release fixed the issue. Thanks!

Comment 6 Fedora Update System 2012-07-21 22:52:53 UTC
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.