procmail
[Top] [All Lists]

RE: Fixing RE: RE: RE:

2007-05-27 12:19:18
M. Fioretti wrote Sunday, May 27, 2007 3:56 PM:

On Sun, May 27, 2007 14:24:38 PM +0200, Dallman Ross
(dman(_at_)nomotek(_dot_)com) wrote:

I'm pretty sure the idea of fixing "RE: RE: RE(3)" in Subjects has
been discussed a few times in the past. The archives could be 
consulted.

I am interested in this too. Out of curiosity, I have just
tried with Google to look for "procmail fixing re: subject" 
and only found this


http://gentoo-wiki.com/Procmail_configuration#Fix_incorrect_Subject_Lines

so if anybody could post other URLs to other variations or
better search strings it could be useful.


I was suggesting the searchable list archives at http://www.procmail.org/
.
I just went there and was surprised to see they are unavailable.
Sean?  What's up with that?


Personally, however, I have one question about your 
procmail-only solution. Mailer in other languages use other 
prefixes, like "R:" or "AW:", so I often receive subjects 
with *any* sequence of all these, depending on the thread:

Subject: Re: Aw: R: Re: Re: Aw: Aw: R: ......

How do we generalize your recipe to handle this?

 :0
 * $ ^Subject:([$WS]*RE([(][0-9]+[)])*:(.*\<)?\/[^R0-9$WS:].*
 | formail -I "Subject: RE: $MATCH"

Would it be enough to replace the RE part with something like
(RE|AW|R) or what else?

Mine would need more than that to do what you want.  But as
Ruud has since pointed out, mine is flawed.  His is better
and easier to customize.

  :0 h fw
  * $ ^Subject:\/([$WS]*Re([(][0-9]+[)])*:)+
  * MATCH ?? Re.*Re
  * $ ^Subject:$\MATCH\/.*
  | formail -I "Subject: Re:$MATCH"

Basically, we ought to be abstractifying the "RE" strings,
like so:

  SPACE = ' '
  TAB = '       '
  WS = $SPACE$TAB
  RE = (Re|Fwd|Aw)
  RESTRING = ([$WS]*$RE([(][0-9]+[)])*:)+

  :0 h fw
  * $ ^Subject:\/$RESTRING
  * $ MATCH ?? $RE.*$RE
  * $ ^Subject:$\MATCH\/.*
  | formail -I "Subject: Re:$MATCH"

Now you can put whatever you want in the definition for $RE.

Dallman


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>