diff --git a/mutt/.mailcap b/mutt/.mutt/mailcap similarity index 100% rename from mutt/.mailcap rename to mutt/.mutt/mailcap diff --git a/mutt/mutt-colors-solarized-dark-16.muttrc b/mutt/.mutt/mutt-colors-solarized-dark-16.muttrc similarity index 100% rename from mutt/mutt-colors-solarized-dark-16.muttrc rename to mutt/.mutt/mutt-colors-solarized-dark-16.muttrc diff --git a/mutt/mutt-patch-highlighting.muttrc b/mutt/.mutt/mutt-patch-highlighting.muttrc similarity index 100% rename from mutt/mutt-patch-highlighting.muttrc rename to mutt/.mutt/mutt-patch-highlighting.muttrc diff --git a/mutt/.muttrc b/mutt/.mutt/muttrc similarity index 73% rename from mutt/.muttrc rename to mutt/.mutt/muttrc index f45105a..078e3a8 100644 --- a/mutt/.muttrc +++ b/mutt/.mutt/muttrc @@ -5,8 +5,9 @@ set imap_user = "%GMAIL_LOGIN%" set imap_pass = "%GMAIL_PASS%" # leave blank for prompt set smtp_url = "smtps://$imap_user@smtp.gmail.com:465/" set smtp_pass = "$imap_pass" # leave blank for prompt -set from = "%GMAIL_FROM%" +set from = "%GMAIL_LOGIN%" set realname = "%GMAIL_NAME%" +set signature = "~/.mutt/signature" # Change the following line to a different editor you prefer (and update the Dockerfile accordingly, of course). set editor = "vim" @@ -58,21 +59,21 @@ bind editor complete-query bind editor ^T complete bind editor noop -set mailcap_path = ~/.mailcap +set mailcap_path = ~/.mutt/mailcap # Gmail-style keyboard shortcuts -macro index,pager gi "=INBOX" "Go to Inbox" -macro index,pager ga "=[Gmail]/All Mail" "Go to All Mail" -macro index,pager gs "=[Gmail]/Starred" "Go to Starred" -macro index,pager gd "=[Gmail]/Drafts" "Go to Drafts" -macro index,pager gt "=[Gmail]/Sent Mail" "Go to Sent Mail" - -macro index,pager y "unset resolveunset trashNset resolve" -macro index,pager d "set trash=\"imaps://imap.googlemail.com/[GMail]/Bin\"\n " "Trash" +macro index,pager Gi "=INBOX" "Go to Inbox" +macro index,pager Ga "=[Gmail]/All Mail" "Go to All Mail" +macro index,pager Gd "=[Gmail]/Drafts" "Go to Drafts" +macro index,pager Gs "=[Gmail]/Sent Mail" "Go to Sent Mail" +macro index,pager a "unset resolveunset trashNset resolve" +macro index,pager d ";s+[Gmail]/Trash" "Trash" +macro index,pager u ";s+INBOX" "Move to Inbox" macro index,pager ! =[Gmail]/Spam "Report spam" -macro index,pager + =[Gmail]/Important "Mark as important" +macro index,pager + =[Gmail]/Important "Mark as Important" +macro index,pager * =[Gmail]/Starred "Star Message" # colors -source ~/mutt-colors-solarized-dark-16.muttrc -source ~/mutt-patch-highlighting.muttrc +source ~/.mutt/mutt-colors-solarized-dark-16.muttrc +source ~/.mutt/mutt-patch-highlighting.muttrc diff --git a/mutt/.mutt/signature b/mutt/.mutt/signature new file mode 100644 index 0000000..a17743e --- /dev/null +++ b/mutt/.mutt/signature @@ -0,0 +1,4 @@ + +Jessie Frazelle +4096R / D4C4 DD60 0D66 F65A 8EFC 511E 18F3 685C 0022 BFF3 +http://pgp.mit.edu/pks/lookup?op=get&search=0x18F3685C0022BFF3 diff --git a/mutt/Dockerfile b/mutt/Dockerfile index 5be8bb2..d6fe007 100644 --- a/mutt/Dockerfile +++ b/mutt/Dockerfile @@ -3,7 +3,10 @@ FROM debian:stable RUN groupadd -g 1000 user \ && useradd --create-home -d /home/user -g user -u 1000 user -RUN apt-get update && apt-get install -y ca-certificates git mutt-patched +RUN apt-get update && apt-get install -y \ + ca-certificates \ + git \ + mutt-patched # a browser is necessary! RUN apt-get update && apt-get install -y lynx @@ -26,11 +29,8 @@ RUN git clone https://github.com/jfrazelle/.vim.git $HOME/.vim \ ENV LANG C.UTF-8 COPY entrypoint.sh /entrypoint.sh -COPY .muttrc $HOME/.muttrc -COPY .mailcap $HOME/.mailcap -COPY mutt-colors-solarized-dark-16.muttrc $HOME/mutt-colors-solarized-dark-16.muttrc -COPY mutt-patch-highlighting.muttrc $HOME/mutt-patch-highlighting.muttrc +COPY .mutt $HOME/.mutt ENTRYPOINT ["/entrypoint.sh"] -CMD ["mutt-patched"] +CMD ["mutt-patched", "-F", "~/.mutt/muttrc"] diff --git a/mutt/entrypoint.sh b/mutt/entrypoint.sh index 120e643..4ba0d88 100755 --- a/mutt/entrypoint.sh +++ b/mutt/entrypoint.sh @@ -4,23 +4,19 @@ set -e if [ ! "$GMAIL" ]; then echo >&2 'error: missing GMAIL environment variable' echo >&2 ' try running again with -e GMAIL=your-email@gmail.com' - echo >&2 ' optionally, you can also specify -e GMAIL_FROM=email@your-domain.com' + echo >&2 ' optionally, you can also specify -e GMAIL_PASS' echo >&2 ' and also -e GMAIL_NAME="Your Name"' echo >&2 ' if not specified, both default to the value of GMAIL' exit 1 fi -if [ ! "$GMAIL_FROM" ]; then - GMAIL_FROM="$GMAIL" -fi if [ ! "$GMAIL_NAME" ]; then - GMAIL_NAME="$GMAIL_FROM" + GMAIL_NAME="$GMAIL" fi -sed -i "s/%GMAIL_LOGIN%/$GMAIL/g" "$HOME/.muttrc" -sed -i "s/%GMAIL_FROM%/$GMAIL_FROM/g" "$HOME/.muttrc" -sed -i "s/%GMAIL_NAME%/$GMAIL_NAME/g" "$HOME/.muttrc" -sed -i "s/%GMAIL_PASS%/$GMAIL_PASS/g" "$HOME/.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_PASS%/$GMAIL_PASS/g" "$HOME/.mutt/muttrc" if [ -d "$HOME/.gnupg" ]; then { @@ -37,7 +33,7 @@ if [ -d "$HOME/.gnupg" ]; then fi if [ -e "$HOME/.muttrc.local" ]; then - echo "source $HOME/.muttrc.local" >> "$HOME/.muttrc" + echo "source $HOME/.muttrc.local" >> "$HOME/.mutt/muttrc" fi exec "$@"