update mutt

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
Jessica Frazelle 2015-10-06 13:23:39 -07:00
parent d0e35188be
commit 6bf6f26787
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
2 changed files with 38 additions and 25 deletions

View File

@ -3,7 +3,7 @@
# Change the following six lines to match your Gmail account details # Change the following six lines to match your Gmail account details
set imap_user = "%GMAIL_LOGIN%" set imap_user = "%GMAIL_LOGIN%"
set imap_pass = "%GMAIL_PASS%" # leave blank for prompt set imap_pass = "%GMAIL_PASS%" # leave blank for prompt
set smtp_url = "smtps://$imap_user@smtp.gmail.com:465/" set smtp_url = "smtps://$imap_user@%SMTP_SERVER%:465/"
set smtp_pass = "$imap_pass" # leave blank for prompt set smtp_pass = "$imap_pass" # leave blank for prompt
set from = "%GMAIL_FROM%" set from = "%GMAIL_FROM%"
set realname = "%GMAIL_NAME%" set realname = "%GMAIL_NAME%"
@ -30,7 +30,7 @@ bind pager <down> next-line
set resolve = no # uh, don't randomly take me to other messages when I do things set resolve = no # uh, don't randomly take me to other messages when I do things
# Basic config, you can leave this as is # Basic config, you can leave this as is
set folder = "imaps://imap.gmail.com:993" set folder = "imaps://%IMAP_SERVER%"
set spoolfile = "+INBOX" set spoolfile = "+INBOX"
set imap_check_subscribed set imap_check_subscribed
set hostname = gmail.com set hostname = gmail.com
@ -50,14 +50,6 @@ set sort = 'reverse-threads'
set sort_aux = 'last-date-received' set sort_aux = 'last-date-received'
set auto_tag = yes set auto_tag = yes
# sane gpg settings to be a good encryption
# social citizen of the world
set pgp_replyencrypt # auto encrypt replies to encrypted mail
set pgp_replysign # auto sign replies to signed mail
set pgp_replysignencrypted # auto sign & encrypt to signed & encrypted mail
set pgp_show_unusable=no # show which keys are no good anymore
set pgp_autosign # auto sign emails
ignore "Authentication-Results:" ignore "Authentication-Results:"
ignore "DomainKey-Signature:" ignore "DomainKey-Signature:"
ignore "DKIM-Signature:" ignore "DKIM-Signature:"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -e
if [ ! "$GMAIL" ]; then if [[ -z "$GMAIL" ]]; then
echo >&2 'error: missing GMAIL environment variable' echo >&2 'error: missing GMAIL environment variable'
echo >&2 ' try running again with -e GMAIL=your-email@gmail.com' echo >&2 ' try running again with -e GMAIL=your-email@gmail.com'
echo >&2 ' optionally, you can also specify -e GMAIL_PASS' echo >&2 ' optionally, you can also specify -e GMAIL_PASS'
@ -10,34 +10,55 @@ if [ ! "$GMAIL" ]; then
exit 1 exit 1
fi fi
if [ ! "$GMAIL_NAME" ]; then if [[ -z "$GMAIL_NAME" ]]; then
GMAIL_NAME="$GMAIL" GMAIL_NAME="$GMAIL"
fi fi
if [ ! "$GMAIL_FROM" ]; then if [[ -z "$GMAIL_FROM" ]]; then
GMAIL_FROM="$GMAIL" GMAIL_FROM="$GMAIL"
fi fi
if [[ -z "$IMAP_SERVER" ]]; then
IMAP_SERVER="imap.gmail.com:993"
fi
if [[ -z "$SMTP_SERVER" ]]; then
SMTP_SERVER="smtp.gmail.com"
fi
sed -i "s/%GMAIL_LOGIN%/$GMAIL/g" "$HOME/.mutt/muttrc" sed -i "s/%GMAIL_LOGIN%/$GMAIL/g" "$HOME/.mutt/muttrc"
sed -i "s/%GMAIL_NAME%/$GMAIL_NAME/g" "$HOME/.mutt/muttrc" sed -i "s/%GMAIL_NAME%/$GMAIL_NAME/g" "$HOME/.mutt/muttrc"
sed -i "s/%GMAIL_PASS%/$GMAIL_PASS/g" "$HOME/.mutt/muttrc" sed -i "s/%GMAIL_PASS%/$GMAIL_PASS/g" "$HOME/.mutt/muttrc"
sed -i "s/%GMAIL_FROM%/$GMAIL_FROM/g" "$HOME/.mutt/muttrc" sed -i "s/%GMAIL_FROM%/$GMAIL_FROM/g" "$HOME/.mutt/muttrc"
sed -i "s/%IMAP_SERVER%/$IMAP_SERVER/g" "$HOME/.mutt/muttrc"
sed -i "s/%SMTP_SERVER%/$SMTP_SERVER/g" "$HOME/.mutt/muttrc"
if [ -d "$HOME/.gnupg" ]; then if [[ -d "$HOME/.gnupg" ]]; then
# sane gpg settings to be a good encryption
# social citizen of the world
{ {
echo echo
echo 'source /usr/share/doc/mutt/examples/gpg.rc' echo 'source /usr/share/doc/mutt/examples/gpg.rc'
echo 'set pgp_use_gpg_agent = yes' if [[ ! -z "$GPG_ID" ]]; then
if [ "$GPG_ID" ]; then
echo "set pgp_sign_as = $GPG_ID" echo "set pgp_sign_as = $GPG_ID"
fi fi
echo 'set crypt_replysign=yes' echo 'set crypt_replysign=yes'
echo 'set crypt_replysignencrypted=yes' echo 'set crypt_replysignencrypted=yes'
echo 'set crypt_verify_sig=yes' echo 'set crypt_verify_sig=yes'
} >> "$HOME/.muttrc" # auto encrypt replies to encrypted mail
echo 'set pgp_replyencrypt=yes'
# auto sign replies to signed mail
echo 'set pgp_replysign=yes'
# auto sign & encrypt to signed & encrypted mail
echo 'set pgp_replysignencrypted=yes'
# show which keys are no good anymore
echo 'set pgp_show_unusable=no'
# auto sign emails
echo 'set pgp_autosign=yes'
} >> "$HOME/.mutt/muttrc"
fi fi
if [ -e "$HOME/.muttrc.local" ]; then if [[ -e "$HOME/.muttrc.local" ]]; then
echo "source $HOME/.muttrc.local" >> "$HOME/.mutt/muttrc" echo "source $HOME/.muttrc.local" >> "$HOME/.mutt/muttrc"
fi fi