From Debian package 0.0.20080702-7
Made spamass-milter run in the spamd_t domain, and allow postfix_smtpd_t
to talk to it
Index: policy/modules/services/postfix.te
===================================================================
--- policy/modules/services/postfix.te.orig
+++ policy/modules/services/postfix.te
@@ -231,6 +231,10 @@
manage_files_pattern(postfix_bounce_t, postfix_spool_bounce_t, postfix_spool_bounce_t)
manage_lnk_files_pattern(postfix_bounce_t, postfix_spool_bounce_t, postfix_spool_bounce_t)
+# for milters - may be a bug in postfix
+allow postfix_cleanup_t postfix_smtpd_t:fd use;
+allow postfix_cleanup_t postfix_smtpd_t:unix_stream_socket { getattr read write };
+
########################################
#
# Postfix cleanup local policy
@@ -630,3 +634,8 @@
# For reading spamassasin
mta_read_config(postfix_virtual_t)
mta_manage_spool(postfix_virtual_t)
+
+# for talking to spamass-milter
+optional_policy(`
+ spamassassin_connect_unix_sock(postfix_smtpd_t)
+')
Index: policy/modules/services/spamassassin.fc
===================================================================
--- policy/modules/services/spamassassin.fc.orig
+++ policy/modules/services/spamassassin.fc
@@ -6,6 +6,7 @@
/usr/bin/spamd -- gen_context(system_u:object_r:spamd_exec_t,s0)
/usr/sbin/spamd -- gen_context(system_u:object_r:spamd_exec_t,s0)
+/usr/sbin/spamass-milter -- gen_context(system_u:object_r:spamd_exec_t,s0)
/var/lib/spamassassin(/.*)? gen_context(system_u:object_r:spamd_var_lib_t,s0)
@@ -13,3 +14,4 @@
/var/spool/spamassassin(/.*)? gen_context(system_u:object_r:spamd_spool_t,s0)
/var/spool/spamd(/.*)? gen_context(system_u:object_r:spamd_spool_t,s0)
+/var/spool/postfix/spamass(/.*)? gen_context(system_u:object_r:spamd_var_run_t,s0)
Index: policy/modules/services/spamassassin.if
===================================================================
--- policy/modules/services/spamassassin.if.orig
+++ policy/modules/services/spamassassin.if
@@ -225,3 +225,23 @@
dontaudit $1 spamd_tmp_t:sock_file getattr;
')
+
+########################################
+##
+## Connect to spamd via unix socket
+##
+##
+##
+## Domain to connect
+##
+##
+#
+interface(`spamassassin_connect_unix_sock',`
+ gen_require(`
+ type spamd_t, spamd_var_run_t;
+ ')
+
+ allow $1 spamd_var_run_t:dir search_dir_perms;
+ allow $1 spamd_var_run_t:sock_file write;
+ allow $1 spamd_t:unix_stream_socket connectto;
+')
Index: policy/modules/services/spamassassin.te
===================================================================
--- policy/modules/services/spamassassin.te.orig
+++ policy/modules/services/spamassassin.te
@@ -53,6 +53,7 @@
type spamd_t;
type spamd_exec_t;
init_daemon_domain(spamd_t, spamd_exec_t)
+can_exec(spamd_t, spamc_exec_t)
type spamd_spool_t;
files_type(spamd_spool_t)
@@ -333,6 +334,7 @@
corenet_udp_sendrecv_all_ports(spamd_t)
corenet_tcp_bind_generic_node(spamd_t)
corenet_tcp_bind_spamd_port(spamd_t)
+corenet_tcp_connect_spamd_port(spamd_t)
corenet_tcp_connect_razor_port(spamd_t)
corenet_tcp_connect_smtp_port(spamd_t)
corenet_sendrecv_razor_client_packets(spamd_t)
@@ -421,6 +423,7 @@
optional_policy(`
postfix_read_config(spamd_t)
+ postfix_search_spool(spamd_t)
')
optional_policy(`