blob: 956a4b215decb31083d028fd8ab5c960c81fda5e (
plain)
- #!/bin/sh
- set -e
- cfgdir="/etc/local-ORG/mailman"
- sharedir="/etc/local-COMMON/mailman"
- skeldir="$sharedir/skel"
- MAILDOMAIN="${maildomain:-`head -n 1 /etc/mailname`}"
- LISTDOMAIN="$listdomain"
- LISTWEBDOMAIN="$listwebdomain"
- OWNER="${owner:-listmaster@$MAILDOMAIN}"
- LISTLANG="${lang:-en}"
- refreshlists() {
- existinglists="`/usr/sbin/list_lists -b`"
- }
- mklist() {
- list_anycase="$1"; shift
- type="$1"; shift
- desc="$1"; shift
- senders="$1"; shift
- list=$(printf %s "$list_anycase" | tr '[:upper:]' '[:lower:]')
- lang="${1:-$LISTLANG}"
- owner="${2:-$OWNER}"
- emailhost="${3:-$LISTDOMAIN}"
- urlhost="${4:-${LISTWEBDOMAIN:-$emailhost}}"
- if ! echo "$existinglists" | grep -q "^$list\$"; then
- newlist -l "$lang"${urlhost:+ -u "$urlhost"}${emailhost:+ -e "$emailhost"} -q "$list" "$owner" "`gpw | head -n 1`"
- fi
- LISTNAME="$list_anycase" LISTDESC="$desc" SENDERS="$senders" LISTOWNER="$owner" LISTHOST="$emailhost" "$sharedir/mklist.pl" "$skeldir/$type.$lang.py" > "$list.py"
- config_list -i "$cfgdir/$list.py" "$list"
- config_list -o "$cfgdir/$list.py" "$list"
- }
- populatelist() {
- list=$(printf %s "$1" | tr '[:upper:]' '[:lower:]'); shift
- [ ! -s "$cfgdir/$list.members" ] || add_members -r "$cfgdir/$list.members" -w n -a n "$list"
- [ ! -s "$cfgdir/$list.members-digest" ] || add_members -d "$cfgdir/$list.members-digest" -w n -a n "$list"
- [ -z "$*" ] || localuserinfo --custom='%fullname% <%mailaddress%>' "$@" | add_members -r - -w n -a n "$list"
- list_members --fullnames --preserve --regular -o "$cfgdir/$list.members" "$list"
- list_members --fullnames --preserve --digest -o "$cfgdir/$list.members-digest" "$list"
- }
|