Gnus development mailing list
 help / color / mirror / Atom feed
* [patch] gnus-art.el handling for t-online addresses
@ 2003-05-04  9:36 Jhair Tocancipa Triana
  2003-05-04 12:17 ` Reiner Steib
  0 siblings, 1 reply; 4+ messages in thread
From: Jhair Tocancipa Triana @ 2003-05-04  9:36 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

Hi,

Gnus v.5.10.2  fails to recognize  as valid[1] an e-mail  address from
T-Online, when pushing the button on it:

| Johannes Brinkmeier-Moritz <Johannes.Brinkmeier-Moritz@t-online.de> schrieb:

Patch and proposed ChangeLog entry are attached.

Regards,

-- 
--Jhair

[1] http://service.t-online.de/t-on/hilf/faq/emai/cc/cc-email-faq1 (it
just describes valid t-online addresses)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-art.diff --]
[-- Type: text/x-patch, Size: 1639 bytes --]

2003-01-13  Jhair Tocancipa Triana <jhair_tocancipa@gmx.net>

	* gnus-art.el: (gnus-button-mid-or-mail-heuristic-alist): New
        regexp to handle t-online aliases.

        * gnus-art.el: (gnus-button-mid-or-mail-heuristic): Special cases
        moved to gnus-button-mid-or-mail-heuristic-alist.

--- gnus-art.el	3 May 2003 16:47:19 -0000	6.346
+++ gnus-art.el	4 May 2003 09:27:43 -0000
@@ -5749,7 +5749,11 @@
     (0.5   . "^[A-Z][a-z]")
     (0.5   . "^[A-Z][a-z][a-z]")
     (1.5   . "^[A-Z][a-z][A-Z][a-z][^a-z]") ;; ^[A-Z][a-z]{3,3}
-    (2.0   . "^[A-Z][a-z][A-Z][a-z][a-z][^a-z]")) ;; ^[A-Z][a-z]{4,4}
+    (2.0   . "^[A-Z][a-z][A-Z][a-z][a-z][^a-z]") ;; ^[A-Z][a-z]{4,4}
+    ;; Certain special cases...
+    (30.0  . "^0[0-9]+-[0-9][0-9][0-9][0-9]@t-online\\.de$") 
+    (30.0  . "^[A-Za-z]+[A-Za-z._-]\\{4,29\\}@t-online\\.de$") 
+    (30.0  . "^[0-9]+\.[0-9]+\@compuserve"))
   "An alist of \(RATE . REGEXP\) pairs for `gnus-button-mid-or-mail-heuristic'.
 
 A negative RATE indicates a message IDs, whereas a positive indicates a mail
