Chris PeBenito 17de1b
## <summary>Qmail Mail Server</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Template for qmail parent/sub-domain pairs
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="child_prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the child domain
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="parent_domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The name of the parent domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`qmail_child_domain_template',`
Chris PeBenito 17de1b
	type $1_t;
Chris PeBenito 17de1b
	domain_type($1_t)
Chris PeBenito 17de1b
	type $1_exec_t;
Chris PeBenito 0bfccd
	domain_entry_file($1_t, $1_exec_t)
Chris PeBenito 17de1b
	domain_auto_trans($2, $1_exec_t, $1_t)
Chris PeBenito 17de1b
	role system_r types $1_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_t self:process signal_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_t $2:fd use;
Chris PeBenito 17de1b
	allow $1_t $2:fifo_file rw_file_perms;
Chris PeBenito 17de1b
	allow $1_t $2:process sigchld;
Chris PeBenito 17de1b
Chris PeBenito 82d277
	allow $1_t qmail_etc_t:dir list_dir_perms;
Chris PeBenito 82d277
	allow $1_t qmail_etc_t:file read_file_perms;
Chris PeBenito 82d277
	allow $1_t qmail_etc_t:lnk_file read_lnk_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_t qmail_start_t:fd use;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	kernel_list_proc($2)
Chris PeBenito 17de1b
	kernel_read_proc_symlinks($2)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_getattr_xattr_fs($1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	miscfiles_read_localization($1_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Transition to qmail_inject_t
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`qmail_domtrans_inject',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 0bfccd
		type qmail_inject_t, qmail_inject_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1, qmail_inject_exec_t, qmail_inject_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	ifdef(`distro_debian',`
Chris PeBenito 17de1b
		files_search_usr($1)
Chris PeBenito 8021cb
		corecmd_search_bin($1)
Chris PeBenito 17de1b
	',`
Chris PeBenito 17de1b
		files_search_var($1)
Chris PeBenito 17de1b
		corecmd_search_bin($1)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Transition to qmail_queue_t
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`qmail_domtrans_queue',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 0bfccd
		type qmail_queue_t, qmail_queue_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1, qmail_queue_exec_t, qmail_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	ifdef(`distro_debian',`
Chris PeBenito 17de1b
		files_search_usr($1)
Chris PeBenito 8021cb
		corecmd_search_bin($1)
Chris PeBenito 17de1b
	',`
Chris PeBenito 17de1b
		files_search_var($1)
Chris PeBenito 17de1b
		corecmd_search_bin($1)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read qmail configuration files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`qmail_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type qmail_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 82d277
	allow $1 qmail_etc_t:dir list_dir_perms;
Chris PeBenito 82d277
	allow $1 qmail_etc_t:file read_file_perms;
Chris PeBenito 82d277
	allow $1 qmail_etc_t:lnk_file read_lnk_file_perms;
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	ifdef(`distro_debian',`
Chris PeBenito 17de1b
		# handle /etc/qmail
Chris PeBenito 17de1b
		files_search_etc($1)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Define the specified domain as a qmail-smtp service. 
Chris PeBenito 17de1b
##	Needed by antivirus/antispam filters.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="entrypoint">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type associated with the process program.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`qmail_smtpd_service_domain',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type qmail_smtpd_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
	domtrans_pattern(qmail_smtpd_t, $2, $1)
Chris PeBenito 17de1b
')