diff --git a/mutt/.muttrc b/mutt/.muttrc index 23a0b45..f45105a 100644 --- a/mutt/.muttrc +++ b/mutt/.muttrc @@ -3,17 +3,11 @@ # Change the following six lines to match your Gmail account details set imap_user = "%GMAIL_LOGIN%" set imap_pass = "%GMAIL_PASS%" # leave blank for prompt -set smtp_url = "smtp://$imap_user@smtp.gmail.com:587" -set smtp_pass = "$imap_pass" +set smtp_url = "smtps://$imap_user@smtp.gmail.com:465/" +set smtp_pass = "$imap_pass" # leave blank for prompt set from = "%GMAIL_FROM%" set realname = "%GMAIL_NAME%" -# activate TLS if available on the server -set ssl_starttls=yes - -# always use SSL when connecting to a server -set ssl_force_tls=yes - # Change the following line to a different editor you prefer (and update the Dockerfile accordingly, of course). set editor = "vim" @@ -37,9 +31,9 @@ set folder = "imaps://imap.gmail.com:993" set spoolfile = "+INBOX" set imap_check_subscribed set hostname = gmail.com +set mail_check = 60 set timeout = 300 set imap_keepalive = 300 -set mail_check = 60 set postponed = "+[Gmail]/Drafts" set record = "" # gmail automatically handles saving sent emails @@ -64,7 +58,7 @@ bind editor complete-query bind editor ^T complete bind editor noop -set mailcap_path = ~/.mailcap +set mailcap_path = ~/.mailcap # Gmail-style keyboard shortcuts macro index,pager gi "=INBOX" "Go to Inbox" @@ -80,5 +74,5 @@ macro index,pager ! =[Gmail]/Spam "Report spam" macro index,pager + =[Gmail]/Important "Mark as important" # colors -source /home/user/mutt-colors-solarized-dark-16.muttrc -source /home/user/mutt-patch-highlighting.muttrc +source ~/mutt-colors-solarized-dark-16.muttrc +source ~/mutt-patch-highlighting.muttrc diff --git a/mutt/Dockerfile b/mutt/Dockerfile index d2677a2..5be8bb2 100644 --- a/mutt/Dockerfile +++ b/mutt/Dockerfile @@ -1,31 +1,36 @@ -FROM debian:jessie +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 \ - lynx \ - mutt-patched \ - vim-nox \ - --no-install-recommends +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 ENV BROWSER lynx -ENV TERM xterm-256color -ENV HOME /home/user +# my preferred editor :) (see also muttrc) +RUN apt-get update && apt-get install -y vim-nox + USER user - +ENV HOME /home/user +ENV TERM xterm-256color RUN mkdir -p $HOME/.mutt/cache/headers $HOME/.mutt/cache/bodies \ - && touch $HOME/.mutt/certificates \ - && git clone https://github.com/jfrazelle/.vim.git $HOME/.vim \ + && touch $HOME/.mutt/certificates + +# vim settings +RUN git clone https://github.com/jfrazelle/.vim.git $HOME/.vim \ && git clone https://github.com/altercation/vim-colors-solarized $HOME/.vim/bundle/vim-colors-solarized \ && cp $HOME/.vim/vimrc.txt $HOME/.vimrc ENV LANG C.UTF-8 -COPY . $HOME/ +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 + +ENTRYPOINT ["/entrypoint.sh"] -ENTRYPOINT ["/home/user/entrypoint.sh"] CMD ["mutt-patched"] diff --git a/mutt/entrypoint.sh b/mutt/entrypoint.sh index cb7aee8..120e643 100755 --- a/mutt/entrypoint.sh +++ b/mutt/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -if [[ ! "$GMAIL" ]]; then +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' @@ -10,10 +10,10 @@ if [[ ! "$GMAIL" ]]; then exit 1 fi -if [[ ! "$GMAIL_FROM" ]]; then +if [ ! "$GMAIL_FROM" ]; then GMAIL_FROM="$GMAIL" fi -if [[ ! "$GMAIL_NAME" ]]; then +if [ ! "$GMAIL_NAME" ]; then GMAIL_NAME="$GMAIL_FROM" fi @@ -22,12 +22,12 @@ 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" -if [[ -d "$HOME/.gnupg" ]]; then +if [ -d "$HOME/.gnupg" ]; then { echo echo 'source /usr/share/doc/mutt/examples/gpg.rc' echo 'set pgp_use_gpg_agent = yes' - if [[ "$GPG_ID" ]]; then + if [ "$GPG_ID" ]; then echo "set pgp_sign_as = $GPG_ID" fi echo 'set crypt_replysign = yes' @@ -36,7 +36,7 @@ if [[ -d "$HOME/.gnupg" ]]; then } >> "$HOME/.muttrc" fi -if [[ -e "$HOME/.muttrc.local" ]]; then +if [ -e "$HOME/.muttrc.local" ]; then echo "source $HOME/.muttrc.local" >> "$HOME/.muttrc" fi