1 ===============================================================================
3 Welkom op de mutt+offlineimap+abook+gpg+notmuch+msmtp workshop
6 E-mail: mart@martlubbers.net
8 Bron : https://gist.github.com/dopefishh/79205ea4f9bc39c85e77
9 Bron2 : http://bit.do/7bwe
25 ===============================================================================
26 === Inhoudsopgave =============================================================
29 - **Introductie, waarom?
50 ===============================================================================
51 === Introductie =============================================================
53 - Waarom mutt? Ik heb toch al <item uit X>
55 X = {evolution, thunderbird, (al)pine, mop, roundcube, gmail webinterface}
61 - Geen afleiding van grafische vernuften
62 - Alles via toetsenbord
64 ______________________________________
65 / All mail clients suck. This one just \
67 --------------------------------------
75 ===============================================================================
76 === Voorbereiding =============================================================
78 GPG key aanmaken en een wachtwoord container maken zodat je wachtwoorden niet
81 frob@frobmachine~/.mutt$ cat mailpassword -
83 frob@frobmachine~/.mutt$ gpg -er linuxnijmegen@martlubbers.net mailpasswd
84 frob@frobmachine~/.mutt$ shred -u -n 100 -z -v mailpasswd
86 LET OP, DOE DIT NIET OP NFS, ZFS, EXT4 JOURNALLING, ETC.
100 ===============================================================================
101 === Inhoudsopgave =============================================================
104 - Introductie, waarom?
105 - **Wat hebben we nodig
125 ===============================================================================
126 === Ontvangen =============================================================
128 Mutt leest alleen maar email. We moeten dus eerst iets hebben om de email mee
135 frob@frobmachine:~# apt-get install offlineimap
136 frob@frobmachine:~# pacman -S install offlineimap
137 frob@frobmachine:~/.mutt$ cat offlineimaprc
140 pythonfile = ~/.mutt/offlineimap.py
141 metadata = ~/.mutt/offlineimap_meta
146 localrepository = Local
147 remoterepository = Remote
148 postsynchook = notmuch new && notmuch compact
150 ===============================================================================
151 === Ontvangen =============================================================
153 frob@frobmachine:~/.mutt$ cat offlineimap.py
159 return subprocess.check_output([
160 'gpg', '--quiet', '--decrypt', '--use-agent', '--batch',
161 '/home/frob/.mutt/mailpasswd.gpg'])
162 except subprocess.CalledProcessError:
175 ===============================================================================
176 === Inhoudsopgave =============================================================
179 - Introductie, waarom?
180 - **Wat hebben we nodig
200 ===============================================================================
201 === Versturen =============================================================
203 - Mutt heeft eigen smtp en kan sendmail of ander extern commando gebruiken
204 - Externe smtp: msmtp
205 - set sendmail="msmtp -C /home/frob/.mutt/msmtprc"
207 frob@frobmachine:~# apt-get install msmtp
208 frob@frobmachine:~# pacman -S install msmtp
209 frob@frobmachine:~/.mutt$ cat msmtprc
211 host mail.martlubbers.net
216 user linuxnijmegen@martlubbers.net
217 passwordeval gpg -qd --use-agent --batch mailpw.asc
218 from linuxnijmegen@martlubbers.net
225 ===============================================================================
226 === Inhoudsopgave =============================================================
229 - Introductie, waarom?
230 - **Wat hebben we nodig
250 ===============================================================================
251 === Zoeken =============================================================
253 - Mutt kan zoeken in huidige scherm met '/'
254 - Maar voor gmail achtige kracht gebruiken we notmuch
256 frob@frobmachine:~# apt-get install notmuch
257 frob@frobmachine:~# pacman -S install notmuch
258 frob@frobmachine:~$ export NOTMUCH_CONFIG=/home/frob/.mutt/notmuchrc
259 frob@frobmachine:~/.mutt/mail$ notmuch setup
261 ____________________________________________________________________________
262 / Notmuch is not much of an email program. \
263 | It doesn't receive messages (no POP or IMAP support). |
264 | It doesn't send messages (no mail composer, no network code at all). |
265 | And for what it does do (email search) that work is provided by an external |
267 | So if Notmuch provides no user interface and Xapian does all the heavy |
268 \ lifting, then what's left here? Not much. /
269 ----------------------------------------------------------------------------
275 ===============================================================================
276 === Zoeken =============================================================
278 - Ingewikkelde macro:
282 set my_old_pipe_decode=\$pipe_decode
283 set my_old_wait_key=\$wait_key
285 set nowait_key<enter>
286 <shell-escape>notmuch-mutt -r --prompt search<enter>
287 <change-folder-readonly>
288 `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>
290 set pipe_decode=\$my_old_pipe_decode
291 wait_key=\$my_old_wait_key<enter>"
292 "notmuch: search mail"
300 === Inhoudsopgave =============================================================
303 - Introductie, waarom?
304 - **Wat hebben we nodig
325 ===============================================================================
326 === Adresboek =============================================================
328 - Mutt heeft aliases maar is niet heel compleet daarom: abook
330 frob@frobmachine:~# apt-get install abook
331 frob@frobmachine:~# pacman -S install abook
333 - Query met de volgende macro:
335 set query_command = "abook --mutt-query '%s'"
336 macro index,pager a "<pipe-message>abook --add-email-quiet<return>"
337 "Add this sender to Abook"
338 bind editor <Tab> complete-query
350 ===============================================================================
351 === Inhoudsopgave =============================================================
354 - Introductie, waarom?
355 - Wat hebben we nodig
375 ===============================================================================
376 === PGP =============================================================
378 - Mutt komt met pgp ingebakken dmv gpg:
380 source /etc/Muttrc.gpg.dist
383 set crypt_replysignencrypted=yes
384 set crypt_verify_sig=yes
385 message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"'
386 "exec check-traditional-pgp"
388 - Druk op p om te kiezen bij het schrijven van een email en gpg handelt de rest
400 ===============================================================================
401 === Inhoudsopgave =============================================================
404 - Introductie, waarom?
405 - Wat hebben we nodig
425 ===============================================================================
426 === Mutt =============================================================
428 - Alles met toetsenbord, bijvoorbeeld:
430 m mail compose a new mail message
431 F flag-message toggle a message's 'important' flag
432 r reply reply to a message
434 c change-folder open a different folder
450 ===============================================================================
451 === Mutt =============================================================
453 Mutt gebruikt je favoriete editor die in EDITOR staat.
456 Mutt gebruikt een mailcap bestand voor niet text bestanden:
457 frob@frobmachine:~/.mutt$ cat mailcap
458 application/msword; libreoffice %s;
459 text/html; w3m -I %{charset} -T text/html; copiousoutput;
475 ===============================================================================
476 === Inhoudsopgave =============================================================
479 - Introductie, waarom?
480 - Wat hebben we nodig
500 ===============================================================================
501 === Einde =============================================================
505 Vraag vooral en kijk naar andermans dotfiles.
506 Bijvoorbeeld de mijne:
508 https://github.com/dopefishh/dotfiles
525 ===============================================================================