full msmtprc compatibility added

This commit is contained in:
Luke Smith 2018-08-21 14:38:20 -04:00
parent 8ba05e8ee8
commit 810c7710f0
4 changed files with 18 additions and 7 deletions

6
autoconf/msmtprc_header Normal file
View File

@ -0,0 +1,6 @@
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log

7
autoconf/msmtprc_profile Normal file
View File

@ -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\'"

View File

@ -2,7 +2,6 @@
# muttrc file for account $title # muttrc file for account $title
set realname = "$realname" set realname = "$realname"
set from = "$fulladdr" set from = "$fulladdr"
set smtp_url = "smtp://$login@$smtp:$sport/"
set sendmail = "/usr/bin/msmtp -a $title" set sendmail = "/usr/bin/msmtp -a $title"
set folder = "~/.mail/$title" set folder = "~/.mail/$title"
set header_cache = ~/.config/mutt/accounts/$title/cache/headers set header_cache = ~/.config/mutt/accounts/$title/cache/headers

View File

@ -1,11 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ "$(uname)" == "Darwin" ]] [ "$(uname)" == "Darwin" ] && os=".macos"
then
os=".macos"
else
os=""
fi
muttdir="$HOME/.config/mutt/" muttdir="$HOME/.config/mutt/"
@ -199,6 +194,10 @@ addAccount() {
cat "$muttdir"autoconf/offlineimap_profile"$os" | sed -e "$replacement" >> ~/.offlineimaprc cat "$muttdir"autoconf/offlineimap_profile"$os" | sed -e "$replacement" >> ~/.offlineimaprc
mkdir -p ~/.mail/$title 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. # Add the mutt profile.
cat "$muttdir"autoconf/mutt_profile | sed -e "$replacement" > "$muttdir"accounts/$title.muttrc cat "$muttdir"autoconf/mutt_profile | sed -e "$replacement" > "$muttdir"accounts/$title.muttrc
# Add a numbered shortcut in the muttrc # Add a numbered shortcut in the muttrc