Gnus development mailing list
 help / color / mirror / Atom feed
* Scoring on basee64 encoded message body
@ 2012-03-13 10:39 Jan Tatarik
  2012-03-14 14:38 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Tatarik @ 2012-03-13 10:39 UTC (permalink / raw)
  To: ding


[-- Attachment #1.1: Type: text/plain, Size: 410 bytes --]

Hi,

I just spent some time trying to get scoring by message body work in one of
my nnimap groups.

I finally realized the content of the messages is base64 encoded, so
matching on the raw body cannot work.

The attached patch fixes the problem for me, but I have no idea whether
it's a generally acceptable solution. I'm only using the body match in a
low-traffic group, so speed is not an issue for me.

Jan

[-- Attachment #1.2: Type: text/html, Size: 534 bytes --]

[-- Attachment #2: score-body-base64-encoded.diff --]
[-- Type: application/octet-stream, Size: 1142 bytes --]

diff --git a/lisp/gnus-logic.el b/lisp/gnus-logic.el
index 954295438c953c2500b9c1959a49e52312cc9653..85a1f83466a246c26be5f8b05263a045c7928f0e 100644
--- a/lisp/gnus-logic.el
+++ b/lisp/gnus-logic.el
@@ -204,6 +204,8 @@
 	      (narrow-to-region
 	       (point)
 	       (or (search-forward "\n\n" nil t) (point-max)))
+        (when (string= (gnus-fetch-field "content-transfer-encoding") "base64")
+          (article-de-base64-unreadable t))
 	    (narrow-to-region
 	     (or (search-forward "\n\n" nil t) (point))
 	     (point-max))))
diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el
index f86b6f837a70ce54b06668187821fe57c3f80f4c..231c942bb34c97d66563ca7a399c9808b1f66663 100644
--- a/lisp/gnus-score.el
+++ b/lisp/gnus-score.el
@@ -1781,6 +1781,8 @@ score in `gnus-newsgroup-scored' by SCORE."
 		      (narrow-to-region
 		       (point)
 		       (or (search-forward "\n\n" nil t) (point-max)))
+            (when (string= (gnus-fetch-field "content-transfer-encoding") "base64")
+              (article-de-base64-unreadable t))
 		    (narrow-to-region
 		     (or (search-forward "\n\n" nil t) (point))
 		     (point-max))))

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-09-05 15:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-13 10:39 Scoring on basee64 encoded message body Jan Tatarik
2012-03-14 14:38 ` Lars Magne Ingebrigtsen
2012-03-14 20:21   ` Reiner Steib
2012-03-15  1:29     ` Lars Magne Ingebrigtsen
2012-03-15 21:05   ` Jan Tatarik
2012-03-22 20:38     ` Lars Magne Ingebrigtsen
2012-03-23 12:11       ` Jan Tatarik
2012-04-10 19:32         ` Lars Magne Ingebrigtsen
2012-04-11  7:30           ` Jan Tatarik
2012-04-11 19:34           ` Jan Tatarik
2012-04-12 18:45             ` Lars Magne Ingebrigtsen
2012-04-12 22:58               ` Jan Tatarik
2012-06-10 21:08                 ` Lars Magne Ingebrigtsen
2012-06-28  9:45                   ` Jan Tatarik
2012-09-05 13:40                     ` Lars Ingebrigtsen
2012-09-05 14:39                       ` Jan Tatarik
2012-09-05 14:43                         ` Lars Ingebrigtsen
2012-09-05 15:07                           ` Jan Tatarik
2012-09-05 15:35                             ` Lars Ingebrigtsen
2012-09-05 15:42                           ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).