mu-wizard

shell script to easily configure mu4e accounts on Emacs
git clone git://git.ckyln.com/~cem/mu-wizard
Log | Files | Refs | LICENSE

commit 79d8f5f9b8effee9ee2d6e49cb6ee1311869c413
parent 6cef8c40d35420dcace6530acc88850efd7af0c8
Author: Cem Keylan <cem@ckyln.com>
Date:   Sun, 26 Jul 2020 02:25:57 +0300

mu-wizard: add initial support for overrides

Diffstat:
Mbin/muw | 17+++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/bin/muw b/bin/muw @@ -131,7 +131,7 @@ Host $imap Port $iport User $login PassCmd "$password_command" -SSLType IMAPS +SSLType $ssltype CertificateFile $sslcert MaildirStore $title-local @@ -202,7 +202,19 @@ get_information() { prompt "Insert the email address that you want to configure for mu4e" "Email" read -r fulladdr - while IFS=, read -r domain imap iport smtp sport; do + # Check the override directory for possible alterations of the + # configuration. If the override is found on the configuration dirctory, it + # will be used instead. + for file in "$confdir/overrides/"* "$sharedir/overrides/"*; do + [ -f "$sharedir/overrides/${fulladdr##*@}" ] && { + domain=${fulladdr##*@} + # shellcheck disable=1090 + . "$sharedir/overrides/$domain" + break + } + done + + [ "$domain" ] || while IFS=, read -r domain imap iport smtp sport; do case "$domain" in "${fulladdr##*@}") break; esac done < "$confdir/domains.csv" @@ -254,6 +266,7 @@ main() { command -v mbsync >/dev/null || die "mbsync must be installed for mu-wizard to work." sharedir=/usr/share/mu-wizard + ssltype=IMAPS mkdir -p "${config_home:=${XDG_CONFIG_HOME:-$HOME/.config}}" \ "${confdir:=$config_home/mu4e}" \