#!/bin/bash # Description: Email syncing tools plus the mu4e client set -e __MAXMESSAGES=100 function __certificatefile { for path in \ /usr/local/etc/ssl \ /usr/local/etc/openssl \ /usr/local/etc/openssl@1.1 \ /etc/ssl \ /etc/openssl \ ; do for certfile in \ cert.pem \ certs/ca-certificates.crt \ ; do if test -f "${path}/${certfile}"; then echo "${path}/${certfile}" return fi done done } function __mbsync_config { cat > ${HOME}/.mbsyncrc </dev/null echo "[tgz] Fetching mu" curl -sL https://github.com/djcb/mu/archive/master.tar.gz \ | tar xz --strip 1 && \ echo "[tgz] Configuring mu" && \ ./autogen.sh >/dev/null 2>&1 && \ ./configure --prefix=/usr >/dev/null 2>&1 && \ echo "[tgz] Building mu" && \ make >/dev/null 2>&1 && \ echo "[tgz] Installing mu" && \ sudo make install >/dev/null 2>&1 popd >/dev/null rm -rf "$dir" ;; esac _run "[email] Creating mail directories" mkdir -p ${HOME}/Mail/{Personal,Work,.attachments} _run "[email] Configuring mbsync" __mbsync_config _run "[email] Initializing mail database" mu init -m Mail \ --my-address=correl@gmail.com \ --my-address=correlr@aweber.com \ --my-address=correlr@aweber.net _run "[email] Indexing mail" mu index _recipe nvm _npm imapnotify