forked from jwiegley/dot-emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot-gnus.el
663 lines (576 loc) · 23.7 KB
/
dot-gnus.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
;;;_ , Gnus
(eval-when-compile
(require 'cl))
(require 'use-package)
(eval-and-compile
(push (expand-file-name "override/bbdb/lisp" user-emacs-directory)
load-path))
(load "gnus-settings")
(require 'gnus)
(require 'starttls)
(require 'smtpmail)
(require 'message)
;; (require 'nnmairix)
;; (require 'spam)
;; (require 'spam-report)
(require 'bbdb)
(require 'bbdb-gnus)
(require 'bbdb-message)
(use-package async
:load-path "lisp/emacs-async")
;; (gnus-compile)
(gnus-delay-initialize)
;; (spam-initialize)
(bbdb-initialize 'gnus 'message)
(defvar use-spam-filtering nil)
;; Override definition from spam.el to use async.el
(defun spam-spamassassin-register-with-sa-learn (articles spam
&optional unregister)
"Register articles with spamassassin's sa-learn as spam or non-spam."
(if (and use-spam-filtering articles)
(let ((action (if unregister spam-sa-learn-unregister-switch
(if spam spam-sa-learn-spam-switch
spam-sa-learn-ham-switch)))
(summary-buffer-name (buffer-name)))
(with-temp-buffer
;; group the articles into mbox format
(dolist (article articles)
(let (article-string)
(with-current-buffer summary-buffer-name
(setq article-string (spam-get-article-as-string article)))
(when (stringp article-string)
;; mbox separator
(insert (concat "From nobody " (current-time-string) "\n"))
(insert article-string)
(insert "\n"))))
;; call sa-learn on all messages at the same time, and also report
;; them as SPAM to the Internet
(async-start
`(lambda ()
(with-temp-buffer
(insert ,(buffer-substring-no-properties
(point-min) (point-max)))
(call-process-region (point-min) (point-max)
,spam-sa-learn-program
nil nil nil "--mbox"
,@(if spam-sa-learn-rebuild
(list action)
(list "--no-rebuild" action)))
(if ,spam
(call-process-region (point-min) (point-max)
,(executable-find "spamassassin-5.12")
nil nil nil "--mbox" "-r"))))
`(lambda (&optional ignore)
(message "Finished learning messsages as %s"
,(if spam "spam" "ham"))))))))
(defvar switch-to-gnus-unplugged nil)
(defvar switch-to-gnus-run nil)
(eval-when-compile
(defvar ido-default-buffer-method)
(declare-function ido-visit-buffer "ido"))
(defun switch-to-gnus (&optional arg)
(interactive "P")
(let* ((alist '("\\`\\*unsent" "\\`\\*Summary" "\\`\\*Group"))
(candidate
(catch 'found
(dolist (regexp alist)
(dolist (buf (buffer-list))
(if (string-match regexp (buffer-name buf))
(throw 'found buf)))))))
(if (and switch-to-gnus-run candidate)
(progn
(if (featurep 'ido)
(ido-visit-buffer candidate ido-default-buffer-method)
(switch-to-buffer candidate))
(if (string-match "Group" (buffer-name candidate))
(gnus-group-get-new-news)))
(let ((switch-to-gnus-unplugged arg))
;; (gnus)
(gnus-unplugged)
(gnus-group-list-groups gnus-activate-level)
(setq switch-to-gnus-run t)))))
(defun quickping (host)
(= 0 (call-process "ping" nil nil nil "-c1" "-W50" "-q" host)))
(use-package gnus-group
:defer t
:config
(use-package fetchmail-ctl
:config
(bind-key "v b" #'switch-to-fetchmail gnus-group-mode-map)
(bind-key "v o" #'start-fetchmail gnus-group-mode-map)
(bind-key "v d" #'shutdown-fetchmail gnus-group-mode-map)
(bind-key "v k" #'kick-fetchmail gnus-group-mode-map)
(bind-key "v p" #'fetchnews-post gnus-group-mode-map)))
(use-package gnus-sum
:config
(bind-key "F" #'gnus-summary-wide-reply-with-original
gnus-summary-mode-map)
(bind-key "F" #'gnus-article-wide-reply-with-original
gnus-article-mode-map))
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(add-hook 'gnus-group-mode-hook 'hl-line-mode)
(add-hook 'gnus-summary-mode-hook 'hl-line-mode)
(defun my-message-header-setup-hook ()
(message-remove-header "From")
(let ((gcc (message-field-value "Gcc")))
(when (or (null gcc)
(string-match "nnfolder\\+archive:" gcc))
(message-remove-header "Gcc")
(message-add-header
(format "Gcc: %s"
(if (string-match "\\`list\\." (or gnus-newsgroup-name ""))
"mail.sent"
"INBOX"))))))
(add-hook 'message-header-setup-hook 'my-message-header-setup-hook)
(defadvice gnus-summary-resend-message-edit (after call-my-mhs-hook activate)
(my-message-header-setup-hook))
(defun my-gnus-summary-save-parts (&optional arg)
(interactive "P")
(let ((directory "~/Downloads"))
(message "Saving all MIME parts to %s..." directory)
(gnus-summary-save-parts ".*" directory arg)
(message "Saving all MIME parts to %s...done" directory)))
(bind-key "X m" 'my-gnus-summary-save-parts gnus-summary-mode-map)
;; (eval-when-compile
;; (defvar gnus-agent-queue-mail))
;; (defun queue-message-if-not-connected ()
;; (set (make-local-variable 'gnus-agent-queue-mail)
;; (if (quickping "mail.messagingengine.com") t 'always)))
;;(add-hook 'message-send-hook 'queue-message-if-not-connected)
(defun kick-postfix-if-needed ()
(if (and (quickping "mail.messagingengine.com")
(= 0 (call-process "/usr/bin/sudo" nil nil nil
"/usr/libexec/postfix/master" "-t")))
(start-process "postfix" nil "/usr/bin/sudo"
"/usr/libexec/postfix/master" "-e" "60")))
(add-hook 'message-sent-hook 'kick-postfix-if-needed)
(defun exit-gnus-on-exit ()
(if (and (fboundp 'gnus-group-exit)
(gnus-alive-p))
(with-current-buffer (get-buffer "*Group*")
(let (gnus-interactive-exit)
(gnus-group-exit)))))
(add-hook 'kill-emacs-hook 'exit-gnus-on-exit)
(defun switch-in-other-buffer (buf)
(when buf
(split-window-vertically)
(balance-windows)
(switch-to-buffer-other-window buf)))
(defun open-mail-logs ()
(interactive)
(loop initially (delete-other-windows)
with first = t
for log in (directory-files "~/Messages/" t "\\.log\\'")
for buf = (find-file-noselect log)
do (if first
(progn
(switch-to-buffer buf)
(setf first nil))
(switch-in-other-buffer buf))
(with-current-buffer buf
(goto-char (point-max)))))
(defun my-gnus-trash-article (arg)
(interactive "P")
(if (string-match "\\(drafts\\|queue\\|delayed\\)" gnus-newsgroup-name)
(gnus-summary-delete-article arg)
(gnus-summary-move-article arg "mail.trash")))
(define-key gnus-summary-mode-map [(meta ?q)] 'gnus-article-fill-long-lines)
(define-key gnus-summary-mode-map [?B delete] 'gnus-summary-delete-article)
(define-key gnus-summary-mode-map [?B backspace] 'my-gnus-trash-article)
(define-key gnus-article-mode-map [(meta ?q)] 'gnus-article-fill-long-lines)
(defface gnus-summary-expirable-face
'((((class color) (background dark))
(:foreground "grey50" :italic t :strike-through t))
(((class color) (background light))
(:foreground "grey55" :italic t :strike-through t)))
"Face used to highlight articles marked as expirable."
:group 'gnus-summary-visual)
(push '((eq mark gnus-expirable-mark) . gnus-summary-expirable-face)
gnus-summary-highlight)
(if window-system
(setq
gnus-sum-thread-tree-false-root ""
gnus-sum-thread-tree-single-indent ""
gnus-sum-thread-tree-root ""
gnus-sum-thread-tree-vertical "|"
gnus-sum-thread-tree-leaf-with-other "+-> "
gnus-sum-thread-tree-single-leaf "\\-> "
gnus-sum-thread-tree-indent " "))
(defsubst dot-gnus-tos (time)
"Convert TIME to a floating point number."
(+ (* (car time) 65536.0)
(cadr time)
(/ (or (car (cdr (cdr time))) 0) 1000000.0)))
(defun gnus-user-format-function-S (header)
"Return how much time it's been since something was sent."
(condition-case err
(let ((date (mail-header-date header)))
(if (> (length date) 0)
(let*
((then (dot-gnus-tos
(apply 'encode-time (parse-time-string date))))
(now (dot-gnus-tos (current-time)))
(diff (- now then))
(str
(cond
((>= diff (* 86400.0 7.0 52.0))
(if (>= diff (* 86400.0 7.0 52.0 10.0))
(format "%3dY" (floor (/ diff (* 86400.0 7.0 52.0))))
(format "%3.1fY" (/ diff (* 86400.0 7.0 52.0)))))
((>= diff (* 86400.0 30.0))
(if (>= diff (* 86400.0 30.0 10.0))
(format "%3dM" (floor (/ diff (* 86400.0 30.0))))
(format "%3.1fM" (/ diff (* 86400.0 30.0)))))
((>= diff (* 86400.0 7.0))
(if (>= diff (* 86400.0 7.0 10.0))
(format "%3dw" (floor (/ diff (* 86400.0 7.0))))
(format "%3.1fw" (/ diff (* 86400.0 7.0)))))
((>= diff 86400.0)
(if (>= diff (* 86400.0 10.0))
(format "%3dd" (floor (/ diff 86400.0)))
(format "%3.1fd" (/ diff 86400.0))))
((>= diff 3600.0)
(if (>= diff (* 3600.0 10.0))
(format "%3dh" (floor (/ diff 3600.0)))
(format "%3.1fh" (/ diff 3600.0))))
((>= diff 60.0)
(if (>= diff (* 60.0 10.0))
(format "%3dm" (floor (/ diff 60.0)))
(format "%3.1fm" (/ diff 60.0))))
(t
(format "%3ds" (floor diff)))))
(stripped
(replace-regexp-in-string "\\.0" "" str)))
(concat (cond
((= 2 (length stripped)) " ")
((= 3 (length stripped)) " ")
(t ""))
stripped))))
(error " ")))
(defvar gnus-count-recipients-threshold 5
"*Number of recipients to consider as large.")
(defun gnus-user-format-function-r (header)
"Given a Gnus message header, returns priority mark.
Here are the meanings:
The first column represent my relationship to the To: field. It can be:
I didn't appear (and the letter had one recipient)
: I didn't appear (and the letter had more than one recipient)
< I was the sole recipient
+ I was among a few recipients
* There were many recipients
The second column represents the Cc: field:
. I wasn't mentioned, but one other was
: I wasn't mentioned, but others were
^ I was the only Cc mentioned
& I was among a few Cc recipients
% I was among many Cc recipients
These can combine in some ways to tell you at a glance how visible the message
is:
>. Someone wrote to me and one other
& I was copied along with several other people
*: Mail to lots of people in both the To and Cc!"
(let* ((to (or (cdr (assoc 'To (mail-header-extra header))) ""))
(cc (or (cdr (assoc 'Cc (mail-header-extra header))) ""))
(to-len (length (split-string to "\\s-*,\\s-*")))
(cc-len (length (split-string cc "\\s-*,\\s-*")))
(to-char (cond )))
(cond ((string-match gnus-ignored-from-addresses to)
(cond ((= to-len 1)
(cond ((string= cc "") "< ")
((= cc-len 1) "<.")
(t "<:")))
((< to-len gnus-count-recipients-threshold)
(cond ((string= cc "") "+ ")
((= cc-len 1) "+.")
(t "+:")))
(t
(cond ((string= cc "") "* ")
((= cc-len 1) "*.")
(t "*:")))))
((string-match gnus-ignored-from-addresses cc)
(cond ((= cc-len 1)
(cond ((= to-len 1) " ^")
(t ":^")))
((< cc-len gnus-count-recipients-threshold)
(cond ((= to-len 1) " &")
(t ":&")))
(t
(cond ((= to-len 1) " %")
(t ":%")))))
(t " "))))
(use-package message-x)
;; (use-package message
;; :defer t
;; :config
;; (defun adjust-body-goto-location ()
;; (if (looking-at "^--")
;; (save-excursion (insert ?\n ?\n))
;; (when (re-search-forward "^-- $" nil t)
;; (goto-char (match-beginning 0))
;; (if (looking-back "\n\n")
;; (forward-line -2)
;; (save-excursion (insert ?\n ?\n ?\n))
;; (forward-line 1)))))
;; (advice-add 'message-goto-body :after #'adjust-body-goto-location))
(use-package gnus-dired
:commands gnus-dired-mode
:init
(add-hook 'dired-mode-hook 'gnus-dired-mode))
(use-package my-gnus-score
:commands (my-gnus-score-groups my-gnus-score-followup)
:init
(defun gnus-group-get-all-new-news ()
(interactive)
(gnus-group-get-new-news 5)
(gnus-group-list-groups 4)
(my-gnus-score-groups)
(gnus-group-list-groups 4)
(gnus-group-save-newsrc t))
(define-key gnus-group-mode-map [?v ?g] 'gnus-group-get-all-new-news))
(use-package gnus-demon
:init
(progn
(defun gnus-demon-scan-news-2 ()
(when gnus-plugged
(let ((win (current-window-configuration))
(gnus-read-active-file nil)
(gnus-check-new-newsgroups nil)
(gnus-verbose 2)
(gnus-verbose-backends 5))
(unwind-protect
(save-window-excursion
(when (gnus-alive-p)
(with-current-buffer gnus-group-buffer
(gnus-group-get-new-news gnus-activate-level))))
(set-window-configuration win)))))
;; (gnus-demon-add-handler 'gnus-demon-scan-news-2 5 2)
(defun save-gnus-newsrc ()
(if (and (fboundp 'gnus-group-exit)
(gnus-alive-p))
(with-current-buffer (get-buffer "*Group*")
(gnus-save-newsrc-file))))
(gnus-demon-add-handler 'save-gnus-newsrc nil 1)
(gnus-demon-add-handler 'gnus-demon-close-connections nil 3)))
(defun activate-gnus ()
(unless (get-buffer "*Group*") (gnus)))
(use-package epa
:defer t
:config
(defun epa--key-widget-value-create (widget)
(let* ((key (widget-get widget :value))
(primary-sub-key (car (last (epg-key-sub-key-list key) 3)))
(primary-user-id (car (epg-key-user-id-list key))))
(insert (format "%c "
(if (epg-sub-key-validity primary-sub-key)
(car (rassq (epg-sub-key-validity primary-sub-key)
epg-key-validity-alist))
? ))
(epg-sub-key-id primary-sub-key)
" "
(if primary-user-id
(if (stringp (epg-user-id-string primary-user-id))
(epg-user-id-string primary-user-id)
(epg-decode-dn (epg-user-id-string primary-user-id)))
"")))))
(use-package nnir
:init
(defun gnus-goto-article (message-id)
(activate-gnus)
(gnus-summary-read-group "INBOX" 15 t)
(let ((nnir-imap-default-search-key "imap")
(nnir-ignored-newsgroups "mail\\.\\(spam\\|save\\|trash\\|sent\\)\\)"))
(gnus-summary-refer-article message-id)))
(defvar gnus-query-history nil)
(defun gnus-query (query &optional arg)
(interactive
(list (read-string (format "IMAP Query %s: "
(if current-prefix-arg "All" "Mail"))
(format-time-string "SENTSINCE %d-%b-%Y "
(time-subtract (current-time)
(days-to-time 90)))
'gnus-query-history)
current-prefix-arg))
(activate-gnus)
(let ((nnir-imap-default-search-key "imap")
(nnir-ignored-newsgroups
(if arg
(concat (regexp-opt
'("archive"
"archive.emacs"
"list"
"list.emacs"
"list.ledger"
"mail"
"mail.save"
"Drafts"
"Sent Messages"))
"\\'")
(concat "\\(\\(list\\|archive\\)\\.\\|"
"mail\\.\\(spam\\|save\\|trash\\|sent\\)\\)"))))
(gnus-group-make-nnir-group
nil (list (cons 'nnir-query-spec
(list (cons 'query query)
(cons 'criteria "")))
(cons 'nnir-group-spec
(list (list "nnimap:Local")))))))
(define-key global-map [(alt meta ?f)] 'gnus-query))
(use-package gnus-harvest
:load-path "lisp/gnus-harvest"
:commands gnus-harvest-install
:demand t
:config
(if (featurep 'message-x)
(gnus-harvest-install 'message-x)
(gnus-harvest-install)))
(use-package gnus-alias
:commands (gnus-alias-determine-identity
gnus-alias-message-x-completion
gnus-alias-select-identity)
:init
(add-hook 'message-setup-hook 'gnus-alias-determine-identity)
(if (featurep 'message-x)
(add-hook 'message-x-after-completion-functions
'gnus-alias-message-x-completion))
(define-key message-mode-map "\C-c\C-f\C-p" 'gnus-alias-select-identity))
(eval-when-compile
(defvar gnus-balloon-face-0)
(defvar gnus-balloon-face-1))
(use-package rs-gnus-summary
:config
(defalias 'gnus-user-format-function-size
'rs-gnus-summary-line-message-size)
(setq gnus-balloon-face-0 'rs-gnus-balloon-0)
(setq gnus-balloon-face-1 'rs-gnus-balloon-1))
(use-package supercite
:commands sc-cite-original
:init
(progn
(add-hook 'mail-citation-hook 'sc-cite-original)
(defun sc-remove-existing-signature ()
(save-excursion
(goto-char (region-beginning))
(when (re-search-forward message-signature-separator (region-end) t)
(delete-region (match-beginning 0) (region-end)))))
(add-hook 'mail-citation-hook 'sc-remove-existing-signature))
:config
(defun sc-fill-if-different (&optional prefix)
"Fill the region bounded by `sc-fill-begin' and point.
Only fill if optional PREFIX is different than
`sc-fill-line-prefix'. If `sc-auto-fill-region-p' is nil, do not
fill region. If PREFIX is not supplied, initialize fill
variables. This is useful for a regi `begin' frame-entry."
(if (not prefix)
(setq sc-fill-line-prefix ""
sc-fill-begin (line-beginning-position))
(if (and sc-auto-fill-region-p
(not (string= prefix sc-fill-line-prefix)))
(let ((fill-prefix sc-fill-line-prefix))
(unless (or (string= fill-prefix "")
(save-excursion
(goto-char sc-fill-begin)
(or (looking-at ">+ +")
(< (length
(buffer-substring (point)
(line-end-position)))
65))))
(fill-region sc-fill-begin (line-beginning-position)))
(setq sc-fill-line-prefix prefix
sc-fill-begin (line-beginning-position)))))
nil))
(defun gnus-article-get-urls-region (min max)
"Return a list of urls found in the region between MIN and MAX"
(let (url-list)
(save-excursion
(save-restriction
(narrow-to-region min max)
(goto-char (point-min))
(while (re-search-forward gnus-button-url-regexp nil t)
(let ((match-string (match-string-no-properties 0)))
(if (and (not (equal (substring match-string 0 4) "file"))
(not (member match-string url-list)))
(setq url-list (cons match-string url-list)))))))
url-list))
(defun gnus-article-get-current-urls ()
"Return a list of the urls found in the current `gnus-article-buffer'"
(let (url-list)
(with-current-buffer gnus-article-buffer
(setq url-list
(gnus-article-get-urls-region (point-min) (point-max))))
url-list))
(defun gnus-article-browse-urls ()
"Visit a URL from the `gnus-article-buffer' by showing a
buffer with the list of URLs found with the `gnus-button-url-regexp'."
(interactive)
(gnus-configure-windows 'article)
(gnus-summary-select-article nil nil 'pseudo)
(let ((temp-buffer (generate-new-buffer " *Article URLS*"))
(urls (gnus-article-get-current-urls))
(this-window (selected-window))
(browse-window (get-buffer-window gnus-article-buffer))
(count 0))
(save-excursion
(save-window-excursion
(with-current-buffer temp-buffer
(mapc (lambda (string)
(insert (format "\t%d: %s\n" count string))
(setq count (1+ count))) urls)
(not-modified)
(pop-to-buffer temp-buffer)
(setq count
(string-to-number
(char-to-string (if (fboundp
'read-char-exclusive)
(read-char-exclusive)
(read-char)))))
(kill-buffer temp-buffer)))
(if browse-window
(progn (select-window browse-window)
(browse-url (nth count urls)))))
(select-window this-window)))
(use-package browse-url
:commands browse-url
:config
(define-key gnus-summary-mode-map [(control ?c) (control ?o)]
'gnus-article-browse-urls)
(define-key gnus-article-mode-map [(control ?c) (control ?o)]
'gnus-article-browse-urls))
(use-package mml
:defer t
:config
(defvar mml-signing-attachment nil)
(defun mml-sign-attached-file (file &optional type description disposition)
(unless (or mml-signing-attachment
(null current-prefix-arg))
(let ((signature
(expand-file-name (concat (file-name-nondirectory file) ".sig")
temporary-file-directory))
(mml-signing-attachment t))
(message "Signing %s..." file)
(if t
(call-process epg-gpg-program file nil nil
"--output" signature "--detach-sign" file)
(with-temp-file signature
(setq buffer-file-coding-system 'raw-text-unix)
(call-process epg-gpg-program file t nil "--detach-sign")))
(message "Signing %s...done" file)
(mml-attach-file signature))))
(advice-add 'mml-attach-file :after #'mml-sign-attached-file))
;; (use-package message-mode
;; :init
;; (add-hook 'message-mode-hook 'orgstruct++-mode 'append)
;; (add-hook 'message-mode-hook 'turn-on-auto-fill 'append)
;; (add-hook 'message-mode-hook 'bbdb-define-all-aliases 'append)
;; (add-hook 'message-mode-hook 'orgtbl-mode 'append)
;; (add-hook 'message-mode-hook
;; '(lambda () (setq fill-column 72))
;; 'append)
;; (add-hook 'message-mode-hook
;; '(lambda () (local-set-key (kbd "C-c M-o") 'org-mime-htmlize))
;; 'append)
;; )
(provide 'dot-gnus)
;; Local Variables:
;; mode: emacs-lisp
;; outline-regexp: "^;;;_\\([,. ]+\\)"
;; End:
;;; dot-gnus.el ends here