Skip to content

Instantly share code, notes, and snippets.

@psychoticbeef
Created September 28, 2016 08:17
Show Gist options
  • Save psychoticbeef/b622810c5af174624fc5092f8b527e95 to your computer and use it in GitHub Desktop.
Save psychoticbeef/b622810c5af174624fc5092f8b527e95 to your computer and use it in GitHub Desktop.
create standard RFC mailboxes in cyrus-imap and set proper permissions
#!/bin/bash
FOLDERS=( "" .Archive .Drafts .Flagged .Junk .Sent )
LOGIN=$1
BOSS=$2
CEO=
ACL_CYRUS=lrswipcda
ACL_SELF=lrswipkxtecd
ACL_BOSS=lrswipkxtecd
ACL_CEO=lrswipkxtecd
CMD=""
for folder in "${FOLDERS[@]}"
do
CMD="${CMD}
cm user.${LOGIN}${folder}
sam user.${LOGIN}${folder} cyrus ${ACL_CYRUS}
sam user.${LOGIN}${folder} ${LOGIN} ${ACL_SELF}
sam user.${LOGIN}${folder} ${CEO} ${ACL_CEO}"
if [ -n "${BOSS}" ] ; then
CMD="${CMD}
sam user.${LOGIN}${folder} ${BOSS} ${ACL_BOSS}"
fi
done
echo "${CMD}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment