Mercurial > hg > xemacs
diff mail-from-m.el @ 78:0abfe9bf83a0
merge
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Thu, 25 Sep 2025 17:57:05 +0100 |
| parents | c343c57a93e8 |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mail-from-m.el Thu Sep 25 17:57:05 2025 +0100 @@ -0,0 +1,103 @@ +;;; Load to read and send mail from maritain + +(setq mail-append-host "home.hst.name") +(make-variable-buffer-local 'user-mail-address) +(setq-default user-mail-address (format "%s@home.hst.name" user-name)) +(setq mail-host-address "home.hst.name") +(defun system-name () "home.hst.name") + +(let ((hdn (format "/home/%s" user-name))) + (let ((sfn (format "%s/.sig.pers" hdn))) + (setq mail-signature-file sfn + message-signature-file sfn + mail-signature t + message-signature t) + ) + (setq gnus-default-directory hdn + gnus-home-directory hdn + my-mail-dir (format "%s/mail" hdn) + mail-sources `((file :path ,(format "/var/spool/mail/%s" user-name))) + mail-archive-file-name (concat my-mail-dir "/cpy/general/" + (format-time-string + "%Y-%m" (current-time)) + ".mbox")) +) + +(setq mail-archive-file-name (expand-file-name "~/mail/cpy/general")) + +;; sending mail on the road +;(setq send-mail-function 'smtpmail-send-it) +;(setq message-send-mail-function 'smtpmail-send-it) +;(setq smtpmail-default-smtp-server "localhost") +;(setq smtpmail-smtp-service "smtp") +;(setq smtpmail-local-domain "home.hst.name") +(setq smtpmail-debug-info t) +(load "smtpmail" nil t) +(setq smtpmail-code-conv-from nil) + + +(defun quaker-sig-maybe () + (save-excursion + (goto-char (point-min)) + (cond ((to-quaker-p) + (goto-char (point-min)) + (cond ((re-search-forward "^From: .*ht@home.hst.name" nil t) + ;; will fail on mhmcc + (backward-char 13) + (delete-char 4) + (insert "rsof") + (goto-char (point-max)) + (search-backward "\n-- \n") + (when (looking-at "\n-- \nHenry") + (forward-char 5) + (kill-entire-line 5) + (insert-file "~/.quaker-sig")))))))) + +(defun from-mhmcc () + (interactive) + ;; This is cribbed from the value of + ;; (gnus-configure-posting-styles "mhmcc-2024") + (let ((user-full-name "HST as Convenor SESAM MHMC") + (user-mail-address "mhmcc@rsof.hst.name")) + (set (make-local-variable (quote user-mail-address)) + "mhmcc@rsof.hst.name") + (save-excursion + (message-remove-header "From") + (message-goto-eoh) + (insert "From: " (message-make-from) " +") + )) + (save-excursion + (let ((message-signature + "Henry S. Thompson, Convenor, SESAM Meeting House Management Committee +")) + (message-insert-signature) + (re-search-backward "^--") + (let ((p (point))) + (kill-region (re-search-backward "^--") p)) + )) + (save-excursion + (message-remove-header "Reply-to") + (let ((value "sesam.emh.management@gmail.com")) + (when value + (message-goto-eoh) + (insert "Reply-to" ": " value) + (unless (bolp) (insert " +")) + )) + ) + (save-excursion (message-remove-header "Bcc") (let ((value "sesam.emh.management@gmail.com")) (when value (message-goto-eoh) (insert "Bcc" ": " value) (unless (bolp) (insert " +"))))) + ) +; (let ((use-this (gnus-configure-posting-styles "mhmcc-2024")) +; (gnus-posting-styles nil)) +; (mapc (lambda (expr) +; (let ((varbind (and (listp expr) +; (eq (car (caadr expr)) 'save-excursion) +; (caadr (cadr (caddr expr)))))) +; (unless (and (eq (car varbind) 'message-signature) +; (not (position "Convenor" (cadr varbind)))) +; (apply expr nil)))) +; )) + +(provide 'mail-from-m)
