[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automatic MIME decoding in rmail

From: Evil Boris
Subject: Re: automatic MIME decoding in rmail
Date: Sun, 09 Apr 2006 17:32:18 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

> Stefan Monnier  writes:
>     As far as I know, it's is prefectly valid to add any random number of
>     arbitrary non-standard args.  So "format=[a-z]+" is too restrictive.

The RFC (3676) that defines format=fixed or format=flowed also
mentions delsp=yes or delsp=no.  Looking around, but not too
carefully, I have not found any other allowed arguments, for

I think there are two alternatives.  One is to try and enumerate the
allowed args explicitly (please do not forget to surround the
argument values with optional quotes, as they are commonly used, e.g.,
allowing both format=flowed and format="flowed".  (I.e., modify
Richard's expression by allowing quotes and delsp=... .)

Alternatively, some sensible expression that would match a general set
of arguments such as what Stefan suggests.

I tried the first alternative with expression:

 (concat "^content-type:[ ]*text/plain;\\(?:[ \t\n]*format=\"?[a-z]+\"?;\\)?"
                 "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?")

and had no trouble so far, though I receive very few msgs in this
format and perhaps the regex only got exercised once or twice for the
class of msgs we are discussing.  A more general expression including
delsp would look something like this:

 (concat "^content-type:[ ]*text/plain;"
         "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[a-z]+\"?;\\)?"
         "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?")

One could imagine even specifying the two legal values for formal and
delsp, but this seems like overkill...

Should one of the above versions be incorporated in CVS?  If it already
has been, my apologies...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]