From ca315bf9c292d4757b67a86117e3182c1b0dd680 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 12 Dec 2014 14:28:47 +0100 Subject: Import postfix/mailman from rad --- roles/mailman/files/dump_mailman.sh | 10 ++++++++++ roles/mailman/files/fix_ansible.conf | 5 +++++ roles/mailman/files/update_templates_mailman.sh | 16 ++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 roles/mailman/files/dump_mailman.sh create mode 100644 roles/mailman/files/fix_ansible.conf create mode 100644 roles/mailman/files/update_templates_mailman.sh (limited to 'roles/mailman/files') diff --git a/roles/mailman/files/dump_mailman.sh b/roles/mailman/files/dump_mailman.sh new file mode 100644 index 0000000..4626e31 --- /dev/null +++ b/roles/mailman/files/dump_mailman.sh @@ -0,0 +1,10 @@ +#!/bin/bash +DIR=/var/backups/mailman/ +[ -d $DIR ] || mkdir -p $DIR + +for i in $(/usr/lib/mailman/bin/list_lists -b); do + for j in admins members owners; do + /usr/lib/mailman/bin/list_${j} > $DIR/${i}.${j} + done + /usr/lib/mailman/bin/config_list -o $DIR/${i}.config ${i} +done diff --git a/roles/mailman/files/fix_ansible.conf b/roles/mailman/files/fix_ansible.conf new file mode 100644 index 0000000..036fa8e --- /dev/null +++ b/roles/mailman/files/fix_ansible.conf @@ -0,0 +1,5 @@ +[Service] +ExecStop= +ExecStop=/usr/lib/mailman/bin/mailman-update-cfg +ExecStop=/usr/lib/mailman/bin/mailmanctl stop +ExecStop=/bin/sh -c 'echo -e "# Master copy is /usr/lib/mailman/cron/crontab.in" > /etc/cron.d/mailman' diff --git a/roles/mailman/files/update_templates_mailman.sh b/roles/mailman/files/update_templates_mailman.sh new file mode 100644 index 0000000..1e954ce --- /dev/null +++ b/roles/mailman/files/update_templates_mailman.sh @@ -0,0 +1,16 @@ +#!/bin/bash +GIT_URL=$1 +CACHE_DIR=/var/cache/mailman_templates + +if [ ! -d $CACHE_DIR ]; then + git clone $GIT_URL /var/cache/mailman_templates + cd $CACHE_DIR +else + cd $CACHE_DIR + # on EL6, git is not respecting -q, unlike Fedora + git pull --rebase -q >/dev/null +fi +cp -R * /var/lib/mailman/lists/ +rm -f /var/lib/mailman/lists/README.md +chown -R apache:mailman /var/lib/mailman/lists/ + -- cgit