@@ -5768,14 +5772,6 @@
     (setq lpartlen
 	  (length (gnus-replace-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1")))
     (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen)
-    ;; Certain special cases...
-    (when (string-match
-	   (concat
-	    "^0[0-9]+-[0-9][0-9][0-9][0-9]@t-online\\.de$" "\\|"
-	    "^[0-9]+\.[0-9]+\@compuserve")
-	   mid-or-mail)
-      (gnus-message 8 "`%s' is a known mail address.")
-      (setq result 'mail))
     (when (string-match "@.*@\\| " mid-or-mail)
       (gnus-message 8 "`%s' is invalid.")
       (setq result 'invalid)) 

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

* Re: [patch] gnus-art.el handling for t-online addresses
  2003-05-04  9:36 [patch] gnus-art.el handling for t-online addresses Jhair Tocancipa Triana
@ 2003-05-04 12:17 ` Reiner Steib
  2003-05-04 12:50   ` Jhair Tocancipa Triana
  2003-05-04 16:37   ` Florian Weimer
  0 siblings, 2 replies; 4+ messages in thread
From: Reiner Steib @ 2003-05-04 12:17 UTC (permalink / raw)
  Cc: Florian Weimer

On Sun, May 04 2003, Jhair Tocancipa Triana wrote:

> Gnus v.5.10.2 fails to recognize as valid[1] an e-mail address from
> T-Online, when pushing the button on it:
[ <Johannes.Brinkmeier-Moritz@t-online.de> ]
> Patch and proposed ChangeLog entry are attached.

Thanks.  Some comments and questions...

As it's name says, `gnus-button-mid-or-mail-heuristic' is a heuristic
function.  It's not intended to cover every special case.  BTW: In
your example the function returns 'ask, which isn't really wrong. :-)

| +    ;; Certain special cases...
| +    (30.0  . "^0[0-9]+-[0-9][0-9][0-9][0-9]@t-online\\.de$") 
| +    (30.0  . "^[A-Za-z]+[A-Za-z._-]\\{4,29\\}@t-online\\.de$") 
| +    (30.0  . "^[0-9]+\.[0-9]+\@compuserve"))

We can't use \\{4,29\\} because we still support Emacs 20 (and maybe
some XEmacs versions?) that don't support this.  See the ugly
re-formulations of {M,N} expressions.

But maybe, we don't have to be that careful and use
"^[A-Za-z]+[A-Za-z._-][A-Za-z._-][A-Za-z._-][A-Za-z._-]+@t-online\\.de$"
instead?

The current implementation is very close to Florian Weimer's Perl
script[1].  Why do think that it's better to put "Certain special
cases" into the list?

[ Cc'ing Florian (dunno if he's reading ding). ]

| -    ;; Certain special cases...
| -    (when (string-match
| -	   (concat
| -	    "^0[0-9]+-[0-9][0-9][0-9][0-9]@t-online\\.de$" "\\|"
| -	    "^[0-9]+\.[0-9]+\@compuserve")

Maybe we should make this customizable, too?

Bye, Reiner.

[1] <URL: http://www.enyo.de/fw/scripts/message-id-or-email.pl>
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




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

* Re: [patch] gnus-art.el handling for t-online addresses
  2003-05-04 12:17 ` Reiner Steib
@ 2003-05-04 12:50   ` Jhair Tocancipa Triana
  2003-05-04 16:37   ` Florian Weimer
  1 sibling, 0 replies; 4+ messages in thread
From: Jhair Tocancipa Triana @ 2003-05-04 12:50 UTC (permalink / raw)


Reiner Steib writes:

> As   it's  name   says,  `gnus-button-mid-or-mail-heuristic'   is  a
> heuristic function.  It's not intended to cover every special case.

Well,  that  depends  on  what  is understood  under  "special  case".
"^Pine", ""^slrn" and  "\\.fsf@" sound like special cases  to me. Well
this in the eye of the beholder :-).

> We can't use \\{4,29\\} because we still support Emacs 20 (and maybe
> some XEmacs versions?) that don't support this.  See the ugly
> re-formulations of {M,N} expressions.

> But maybe, we don't have to be that careful and use
> "^[A-Za-z]+[A-Za-z._-][A-Za-z._-][A-Za-z._-][A-Za-z._-]+@t-online\\.de$"
> instead?

Yep, this would also suffice.

> The current implementation is very close to Florian Weimer's Perl
> script[1].  Why do think that it's better to put "Certain special
> cases" into the list?

It was just a matter of style, to make gnus-button-mid-or-mail-heuristic cleaner.

Regards,

-- 
--Jhair

Public Key fingerprint:
81FF 3ADF BF6B CECB C593  4018 27AE D7D2 BAA6 00D0




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

* Re: [patch] gnus-art.el handling for t-online addresses
  2003-05-04 12:17 ` Reiner Steib
  2003-05-04 12:50   ` Jhair Tocancipa Triana
@ 2003-05-04 16:37   ` Florian Weimer
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Weimer @ 2003-05-04 16:37 UTC (permalink / raw)


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> As it's name says, `gnus-button-mid-or-mail-heuristic' is a heuristic
> function.  It's not intended to cover every special case.  BTW: In
> your example the function returns 'ask, which isn't really wrong. :-)

In fact, I did this on purpose.  Quite a few news clients allocate
Message-IDs in the t-online.de domain, and I couldn't tell these
Message-IDs from T-Online email addresses.

> But maybe, we don't have to be that careful and use
> "^[A-Za-z]+[A-Za-z._-][A-Za-z._-][A-Za-z._-][A-Za-z._-]+@t-online\\.de$"
> instead?

I think this regexp is too broad, it will catch a few Message-IDs
too. 8-(



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

end of thread, other threads:[~2003-05-04 16:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-04  9:36 [patch] gnus-art.el handling for t-online addresses Jhair Tocancipa Triana
2003-05-04 12:17 ` Reiner Steib
2003-05-04 12:50   ` Jhair Tocancipa Triana
2003-05-04 16:37   ` Florian Weimer

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