summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoconf/msmtprc_header6
-rw-r--r--autoconf/msmtprc_profile7
-rw-r--r--autoconf/mutt_profile1
-rwxr-xr-xmutt-wizard.sh11
4 files changed, 18 insertions, 7 deletions
diff --git a/autoconf/msmtprc_header b/autoconf/msmtprc_header
new file mode 100644
index 0000000..8040e03
--- /dev/null
+++ b/autoconf/msmtprc_header
@@ -0,0 +1,6 @@
+defaults
+auth on
+tls on
+tls_trust_file /etc/ssl/certs/ca-certificates.crt
+logfile ~/.msmtp.log
+
diff --git a/autoconf/msmtprc_profile b/autoconf/msmtprc_profile
new file mode 100644
index 0000000..0ec99d0
--- /dev/null
+++ b/autoconf/msmtprc_profile
@@ -0,0 +1,7 @@
+
+account $title
+host $smtp
+port $sport
+from $login
+user $login
+passwordeval "gpg -d --quiet --for-your-eyes-only --no-tty ~/.config/mutt/credentials/$title.gpg | sed -e '$a\'"
diff --git a/autoconf/mutt_profile b/autoconf/mutt_profile
index 3b4622b..a96c93a 100644
--- a/autoconf/mutt_profile
+++ b/autoconf/mutt_profile
@@ -2,7 +2,6 @@
# muttrc file for account $title
set realname = "$realname"
set from = "$fulladdr"
-set smtp_url = "smtp://$login@$smtp:$sport/"
set sendmail = "/usr/bin/msmtp -a $title"
set folder = "~/.mail/$title"
set header_cache = ~/.config/mutt/accounts/$title/cache/headers
diff --git a/mutt-wizard.sh b/mutt-wizard.sh
index e69effa..be166b4 100755
--- a/mutt-wizard.sh
+++ b/mutt-wizard.sh
@@ -1,11 +1,6 @@
#!/usr/bin/env bash
-if [[ "$(uname)" == "Darwin" ]]
-then
- os=".macos"
-else
- os=""
-fi
+[ "$(uname)" == "Darwin" ] && os=".macos"
muttdir="$HOME/.config/mutt/"
@@ -199,6 +194,10 @@ addAccount() {
cat "$muttdir"autoconf/offlineimap_profile"$os" | sed -e "$replacement" >> ~/.offlineimaprc
mkdir -p ~/.mail/$title
+ # Creating msmtprc if it doesn't exist already.
+ if [ ! -f ~/.msmtprc ]; then cp "$muttdir"autoconf/msmtprc_header ~/.msmtprc; fi
+ cat "$muttdir"autoconf/msmtprc_profile | sed -e "$replacement" >> ~/.msmtprc
+
# Add the mutt profile.
cat "$muttdir"autoconf/mutt_profile | sed -e "$replacement" > "$muttdir"accounts/$title.muttrc
# Add a numbered shortcut in the muttrc