diff mail-from-m.el @ 32:cb9b76219c55

attempt to merge mail read and send from all over
author Henry S Thompson <ht@inf.ed.ac.uk>
date Sun, 08 Oct 2023 16:36:27 +0100
parents 6097ab2da4ce
children d9297098442b
line wrap: on
line diff
--- a/mail-from-m.el	Sat Oct 07 12:43:14 2023 +0100
+++ b/mail-from-m.el	Sun Oct 08 16:36:27 2023 +0100
@@ -1,4 +1,5 @@
-;;; Edit and load to send mail as from ...
+;;; Load to read and send mail from maritain
+
 (setq mail-append-host "home.hst.name")
 (setq user-full-name "Henry S. Thompson")
 (setq user-mail-address "ht@home.hst.name")
@@ -9,6 +10,50 @@
 (setq message-signature t)
 (defun system-name () "home.hst.name")
 
+(setq gnus-default-directory "/home/ht"
+      my-mail-dir "/home/ht/mail"
+)
+
+(defun set-nnmail-split-fancy ()
+  (setq nnmail-split-fancy
+      (let ((month (format-time-string "%Y-%m" (current-time))))
+      (cons '|
+	    (append '(("Subject" "testing" "jjunk")
+		      (to "quaker-\\(l\\|spectrum\\)" "quaker-2022")
+		      (to "quaker-b" "quaker-b")
+		      (to "[cC]ygwin" "cygwin")
+		      (from "noreply@mrooms.net" "nayler")
+		      (to "ht@rsof.hst.name" "quaker-2023")
+		      (to "Wardenship@lists.quaker.eu.org" "wardens")
+		      (to "mhmcc@rsof.hst.name" "mhmcc-2023")
+		      ("Envelope-to" "mhmcc@rsof.hst.name"
+		       (| (from "mhmcc@rsof.hst.name" junk)
+			  "mhmcc-2023"))
+		      (to "mfw@rsof.hst.name" "7vt")
+		      (to "zphdaily" (concat "pers-" month))
+		      (to "inf\\(pg\\|msc\\|teach\\|res\\|staff\\)" "inf-\\1" )
+		      )
+		    (list (list 'to
+				"ht\\|h\\.?thompson?"
+				(concat "pers-" month))
+			  (concat "group-"
+				  (format-time-string
+				   "%Y-%m" (current-time))
+				  "")))))))
+
+(setq gnus-posting-styles
+      `((".*"
+	 (signature-file ,mail-signature-file))
+	("quaker-2023"
+	 (signature-file "/home/ht/.quaker-sig")
+	 (address "ht@rsof.hst.name"))
+	("mhmcc-2023"
+	 (signature-file "/home/ht/.mhmcc-sig")
+	 ("Reply-to" "sesam.emh.management@gmail.com")
+	 (name "HST as Convenor SESAM MHMC")
+	 (address "mhmcc@rsof.hst.name")
+	 ("Bcc" "sesam.emh.management@gmail.com"))))
+
 ;; sending mail on the road
 ;(setq send-mail-function 'smtpmail-send-it)
 ;(setq message-send-mail-function 'smtpmail-send-it)
@@ -19,4 +64,22 @@
 (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 ((search-forward "\nFrom: ht@home.hst.name" nil t)
+		  (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"))))
+
 (provide 'mail-from-m)