=============================================================================== Welkom op de mutt+offlineimap+abook+gpg+notmuch+msmtp workshop Auteur: Mart Lubbers E-mail: mart@martlubbers.net Web : martlubbers.net Bron : https://gist.github.com/dopefishh/79205ea4f9bc39c85e77 Bron2 : http://bit.do/7bwe =============================================================================== === Inhoudsopgave ============================================================= Inhoudsopgave: - **Introductie, waarom? - Wat hebben we nodig - Ontvangen - versturen - Zoeken - Adresboek - PGP - Mutt - Einde =============================================================================== === Introductie ============================================================= - Waarom mutt? Ik heb toch al X = {evolution, thunderbird, (al)pine, mop, roundcube, gmail webinterface} - Snel - Efficient - Functionaliteit - Integratie - Geen afleiding van grafische vernuften - Alles via toetsenbord ______________________________________ / All mail clients suck. This one just \ \ sucks less. / -------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || =============================================================================== === Voorbereiding ============================================================= GPG key aanmaken en een wachtwoord container maken zodat je wachtwoorden niet in je dotfiles komen: frob@frobmachine~/.mutt$ cat mailpassword - l1nux frob@frobmachine~/.mutt$ gpg -er linuxnijmegen@martlubbers.net mailpasswd frob@frobmachine~/.mutt$ shred -u -n 100 -z -v mailpasswd LET OP, DOE DIT NIET OP NFS, ZFS, EXT4 JOURNALLING, ETC. =============================================================================== === Inhoudsopgave ============================================================= Inhoudsopgave: - Introductie, waarom? - **Wat hebben we nodig - **Ontvangen - versturen - Zoeken - Adresboek - PGP - Mutt - Einde =============================================================================== === Ontvangen ============================================================= Mutt leest alleen maar email. We moeten dus eerst iets hebben om de email mee te ontvangen... Offlineimap - offlineimaprc - offlineimap.py frob@frobmachine:~# apt-get install offlineimap frob@frobmachine:~# pacman -S install offlineimap frob@frobmachine:~/.mutt$ cat offlineimaprc [general] pythonfile = ~/.mutt/offlineimap.py metadata = ~/.mutt/offlineimap_meta accounts = net ui = quiet [Account net] localrepository = Local remoterepository = Remote postsynchook = notmuch new && notmuch compact =============================================================================== === Ontvangen ============================================================= frob@frobmachine:~/.mutt$ cat offlineimap.py import subprocess def mailpasswd(): try: return subprocess.check_output([ 'gpg', '--quiet', '--decrypt', '--use-agent', '--batch', '/home/frob/.mutt/mailpasswd.gpg']) except subprocess.CalledProcessError: return "" =============================================================================== === Inhoudsopgave ============================================================= Inhoudsopgave: - Introductie, waarom? - **Wat hebben we nodig - Ontvangen - **Versturen - Zoeken - Adresboek - PGP - Mutt - Einde =============================================================================== === Versturen ============================================================= - Mutt heeft eigen smtp en kan sendmail of ander extern commando gebruiken - Externe smtp: msmtp - set sendmail="msmtp -C /home/frob/.mutt/msmtprc" frob@frobmachine:~# apt-get install msmtp frob@frobmachine:~# pacman -S install msmtp frob@frobmachine:~/.mutt$ cat msmtprc account net host mail.martlubbers.net port 587 auth on tls on tls_certcheck off user linuxnijmegen@martlubbers.net passwordeval gpg -qd --use-agent --batch mailpw.asc from linuxnijmegen@martlubbers.net =============================================================================== === Inhoudsopgave ============================================================= Inhoudsopgave: - Introductie, waarom? - **Wat hebben we nodig - Ontvangen - Versturen - **Zoeken - Adresboek - PGP - Mutt - Einde =============================================================================== === Zoeken ============================================================= - Mutt kan zoeken in huidige scherm met '/' - Maar voor gmail achtige kracht gebruiken we notmuch frob@frobmachine:~# apt-get install notmuch frob@frobmachine:~# pacman -S install notmuch frob@frobmachine:~$ export NOTMUCH_CONFIG=/home/frob/.mutt/notmuchrc frob@frobmachine:~/.mutt/mail$ notmuch setup ____________________________________________________________________________ / Notmuch is not much of an email program. \ | It doesn't receive messages (no POP or IMAP support). | | It doesn't send messages (no mail composer, no network code at all). | | And for what it does do (email search) that work is provided by an external | | library, Xapian. | | So if Notmuch provides no user interface and Xapian does all the heavy | \ lifting, then what's left here? Not much. / ---------------------------------------------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || =============================================================================== === Zoeken ============================================================= - Ingewikkelde macro: macro index " set my_old_pipe_decode=\$pipe_decode set my_old_wait_key=\$wait_key set nopipe_decode set nowait_key notmuch-mutt -r --prompt search `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results` set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" "notmuch: search mail" === Inhoudsopgave ============================================================= Inhoudsopgave: - Introductie, waarom? - **Wat hebben we nodig - Ontvangen - Versturen - Zoeken - **Adresboek - PGP - Mutt - Einde =============================================================================== === Adresboek ============================================================= - Mutt heeft aliases maar is niet heel compleet daarom: abook frob@frobmachine:~# apt-get install abook frob@frobmachine:~# pacman -S install abook - Query met de volgende macro: set query_command = "abook --mutt-query '%s'" macro index,pager a "abook --add-email-quiet" "Add this sender to Abook" bind editor complete-query =============================================================================== === Inhoudsopgave ============================================================= Inhoudsopgave: - Introductie, waarom? - Wat hebben we nodig - Ontvangen - Versturen - Zoeken - Adresboek - **PGP - Mutt - Einde =============================================================================== === PGP ============================================================= - Mutt komt met pgp ingebakken dmv gpg: source /etc/Muttrc.gpg.dist set crypt_autosign set crypt_replysign set crypt_replysignencrypted=yes set crypt_verify_sig=yes message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec check-traditional-pgp" - Druk op p om te kiezen bij het schrijven van een email en gpg handelt de rest af... =============================================================================== === Inhoudsopgave ============================================================= Inhoudsopgave: - Introductie, waarom? - Wat hebben we nodig - Ontvangen - Versturen - Zoeken - Adresboek - PGP - **Mutt - Einde =============================================================================== === Mutt ============================================================= - Alles met toetsenbord, bijvoorbeeld: m mail compose a new mail message F flag-message toggle a message's 'important' flag r reply reply to a message ? help this screen c change-folder open a different folder Etcetera. =============================================================================== === Mutt ============================================================= Mutt gebruikt je favoriete editor die in EDITOR staat. export EDITOR=vim Mutt gebruikt een mailcap bestand voor niet text bestanden: frob@frobmachine:~/.mutt$ cat mailcap application/msword; libreoffice %s; text/html; w3m -I %{charset} -T text/html; copiousoutput; =============================================================================== === Inhoudsopgave ============================================================= Inhoudsopgave: - Introductie, waarom? - Wat hebben we nodig - Ontvangen - Versturen - Zoeken - Adresboek - Mutt - **Einde =============================================================================== === Einde ============================================================= Bedankt! Vraag vooral en kijk naar andermans dotfiles. Bijvoorbeeld de mijne: https://github.com/dopefishh/dotfiles ===============================================================================