Skip to content

Instantly share code, notes, and snippets.

@limed
Created March 19, 2014 22:55
Show Gist options
  • Select an option

  • Save limed/9653173 to your computer and use it in GitHub Desktop.

Select an option

Save limed/9653173 to your computer and use it in GitHub Desktop.
Create calendar resources in zimbra that is set to forward to a mailman serer
#!/bin/bash
IAM=`id -un`
if [ "$IAM" != "zimbra" ]; then
echo "You must run this script as the 'zimbra' user. Please 'su - zimbra' first."
exit 1
fi
randpw(){ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16}; echo; }
password=`randpw`
listname=$1
# Config values
transport='mailman3.mail.corp.phx1.mozilla.com'
ALIASES="
${listname}@mozilla.com
${listname}[email protected]
${listname}[email protected]
${listname}[email protected]
${listname}[email protected]
${listname}[email protected]
${listname}[email protected]
${listname}[email protected]
${listname}[email protected]
${listname}[email protected]
"
if [[ -z $listname ]]; then
echo "Usage: ./$0 <listname>"
exit 1
fi
for name in $ALIASES; do
echo "ccr $name $password displayName '$name mailman mailing list' zimbraCalResType Location zimbraMailTransport smtp:$transport:25";
done | zmprov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment