(no commit message)
[linuxnijmegen-mutt.git] / slides
1 ===============================================================================
2
3 Welkom op de mutt+offlineimap+abook+gpg+notmuch+msmtp workshop
4
5 Auteur: Mart Lubbers
6 E-mail: mart@martlubbers.net
7 Web : martlubbers.net
8 Bron : https://gist.github.com/dopefishh/79205ea4f9bc39c85e77
9 Bron2 : http://bit.do/7bwe
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 ===============================================================================
26 === Inhoudsopgave =============================================================
27
28 Inhoudsopgave:
29 - **Introductie, waarom?
30 - Wat hebben we nodig
31 - Ontvangen
32 - versturen
33 - Zoeken
34 - Adresboek
35 - PGP
36 - Mutt
37 - Einde
38
39
40
41
42
43
44
45
46
47
48
49
50 ===============================================================================
51 === Introductie =============================================================
52
53 - Waarom mutt? Ik heb toch al <item uit X>
54
55 X = {evolution, thunderbird, (al)pine, mop, roundcube, gmail webinterface}
56
57 - Snel
58 - Efficient
59 - Functionaliteit
60 - Integratie
61 - Geen afleiding van grafische vernuften
62 - Alles via toetsenbord
63
64 ______________________________________
65 / All mail clients suck. This one just \
66 \ sucks less. /
67 --------------------------------------
68 \ ^__^
69 \ (oo)\_______
70 (__)\ )\/\
71 ||----w |
72 || ||
73
74
75 ===============================================================================
76 === Voorbereiding =============================================================
77
78 GPG key aanmaken en een wachtwoord container maken zodat je wachtwoorden niet
79 in je dotfiles komen:
80
81 frob@frobmachine~/.mutt$ cat mailpassword -
82 l1nux
83 frob@frobmachine~/.mutt$ gpg -er linuxnijmegen@martlubbers.net mailpasswd
84 frob@frobmachine~/.mutt$ shred -u -n 100 -z -v mailpasswd
85
86 LET OP, DOE DIT NIET OP NFS, ZFS, EXT4 JOURNALLING, ETC.
87
88
89
90
91
92
93
94
95
96
97
98
99
100 ===============================================================================
101 === Inhoudsopgave =============================================================
102
103 Inhoudsopgave:
104 - Introductie, waarom?
105 - **Wat hebben we nodig
106 - **Ontvangen
107 - versturen
108 - Zoeken
109 - Adresboek
110 - PGP
111 - Mutt
112 - Einde
113
114
115
116
117
118
119
120
121
122
123
124
125 ===============================================================================
126 === Ontvangen =============================================================
127
128 Mutt leest alleen maar email. We moeten dus eerst iets hebben om de email mee
129 te ontvangen...
130
131 Offlineimap
132 - offlineimaprc
133 - offlineimap.py
134
135 frob@frobmachine:~# apt-get install offlineimap
136 frob@frobmachine:~# pacman -S install offlineimap
137 frob@frobmachine:~/.mutt$ cat offlineimaprc
138
139 [general]
140 pythonfile = ~/.mutt/offlineimap.py
141 metadata = ~/.mutt/offlineimap_meta
142 accounts = net
143 ui = quiet
144
145 [Account net]
146 localrepository = Local
147 remoterepository = Remote
148 postsynchook = notmuch new && notmuch compact
149
150 ===============================================================================
151 === Ontvangen =============================================================
152
153 frob@frobmachine:~/.mutt$ cat offlineimap.py
154
155 import subprocess
156
157 def mailpasswd():
158 try:
159 return subprocess.check_output([
160 'gpg', '--quiet', '--decrypt', '--use-agent', '--batch',
161 '/home/frob/.mutt/mailpasswd.gpg'])
162 except subprocess.CalledProcessError:
163 return ""
164
165
166
167
168
169
170
171
172
173
174
175 ===============================================================================
176 === Inhoudsopgave =============================================================
177
178 Inhoudsopgave:
179 - Introductie, waarom?
180 - **Wat hebben we nodig
181 - Ontvangen
182 - **Versturen
183 - Zoeken
184 - Adresboek
185 - PGP
186 - Mutt
187 - Einde
188
189
190
191
192
193
194
195
196
197
198
199
200 ===============================================================================
201 === Versturen =============================================================
202
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"
206
207 frob@frobmachine:~# apt-get install msmtp
208 frob@frobmachine:~# pacman -S install msmtp
209 frob@frobmachine:~/.mutt$ cat msmtprc
210 account net
211 host mail.martlubbers.net
212 port 587
213 auth on
214 tls on
215 tls_certcheck off
216 user linuxnijmegen@martlubbers.net
217 passwordeval gpg -qd --use-agent --batch mailpw.asc
218 from linuxnijmegen@martlubbers.net
219
220
221
222
223
224
225 ===============================================================================
226 === Inhoudsopgave =============================================================
227
228 Inhoudsopgave:
229 - Introductie, waarom?
230 - **Wat hebben we nodig
231 - Ontvangen
232 - Versturen
233 - **Zoeken
234 - Adresboek
235 - PGP
236 - Mutt
237 - Einde
238
239
240
241
242
243
244
245
246
247
248
249
250 ===============================================================================
251 === Zoeken =============================================================
252
253 - Mutt kan zoeken in huidige scherm met '/'
254 - Maar voor gmail achtige kracht gebruiken we notmuch
255
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
260
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 |
266 | library, Xapian. |
267 | So if Notmuch provides no user interface and Xapian does all the heavy |
268 \ lifting, then what's left here? Not much. /
269 ----------------------------------------------------------------------------
270 \ ^__^
271 \ (oo)\_______
272 (__)\ )\/\
273 ||----w |
274 || ||
275 ===============================================================================
276 === Zoeken =============================================================
277
278 - Ingewikkelde macro:
279
280 macro index <F8>
281 "<enter-command>
282 set my_old_pipe_decode=\$pipe_decode
283 set my_old_wait_key=\$wait_key
284 set nopipe_decode
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>
289 <enter-command>
290 set pipe_decode=\$my_old_pipe_decode
291 wait_key=\$my_old_wait_key<enter>"
292 "notmuch: search mail"
293
294
295
296
297
298
299
300 === Inhoudsopgave =============================================================
301
302 Inhoudsopgave:
303 - Introductie, waarom?
304 - **Wat hebben we nodig
305 - Ontvangen
306 - Versturen
307 - Zoeken
308 - **Adresboek
309 - PGP
310 - Mutt
311 - Einde
312
313
314
315
316
317
318
319
320
321
322
323
324
325 ===============================================================================
326 === Adresboek =============================================================
327
328 - Mutt heeft aliases maar is niet heel compleet daarom: abook
329
330 frob@frobmachine:~# apt-get install abook
331 frob@frobmachine:~# pacman -S install abook
332
333 - Query met de volgende macro:
334
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
339
340
341
342
343
344
345
346
347
348
349
350 ===============================================================================
351 === Inhoudsopgave =============================================================
352
353 Inhoudsopgave:
354 - Introductie, waarom?
355 - Wat hebben we nodig
356 - Ontvangen
357 - Versturen
358 - Zoeken
359 - Adresboek
360 - **PGP
361 - Mutt
362 - Einde
363
364
365
366
367
368
369
370
371
372
373
374
375 ===============================================================================
376 === PGP =============================================================
377
378 - Mutt komt met pgp ingebakken dmv gpg:
379
380 source /etc/Muttrc.gpg.dist
381 set crypt_autosign
382 set crypt_replysign
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"
387
388 - Druk op p om te kiezen bij het schrijven van een email en gpg handelt de rest
389 af...
390
391
392
393
394
395
396
397
398
399
400 ===============================================================================
401 === Inhoudsopgave =============================================================
402
403 Inhoudsopgave:
404 - Introductie, waarom?
405 - Wat hebben we nodig
406 - Ontvangen
407 - Versturen
408 - Zoeken
409 - Adresboek
410 - PGP
411 - **Mutt
412 - Einde
413
414
415
416
417
418
419
420
421
422
423
424
425 ===============================================================================
426 === Mutt =============================================================
427
428 - Alles met toetsenbord, bijvoorbeeld:
429
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
433 ? help this screen
434 c change-folder open a different folder
435
436 Etcetera.
437
438
439
440
441
442
443
444
445
446
447
448
449
450 ===============================================================================
451 === Mutt =============================================================
452
453 Mutt gebruikt je favoriete editor die in EDITOR staat.
454 export EDITOR=vim
455
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;
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475 ===============================================================================
476 === Inhoudsopgave =============================================================
477
478 Inhoudsopgave:
479 - Introductie, waarom?
480 - Wat hebben we nodig
481 - Ontvangen
482 - Versturen
483 - Zoeken
484 - Adresboek
485 - Mutt
486 - **Einde
487
488
489
490
491
492
493
494
495
496
497
498
499
500 ===============================================================================
501 === Einde =============================================================
502
503 Bedankt!
504
505 Vraag vooral en kijk naar andermans dotfiles.
506 Bijvoorbeeld de mijne:
507
508 https://github.com/dopefishh/dotfiles
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525 ===============================================================================