Skip to content

Commit

Permalink
Add a mutt container
Browse files Browse the repository at this point in the history
This is a little specialized to my setup, though
  • Loading branch information
d3zd3z committed Feb 21, 2018
1 parent 1f77add commit 0cde4ec
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mutt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM davidb/devel:alpine
MAINTAINER David Brown <[email protected]>

RUN apk update && \
apk add mutt w3m
COPY bin/* /usr/bin/
COPY mailcap /etc/mailcap
24 changes: 24 additions & 0 deletions mutt/bin/box
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /usr/bin/env python3

import os.path
import sys
from subprocess import check_call

# Invoke mutt nicely on the given folder.

def main():
rc = os.path.expanduser("~/.mutt/davidb")
folder = '='

if len(sys.argv) >= 2:
folder = "=" + sys.argv[1]

if sys.argv[1] == "all":
folder = "=[Gmail]/All Mail"
elif sys.argv[1] == "starred":
folder = "=[Gmail]/Starred"

check_call(['mutt', "-F", rc, "-f", folder])

if __name__ == '__main__':
main()
24 changes: 24 additions & 0 deletions mutt/bin/lbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /usr/bin/env python3

import os.path
import sys
from subprocess import check_call

# Invoke mutt nicely on the given folder.

def main():
rc = os.path.expanduser("~/.mutt/linaro")
folder = '='

if len(sys.argv) >= 2:
folder = "=" + sys.argv[1]

if sys.argv[1] == "all":
folder = "=[Gmail]/All Mail"
elif sys.argv[1] == "starred":
folder = "=[Gmail]/Starred"

check_call(['mutt', "-F", rc, "-f", folder])

if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions mutt/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

docker build -t davidb/mutt:latest .
29 changes: 29 additions & 0 deletions mutt/enter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/bash

# Start the 'asme' container to run as the current user in the current
# directory.

# The bind volumes should probably be changed to be broader than just
# the current example, but this case does work.
#
# You may want to bind your home directory, or at least things like
# ~/.ssh:~/.ssh:ro

container=davidb/mutt

docker run --rm -ti \
-v "${HOME}/Sync/dotfiles/mutt:${HOME}/.mutt:ro" \
-v "${HOME}/.docker-mutt-cache:${HOME}/.mutt-cache" \
-v "${HOME}/.mutt_certificates:${HOME}/.mutt_certificates" \
-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK:ro \
-e USER=$USER \
-e HOME=$HOME \
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \
-e UID=$(id -u) \
-e GID=$(id -g) \
-w $(pwd) \
$container \
bash -l \
"$@"

# -v "$(pwd):$(pwd)" \
1 change: 1 addition & 0 deletions mutt/mailcap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
text/html; /usr/bin/w3m -o display_link_number=true -I %{charset} -dump -T text/html %s; copiousoutput; description=HTML Text; nametemplate=%s.html

0 comments on commit 0cde4ec

Please sign in to comment.