Gnus development mailing list
 help / color / mirror / Atom feed
* nnmail-split-header-length-limit is EVIL!
@ 1999-03-02 10:57 Hrvoje Niksic
  1999-03-06 18:16 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Hrvoje Niksic @ 1999-03-02 10:57 UTC (permalink / raw)


My fancy mail splitting rules have a simple spam protection in the
form of:

(setq nnmail-split-fancy
      '(
        ... many rules here ...
        ("to\\|cc" "hniksic\\|niksic" "private")
        "spam"))

However, `nnmail-split-header-length-limit' feature does me the
"service" of removing the headers longer than 512 bytes, which in my
case means that mail from friends that happens to be Cc'ed to a bunch
of other friends gets thrown into spamhole.  Very nice, da?

The source explains that this is done because Gnus uses
"pathologically complex regexps" in the buffer.  So I thought, "Hey!
Why not write my own split rule that simply *searches* the buffer for
the appropriate header, and then searches for my name?  No regexps, no 
nothing!"

However, that *doesn't work* because Gnus *always* clips the header to
512 bytes, no matter what splitting rule is applied.  And that's evil,
evil, EVIL because it leaves me *no* way to match my headers
correctly.  And I found it only *after* I wrote this beautiful code:

(setq nnmail-split-fancy
      '(
        ... many rules here ...
        (: (lambda ()
             (save-restriction
               (let ((case-fold-search t))
                 (goto-char (point-min))
                 (re-search-forward "^$")
                 (narrow-to-region (point-min) (match-beginning 0))
                 (goto-char (point-min))
                 (or (catch 'found
                       (let (limit)
                         (when (re-search-forward "^\\(To\\|Cc\\):" nil t)
                           ;; Handle continuation
                           (save-excursion
                             (while (progn (forward-line 1)
                                           (memq (char-after) '(?\  ?\t))))
                             (setq limit (point)))
                           (when (search-forward "niksic" limit t)
                             (throw 'found "private")))))
                     "spam")))))))

Is there a way to disable length limits for user-provided functions?


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

end of thread, other threads:[~1999-04-17  6:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-02 10:57 nnmail-split-header-length-limit is EVIL! Hrvoje Niksic
1999-03-06 18:16 ` Lars Magne Ingebrigtsen
1999-03-07 13:27   ` Hrvoje Niksic
1999-03-14 15:53     ` Lars Magne Ingebrigtsen
1999-03-16  7:25       ` Hrvoje Niksic
1999-03-28 15:09         ` Lars Magne Ingebrigtsen
1999-03-29 20:20           ` Hans de Graaff
1999-04-02 14:03             ` Lars Magne Ingebrigtsen
1999-04-03  7:00               ` Hans de Graaff
1999-04-17  6:16                 ` Lars Magne Ingebrigtsen
1999-04-13  7:04               ` Hrvoje Niksic
1999-04-17  6:15                 ` Lars Magne Ingebrigtsen
1999-03-30  6:05           ` Dale Hagglund
1999-03-31  3:02             ` Greg Stark
1999-03-31  7:17               ` Dale Hagglund
1999-04-01  2:54                 ` Peter Seibel
1999-04-01  7:02                   ` Dale Hagglund
1999-04-01  7:13                     ` Peter Seibel

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).