comparison shared/gnus-init.el @ 5:8e0e16f4763c

tweaks, over quite a stretch of time ...
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Fri, 06 Oct 2023 19:01:47 +0100
parents 18db20bcc65b
children
comparison
equal deleted inserted replaced
4:18db20bcc65b 5:8e0e16f4763c
131 (to "fnlp-students" "fnlp") 131 (to "fnlp-students" "fnlp")
132 ;(from "fox@tardis\\.ed\\.ac\\.uk\\|s1505551" "fnlp") 132 ;(from "fox@tardis\\.ed\\.ac\\.uk\\|s1505551" "fnlp")
133 ;(to "anlp-students" "anlp") 133 ;(to "anlp-students" "anlp")
134 ;(from "nbnotifications" "anlp") 134 ;(from "nbnotifications" "anlp")
135 ;(: split-on-whole-field "Subject" "Re: MSc Project 18.*" "msc18") 135 ;(: split-on-whole-field "Subject" "Re: MSc Project 18.*" "msc18")
136 (: split-on-whole-field "Subject" ".*\\(FNLP\\|100782021\\).*" "fnlp") 136 ;(: split-on-whole-field "Subject" ".*\\(FNLP\\|100782021\\).*" "fnlp")
137 ;(: split-on-whole-field "Subject" ".*SDP \\(MS .\\|final\\) evaluation" "sdpEval") 137 ;(: split-on-whole-field "Subject" ".*SDP \\(MS .\\|final\\) evaluation" "sdpEval")
138 ;(: split-on-whole-field "Subject" ".*[[]SDP[]] \\(Your evaluation\\|Evaluation deadline\\).*" "sdpEval") 138 ;(: split-on-whole-field "Subject" ".*[[]SDP[]] \\(Your evaluation\\|Evaluation deadline\\).*" "sdpEval")
139 ;(: split-on-whole-field "Subject" ".*SDP.*" "sdp") 139 ;(: split-on-whole-field "Subject" ".*SDP.*" "sdp")
140 ;(: split-on-whole-field "Subject" ".*Welcome to ANLP, action needed.*" "anlp_github") 140 ;(: split-on-whole-field "Subject" ".*Welcome to ANLP, action needed.*" "anlp_github")
141 ;(: split-on-whole-field "Subject" ".*ANLP.*" "anlp") 141 (: split-on-whole-field "Subject" ".*\\(ANLP\\|Accelerated Natural Language Processing\\).*" "anlp")
142 ;(from "ANLP on Piazza" "anlp") 142 (from "ANLP on Piazza" "anlp")
143 ;(from "FNLP on Piazza" "fnlp") 143 ;(from "FNLP on Piazza" "fnlp")
144 (from "ititov\\|v.dankers\\|m.m.lindemann" "fnlp") 144 (from "alopez\\|learn\\|scohen\\|eponti" "anlp")
145 ;(from "no-reply@piazza.com" "anlp") 145 (from "080202022-3SV1SEM2" "inf1-cg")
146 (: split-on-whole-field "Subject" ".*Personal Tutor.*" "tutees20") 146 (from "INFR111252023-4SV1SEM1" "anlp")
147 (: split-on-whole-field "Subject" ".*Course Selection.*" "tutees20") 147 (from "no-reply@piazza.com" "anlp")
148 (: split-on-whole-field "Subject" ".*Personal Tutor.*" "tutees22")
149 (: split-on-whole-field "Subject" ".*Course Selection.*" "tutees22")
148 ;(: split-on-whole-field "Subject" ".*Sutton Trust.*" "inf-recruit") 150 ;(: split-on-whole-field "Subject" ".*Sutton Trust.*" "inf-recruit")
149 (: split-on-whole-field "Subject" "mycron .*" "cron") 151 (: split-on-whole-field "Subject" "mycron .*" "cron")
150 ;(: split-on-whole-field "Subject" "INF1-Cg experiment.*" "cgx_2013") 152 ;(: split-on-whole-field "Subject" "INF1-Cg experiment.*" "cgx_2013")
151 (: split-on-whole-field "Subject" ".*[[]urn[]].*" "urn") 153 (: split-on-whole-field "Subject" ".*[[]urn[]].*" "urn")
152 (from "\\(106300.457@compuserve.com\\|elizdrummondyoung@gmail.com\\|jcdavey12@btinternet.com\\|andrewdolan@btinternet.com\\|wandbamoyes@btinternet.com\\)" "albertus") 154 (from "\\(106300.457@compuserve.com\\|elizdrummondyoung@gmail.com\\|jcdavey12@btinternet.com\\|andrewdolan@btinternet.com\\|wandbamoyes@btinternet.com\\)" "albertus")
199 ;(to "jdee-users@lists.sourceforge.net" "jde") 201 ;(to "jdee-users@lists.sourceforge.net" "jde")
200 (to "tagsoup-friends@yahoogroups.com" "tagsoup") 202 (to "tagsoup-friends@yahoogroups.com" "tagsoup")
201 (to "screen-users@gnu.org" "screen") 203 (to "screen-users@gnu.org" "screen")
202 (from "mailinglist@edinburghrc.co.uk" "erc") 204 (from "mailinglist@edinburghrc.co.uk" "erc")
203 (to "selenium-users" "selenium") 205 (to "selenium-users" "selenium")
206 (to "python-list@python.org" "python")
204 ;(to "ding" "gnus") 207 ;(to "ding" "gnus")
205 ;(to "dssslist" "dsssl") 208 ;(to "dssslist" "dsssl")
206 ;(to "TEI-L" "tei") 209 ;(to "TEI-L" "tei")
207 (to "\\(announcements\\|unicode\\)@.*[.]unicode[.]org" "unicode") 210 (to "\\(announcements\\|unicode\\)@.*[.]unicode[.]org" "unicode")
208 ;(to "squid-users@lists.squid-cache.org\\|squid-users@squid-cache.org" 211 ;(to "squid-users@lists.squid-cache.org\\|squid-users@squid-cache.org"
229 (format-time-string "%Y-%m" (current-time))) 232 (format-time-string "%Y-%m" (current-time)))
230 (now-group (concat "group-" month)) 233 (now-group (concat "group-" month))
231 (now-pers (concat "pers-" month))) 234 (now-pers (concat "pers-" month)))
232 `(| 235 `(|
233 (: split-on-whole-field "Subject" "testing" "junk") 236 (: split-on-whole-field "Subject" "testing" "junk")
237 (: ad-spam "adverts")
234 ;;; ("Content-Type" content-spam "gnSPAM") 238 ;;; ("Content-Type" content-spam "gnSPAM")
235 ;;; ("Content-Transfer-Encoding" encoding-spam "gnSPAM") 239 ;;; ("Content-Transfer-Encoding" encoding-spam "gnSPAM")
236 ;;; (: split-on-whole-subj 'subject-spam "gnSPAM") 240 ;;; (: split-on-whole-subj 'subject-spam "gnSPAM")
237 ;; Special to people who use Yahoo 241 ;; Special to people who use Yahoo
238 ;;; ("X-YahooFilteredBulk" ".*" "gnSPAM") 242 ;;; ("X-YahooFilteredBulk" ".*" "gnSPAM")
266 ,now-group 270 ,now-group
267 )))) 271 ))))
268 272
269 (set-ht-compiled-split) 273 (set-ht-compiled-split)
270 274
275 (defconst ht-spam-res '("bfSPAM" "boSPAM" "edSPAM" "saSPAM" "slSPAM"))
276
271 (setq nnmail-split-fancy 277 (setq nnmail-split-fancy
272 '(! 278 '(|
279 (to "ht\\+d@inf\\.ed\\.ac\\.uk" "_diary")
280 (!
273 (lambda (sres) 281 (lambda (sres)
274 (if (or (equal (car sres) "notSPAM") 282 (cond
275 (equal (car sres) "waSPAM")) 283 ((or (equal (car sres) "notSPAM")
276 ;; documentation is wrong, no recursion, 284 (white-spam t))
277 ;; so we do it ourselves :-( 285 ;; documentation is wrong, no recursion,
278 (nnmail-split-it ht-compiled-split) 286 ;; so we do it ourselves :-(
279 sres)) 287 (message "was %s, trying further" sres)
280 (| (to "ht\\+d@inf\\.ed\\.ac\\.uk" "_diary") 288 (setq sres (nnmail-split-it ht-compiled-split))
281 (: ad-spam "adverts") 289 (log-good-sender sres)
282 (: split-on-whole-field "Subject" ".*=\\?UTF-8\\(\\?B\\\?\\|.*=[A-F][0-9]=\\).*\\?=.*" "slSPAM") 290 sres)
283 (: white-spam "waSPAM") 291 ((member (car sres) ht-spam-res)
292 sres)
293 (t ; shouldn't happen!
294 (message "Shouldn't happen in nnmail-split-fancy %s" sres)
295 sres))
296 )
297 (| (: split-on-whole-field "Subject" ".*=\\?UTF-8\\(\\?B\\\?\\|.*=[A-F][0-9]=\\).*\\?=.*" "slSPAM")
284 ("X-Bogosity" "Yes.*" 298 ("X-Bogosity" "Yes.*"
285 (| 299 (|
286 (From ".*ed\.ac\.uk" "edSPAM") ; NB From not from 300 (From ".*@.*ed\.ac\.uk" "edSPAM") ; NB From not from
287 ("X-Spam-Score" "0" "boSPAM") 301 ("X-Spam-Score" "0" "boSPAM")
288 "bfSPAM")) 302 "bfSPAM"))
289 (: split-on-whole-field "X-Spam-Level" "\\*\\*\\*\\*.*" 303 (: split-on-whole-field "X-Spam-Level" "\\*\\*\\*\\*.*"
290 "saSPAM") 304 "saSPAM")
291 ("X-Spam-Status" "Yes.*" "saSPAM") 305 ("X-Spam-Status" "Yes.*" "saSPAM")
292 "notSPAM"))) 306 "notSPAM"))))
307
308 (defun log-good-sender (sres)
309 (message "good sender %s with result %s" (get-from-gnus-addr) sres))
293 310
294 (setq gnus-show-mime t) ; stale 311 (setq gnus-show-mime t) ; stale
295 (setq mml1991-use 'pgg 312 (setq mml1991-use 'pgg
296 mml2015-use 'pgg 313 mml2015-use 'pgg
297 mm-verify-option 'always) 314 mm-verify-option 'always)
301 318
302 (custom-set-faces) 319 (custom-set-faces)
303 320
304 (defun straight-to-diary () 321 (defun straight-to-diary ()
305 (save-excursion 322 (save-excursion
306 (gnus-group-goto-group "nnml+ht:_diary") 323 (gnus-group-jump-to-group "nnml+ht:_diary")
324 (message "s1 %s" (get-text-property (point) 'gnus-group))
307 (gnus-group-select-group) 325 (gnus-group-select-group)
308 (while (gnus-summary-first-unread-article) 326 (while (gnus-summary-first-unread-article)
309 (let ((sco (get-buffer "*Shell Command Output*"))) 327 (let ((sco (get-buffer "*Shell Command Output*")))
310 (if sco 328 (if sco
311 (kill-buffer sco))) 329 (kill-buffer sco)))