annotate mail-from-m.el @ 59:29e0ef38765f

default empty provision for set-ht...
author Henry S Thompson <ht@inf.ed.ac.uk>
date Thu, 04 Apr 2024 16:42:46 +0100
parents 32a75a4db17b
children c343c57a93e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
1 ;;; Load to read and send mail from maritain
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
2
22
6097ab2da4ce for new maritain
ht
parents:
diff changeset
3 (setq mail-append-host "home.hst.name")
58
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
4 (setq user-mail-address (format "%s@home.hst.name" user-name))
22
6097ab2da4ce for new maritain
ht
parents:
diff changeset
5 (setq mail-host-address "home.hst.name")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
6 (defun system-name () "home.hst.name")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
7
58
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
8 (let ((hdn (format "/home/%s" user-name)))
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
9 (let ((sfn (format "%s/.sig.pers" hdn)))
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
10 (setq mail-signature-file sfn
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
11 message-signature-file sfn
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
12 mail-signature t
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
13 message-signature t)
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
14 )
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
15 (setq gnus-default-directory hdn
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
16 gnus-home-directory hdn
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
17 my-mail-dir (format "%s/mail" hdn)
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
18 mail-sources `((file :path ,(format "/var/spool/mail/%s" user-name)))
47
06ccca1d4756 try to cope with major reshuffle on ecclerig
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 43
diff changeset
19 mail-archive-file-name (concat my-mail-dir "/cpy/general/"
06ccca1d4756 try to cope with major reshuffle on ecclerig
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 43
diff changeset
20 (format-time-string
06ccca1d4756 try to cope with major reshuffle on ecclerig
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 43
diff changeset
21 "%Y-%m" (current-time))
58
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
22 ".mbox"))
32
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
23 )
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
24
43
eee08de75336 try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 40
diff changeset
25 (setq mail-archive-file-name (expand-file-name "~/mail/cpy/general"))
eee08de75336 try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 40
diff changeset
26
22
6097ab2da4ce for new maritain
ht
parents:
diff changeset
27 ;; sending mail on the road
6097ab2da4ce for new maritain
ht
parents:
diff changeset
28 ;(setq send-mail-function 'smtpmail-send-it)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
29 ;(setq message-send-mail-function 'smtpmail-send-it)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
30 ;(setq smtpmail-default-smtp-server "localhost")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
31 ;(setq smtpmail-smtp-service "smtp")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
32 ;(setq smtpmail-local-domain "home.hst.name")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
33 (setq smtpmail-debug-info t)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
34 (load "smtpmail" nil t)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
35 (setq smtpmail-code-conv-from nil)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
36
32
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
37
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
38 (defun quaker-sig-maybe ()
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
39 (save-excursion
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
40 (goto-char (point-min))
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
41 (cond ((to-quaker-p)
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
42 (goto-char (point-min))
54
bcb51a32799d Group of N mailing list
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 52
diff changeset
43 (cond ((re-search-forward "^From: .*ht@home.hst.name" nil t)
40
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
44 ;; will fail on mhmcc
32
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
45 (backward-char 13)
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
46 (delete-char 4)
40
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
47 (insert "rsof")
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
48 (goto-char (point-max))
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
49 (search-backward "\n-- \n")
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
50 (when (looking-at "\n-- \nHenry")
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
51 (forward-char 5)
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
52 (kill-entire-line 5)
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
53 (insert-file "~/.quaker-sig"))))))))
32
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
54
56
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
55 (defun from-mhmcc ()
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
56 (interactive)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
57 ;; This is cribbed from the value of
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
58 ;; (gnus-configure-posting-styles "mhmcc-2024")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
59 (let ((user-full-name "HST as Convenor SESAM MHMC")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
60 (user-mail-address "mhmcc@rsof.hst.name"))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
61 (set (make-local-variable (quote user-mail-address))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
62 "mhmcc@rsof.hst.name")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
63 (save-excursion
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
64 (message-remove-header "From")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
65 (message-goto-eoh)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
66 (insert "From: " (message-make-from) "
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
67 ")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
68 ))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
69 (save-excursion
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
70 (let ((message-signature
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
71 "Henry S. Thompson, Convenor, SESAM Meeting House Management Committee
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
72 "))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
73 (message-insert-signature)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
74 (re-search-backward "^--")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
75 (let ((p (point)))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
76 (kill-region (re-search-backward "^--") p))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
77 ))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
78 (save-excursion
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
79 (message-remove-header "Reply-to")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
80 (let ((value "sesam.emh.management@gmail.com"))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
81 (when value
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
82 (message-goto-eoh)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
83 (insert "Reply-to" ": " value)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
84 (unless (bolp) (insert "
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
85 "))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
86 ))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
87 )
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
88 (save-excursion (message-remove-header "Bcc") (let ((value "sesam.emh.management@gmail.com")) (when value (message-goto-eoh) (insert "Bcc" ": " value) (unless (bolp) (insert "
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
89 ")))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
90 )
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
91 ; (let ((use-this (gnus-configure-posting-styles "mhmcc-2024"))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
92 ; (gnus-posting-styles nil))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
93 ; (mapc (lambda (expr)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
94 ; (let ((varbind (and (listp expr)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
95 ; (eq (car (caadr expr)) 'save-excursion)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
96 ; (caadr (cadr (caddr expr))))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
97 ; (unless (and (eq (car varbind) 'message-signature)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
98 ; (not (position "Convenor" (cadr varbind))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
99 ; (apply expr nil))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
100 ; ))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
101
22
6097ab2da4ce for new maritain
ht
parents:
diff changeset
102 (provide 'mail-from-m)