annotate mail-from-m.el @ 66:c343c57a93e8

fix user-mail-address pblm
author Henry S Thompson <ht@inf.ed.ac.uk>
date Mon, 16 Dec 2024 18:22:27 +0000
parents 32a75a4db17b
children
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")
66
c343c57a93e8 fix user-mail-address pblm
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 58
diff changeset
4 (make-variable-buffer-local 'user-mail-address)
c343c57a93e8 fix user-mail-address pblm
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 58
diff changeset
5 (setq-default user-mail-address (format "%s@home.hst.name" user-name))
22
6097ab2da4ce for new maritain
ht
parents:
diff changeset
6 (setq mail-host-address "home.hst.name")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
7 (defun system-name () "home.hst.name")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
8
58
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
9 (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
10 (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
11 (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
12 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
13 mail-signature t
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
14 message-signature t)
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
15 )
32a75a4db17b try to paramterise email handling a bit more
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 56
diff changeset
16 (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
17 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
18 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
19 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
20 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
21 (format-time-string
06ccca1d4756 try to cope with major reshuffle on ecclerig
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 43
diff changeset
22 "%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
23 ".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
24 )
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
25
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
26 (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
27
22
6097ab2da4ce for new maritain
ht
parents:
diff changeset
28 ;; sending mail on the road
6097ab2da4ce for new maritain
ht
parents:
diff changeset
29 ;(setq send-mail-function 'smtpmail-send-it)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
30 ;(setq message-send-mail-function 'smtpmail-send-it)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
31 ;(setq smtpmail-default-smtp-server "localhost")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
32 ;(setq smtpmail-smtp-service "smtp")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
33 ;(setq smtpmail-local-domain "home.hst.name")
6097ab2da4ce for new maritain
ht
parents:
diff changeset
34 (setq smtpmail-debug-info t)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
35 (load "smtpmail" nil t)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
36 (setq smtpmail-code-conv-from nil)
6097ab2da4ce for new maritain
ht
parents:
diff changeset
37
32
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
38
cb9b76219c55 attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 22
diff changeset
39 (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
40 (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
41 (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
42 (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
43 (goto-char (point-min))
54
bcb51a32799d Group of N mailing list
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 52
diff changeset
44 (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
45 ;; 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
46 (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
47 (delete-char 4)
40
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
48 (insert "rsof")
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
49 (goto-char (point-max))
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
50 (search-backward "\n-- \n")
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
51 (when (looking-at "\n-- \nHenry")
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
52 (forward-char 5)
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
53 (kill-entire-line 5)
d9297098442b get mhmcc right?
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 32
diff changeset
54 (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
55
56
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
56 (defun from-mhmcc ()
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
57 (interactive)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
58 ;; 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
59 ;; (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
60 (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
61 (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
62 (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
63 "mhmcc@rsof.hst.name")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
64 (save-excursion
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
65 (message-remove-header "From")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
66 (message-goto-eoh)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
67 (insert "From: " (message-make-from) "
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 ))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
70 (save-excursion
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
71 (let ((message-signature
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
72 "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
73 "))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
74 (message-insert-signature)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
75 (re-search-backward "^--")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
76 (let ((p (point)))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
77 (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
78 ))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
79 (save-excursion
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
80 (message-remove-header "Reply-to")
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
81 (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
82 (when value
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
83 (message-goto-eoh)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
84 (insert "Reply-to" ": " value)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
85 (unless (bolp) (insert "
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 )
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
89 (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
90 ")))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
91 )
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
92 ; (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
93 ; (gnus-posting-styles nil))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
94 ; (mapc (lambda (expr)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
95 ; (let ((varbind (and (listp expr)
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
96 ; (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
97 ; (caadr (cadr (caddr expr))))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
98 ; (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
99 ; (not (position "Convenor" (cadr varbind))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
100 ; (apply expr nil))))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
101 ; ))
3dd34fa466c2 define from-mhmcc by brute force
Henry S Thompson <ht@inf.ed.ac.uk>
parents: 54
diff changeset
102
22
6097ab2da4ce for new maritain
ht
parents:
diff changeset
103 (provide 'mail-from-m)