RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 808624 - dovecot lmtp exec access denied to sendmail.postfix
Summary: dovecot lmtp exec access denied to sendmail.postfix
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.2
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-30 21:41 UTC by info@kobaltwit.be
Modified: 2012-09-21 12:41 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.7.19-144.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 12:32:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0780 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2012-06-19 20:34:59 UTC

Description info@kobaltwit.be 2012-03-30 21:41:18 UTC
Description of problem:
I have configured dovecot lmtp as virtual delivery agent on my postfix based mailserver. Dovecot additionally has sieve (via dovecot-pigeonhole) enabled and I'm using a sieve script to setup a vacation message using the sieve vacation plugin.

Whenever a message arrives for the account with an active vacation sieve script, the message is delivered, but the vacation auto reply is not. The core reason seems to be that dovecot lmtp doesn't have exec access on /usr/sbin/sendmail.postfix due to the current selinux policy.

Version-Release number of selected component (if applicable):
dovecot-2.0.9-2.el6_1.1.x86_64
dovecot-pigeonhole-2.0.9-2.el6_1.1.x86_64
postfix-2.6.6-2.2.el6_1.x86_64
selinux-policy-targeted-3.7.19-126.el6_2.10.noarch

How reproducible:
Always

Steps to Reproduce:
1. setup sieve for dovecot and setup a vacation sieve script for a user (I used the example script from http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples)
2. send a mail to the user for which a vacation message is active
  
Actual results:
Vacation reply message isn't sent. This is found in the maillog (I filtered to the relevant dovecot messages only):
Mar 30 21:37:59 abmpub6 dovecot: lmtp(6626): Connect from local
Mar 30 21:37:59 abmpub6 dovecot: lmtp(6626, recipient): Fatal: execv(/usr/sbin/sendmail) failed: Permission denied
Mar 30 21:37:59 abmpub6 dovecot: lmtp(6626, recipient): Error: Sendmail process terminated abnormally, exit status 84
Mar 30 21:37:59 abmpub6 dovecot: lmtp(6626, recipient): Error: JBO/MowKdk/iGQAAZsTLbA: sieve: msgid=<20120330193759.7CA7758855A>: failed
 to send vacation response to <sender> (refer to server log for more information)

This is accompanied by the following selinux messages in audit.log:
type=AVC msg=audit(1333136279.642:112177): avc:  denied  { execute } for  pid=6653 comm="lmtp" name="sendmail.postfix" dev=xvda ino=7422495 scontext=unconfined_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:sendmail_exec_t:s0 tclass=file
type=SYSCALL msg=audit(1333136279.642:112177): arch=c000003e syscall=59 success=no exit=-13 a0=ccd270 a1=ccd288 a2=0 a3=34ac017240 items=0 ppid=6626 pid=6653 auid=501 uid=0 gid=10001 euid=10001 suid=0 fsuid=10001 egid=10001 sgid=10001 fsgid=10001 tty=(none) ses=707 comm="lmtp" exe="/usr/libexec/dovecot/lmtp" subj=unconfined_u:system_r:dovecot_t:s0 key=(null)

Expected results:
The automatic vacation reply is sent successfully.

Comment 2 Miroslav Grepl 2012-04-02 12:27:03 UTC
We have 

optional_policy(`
    # Handle sieve scripts
    sendmail_domtrans(dovecot_deliver_t)
')

So we probably need it also for dovecot_t.

Comment 3 Miroslav Grepl 2012-04-02 16:38:57 UTC
Could you test it with the following local policy

# cat mydovecot.te
policy_module(mydovecot, 1.0)

require{
 type dovecot_t;
}

optional_policy(`
    # Handle sieve scripts
    sendmail_domtrans(dovecot_t)
')


and then execute

# make -f /usr/share/selinux/devel/Makefile mydovecot.pp
# semodule -i dovecot.pp

Comment 4 info@kobaltwit.be 2012-04-03 08:10:36 UTC
When I install that policy, the mail forwarding sieve script works fine. Thanks.

Comment 5 Miroslav Grepl 2012-04-03 09:40:14 UTC
Great, thank you.

Comment 9 info@kobaltwit.be 2012-05-04 09:30:38 UTC
I wonder, when the new policy package gets pushed to the update repos, should I remove my local policy myself again or will this be done during the update ?

Comment 10 Daniel Walsh 2012-05-04 11:00:54 UTC
You will need to remove it, although it would not matter, since we allow duplicate allows.

Comment 11 errata-xmlrpc 2012-06-20 12:32:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0780.html


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