Mercurial > hg > xemacs
annotate mail-from-m.el @ 68:4ceed38beaa4
Vba macros for Outlook to save appointments as sent by diary.el
| author | Henry Thompson <ht@markup.co.uk> |
|---|---|
| date | Mon, 09 Jun 2025 12:21:43 +0100 |
| parents | 32a75a4db17b |
| children | c343c57a93e8 |
| 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 | 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 | 5 (setq mail-host-address "home.hst.name") |
| 6 (defun system-name () "home.hst.name") | |
| 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 | 27 ;; sending mail on the road |
| 28 ;(setq send-mail-function 'smtpmail-send-it) | |
| 29 ;(setq message-send-mail-function 'smtpmail-send-it) | |
| 30 ;(setq smtpmail-default-smtp-server "localhost") | |
| 31 ;(setq smtpmail-smtp-service "smtp") | |
| 32 ;(setq smtpmail-local-domain "home.hst.name") | |
| 33 (setq smtpmail-debug-info t) | |
| 34 (load "smtpmail" nil t) | |
| 35 (setq smtpmail-code-conv-from nil) | |
| 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 | 43 (cond ((re-search-forward "^From: .*ht@home.hst.name" nil t) |
| 40 | 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 | 47 (insert "rsof") |
| 48 (goto-char (point-max)) | |
| 49 (search-backward "\n-- \n") | |
| 50 (when (looking-at "\n-- \nHenry") | |
| 51 (forward-char 5) | |
| 52 (kill-entire-line 5) | |
| 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 | 102 (provide 'mail-from-m) |
