X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=2f4a726b273604200501dcd817a680ff9030ae9b;hb=af37f71b1c4e1dfa9ebe9a270f4b839cd742cad5;hp=c3b11d8109ea7577b1d2315f7e55104af8180bba;hpb=b857462732e15f455e41f26e3048a390d7b399c0;p=distro-setup diff --git a/mail-setup b/mail-setup index c3b11d8..2f4a726 100755 --- a/mail-setup +++ b/mail-setup @@ -15,10 +15,18 @@ set -x # See the License for the specific language governing permissions and # limitations under the License. +# todo: make quick backups of maildir, or deliver to multiple hosts. + set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@" +if [[ ! $SUDO_USER ]]; then + echo "$0: error: requires running as nonroot or sudo" + exit 1 +fi +u=$SUDO_USER + usage() { cat <$exim_main_dir/000_localmacros </etc/exim4/conf.d/main/000_localmacros <