Subject: bug#7746: SERIOUS BUG: mail-strip-quoted-names bug causing unrmail to lose mail

From: Mark Lillibridge <[email-masked]>
Date: Sun, 02 Jan 2011 16:18:29 -0800

>  close 7746
>  thanks
>  
>  > This code erases the buffer " *temp*" even if it is being used by
>  > another piece of code!  This is particularly bad because this is the
>  > first buffer used by with-temp-buffer.
>  
>  Indeed, that's wrong, thanks for spotting it.  I've installed your
>  suggested patch (see below) into the emacs-23 branch (for Emacs-23.3).
>  
>  BTW, I'm wondering why the code handles nesting in this way.  Can you
>  try the second patch below (you may need to hand-apply it since it's
>  based on the new code I just installed), to confirm that it works just
>  as well?

    I looked up rfc822 comments on the web and found at
http://www.w3.org/Protocols/rfc822/3_Lexical.html:

comment     =  "(" *(ctext / quoted-pair / comment) ")"

ctext       =  <any CHAR excluding "(",     ; => may be folded
                ")", "\" & CR, & including
                linear-white-space>

quoted-pair =  "\" CHAR                     ; may quote any char

After some thought, I figured out why you your code doesn't work:

  it turns "( \(  )" into "( \"

You might be able to fix this problem using subgroups, but it's going to
be fairly tricky code.

- Mark