summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-02-16 13:14:02 -0500
committerGitHub <noreply@github.com>2019-02-16 13:14:02 -0500
commit76cd73a11e037cde8131e5f645d70522f0e4a6c9 (patch)
treee9f3e1832326eaf868435ce29b51595e77399e8b
parent38632ee4ea03f0fed52baaa69c40ac22c0b117f2 (diff)
parent8e11d7fff48b80678b01c334670c3e2dfc1b7b92 (diff)
Merge pull request #123 from krimha/bugfix-msmtprc
Implement deletion of accounts from .msmtprc
-rwxr-xr-xmutt-wizard.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/mutt-wizard.sh b/mutt-wizard.sh
index 72b1cd9..1757a90 100755
--- a/mutt-wizard.sh
+++ b/mutt-wizard.sh
@@ -127,7 +127,9 @@ removeAccount() { sed -ie "
rm "$muttdir"/accounts/$1.muttrc
rm "$muttdir"/credentials/$1.gpg
rm -rf "$muttdir"/accounts/$1
- sed -i "/$1.muttrc/d" "$muttdir"/personal.muttrc ;}
+ sed -i "/$1.muttrc/d" "$muttdir"/personal.muttrc
+ # Delete from the line matching the account name, until the next account or empty line
+ sed -i "/account $1/,/^\(\s*$\|account\)/d" ~/.msmtprc ;}
manual() { \
imap=$( dialog --inputbox "Insert the IMAP server for your email provider (excluding the port number)" 10 60 3>&1 1>&2 2>&3 3>&- )