roles-lists: Initial version of role
Add support for archiving mailing lists from roles.
This commit is contained in:
parent
cb4292f5d0
commit
32e4f82ff2
5 changed files with 89 additions and 0 deletions
27
roles/roles-lists/files/archiver.sh
Executable file
27
roles/roles-lists/files/archiver.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
function err {
|
||||
echo "$*" | mail -s "archiver: mail archiving failed" root
|
||||
exit 1
|
||||
}
|
||||
|
||||
_group=$1
|
||||
_list=$2
|
||||
|
||||
if [ -z "$_group" ] || [ -z "$_list" ]; then
|
||||
echo "Usage: $(basename "$0") <group> <list>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
_dir="/roles/${_group}/library/archive/${_list}"
|
||||
_mbox="${_dir}/$(date +%Y-%m)"
|
||||
|
||||
if [ ! -d "$_dir" ]; then
|
||||
if ! mkdir -p "$_dir" ; then
|
||||
err "ERROR: Failed to create archive directory '${_dir}'"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! "/usr/bin/spamc" >> "${_mbox}" ; then
|
||||
err "ERROR: Failed to archive mail into '${_mbox}'"
|
||||
fi
|
BIN
roles/roles-lists/files/sendmail-spamc.pp
Normal file
BIN
roles/roles-lists/files/sendmail-spamc.pp
Normal file
Binary file not shown.
14
roles/roles-lists/files/sendmail-spamc.te
Normal file
14
roles/roles-lists/files/sendmail-spamc.te
Normal file
|
@ -0,0 +1,14 @@
|
|||
|
||||
module sendmail-spamc 1.0;
|
||||
|
||||
require {
|
||||
type spamc_exec_t;
|
||||
type sendmail_t;
|
||||
class file { execute execute_no_trans getattr map open read };
|
||||
}
|
||||
|
||||
#============= sendmail_t ==============
|
||||
|
||||
#!!!! This avc can be allowed using the boolean 'domain_can_mmap_files'
|
||||
allow sendmail_t spamc_exec_t:file map;
|
||||
allow sendmail_t spamc_exec_t:file { execute execute_no_trans getattr open read };
|
Loading…
Add table
Add a link
Reference in a new issue