November 1, 2007

Letting Cyrus’ Sieve send e-mail on CentOS 5

Problem: sieve rules like redirect (A.K.A. forward) don’t work on CentOS 5. You see things in the logs like:

Oct 29 17:15:52 gateway lmtpunix[26948]: sieve runtime error for
someone@example.com id <blahlblahasdlahd@as987da97da987ads7>:
Vacation: Sendmail process terminated normally, exit status 75

Nov  1 00:47:10 gateway lmtpunix[30206]: FATAL: couldn't exec() sendmail

Explanation: SELinux is preventing Cyrus from running sendmail.

Solution:

  1. Install the selinux-policy-devel package.
  2. Jam this in local_cyrus.te:

    policy_module(local_cyrus, 1.0.3)
    
    
    require {
            type cyrus_t;
    };
    
    
    corecmd_exec_sbin(cyrus_t)
    mta_send_mail(cyrus_t)
    
  3. make -f /usr/share/selinux/devel/Makefile local_cyrus.pp

  4. semodule --install local_cyrus.pp

Now Cyrus should be able to run sendmail.

WARNING: this may allow Cyrus to do more than it should be able to. I’m hardly an SELinux expert.

Comments are closed.