[PATCH] emacs: Modify notmuch-show-get-message-id to return message-id unprefixed with "id:".

Tomi Ollila tomi.ollila at iki.fi
Fri Oct 28 04:21:47 PDT 2011


On Fri 28 Oct 2011 14:06, Daniel Schoepe <daniel at schoepe.org> writes:

> On Wed, 26 Oct 2011 19:52:59 -0700, Jameson Graef Rollins
> <jrollins at finestructure.net> wrote:
>> In point of fact, do we need these quotes around message IDs at all?
>> Can message IDs have characters that would need to be escaped for the
>> shell?
>
> Message ID syntax is defined in RFC 2822[1]:
...
> As far passing things to the shell goes:
>
>> atext           =       ALPHA / DIGIT / ; Any character except controls,
>>                         "!" / "#" /     ;  SP, and specials.
>>                         "$" / "%" /     ;  Used for atoms
>>                         "&" / "'" /
>>                         "*" / "+" /
>>                         "-" / "/" /
>>                         "=" / "?" /
>>                         "^" / "_" /
>>                         "`" / "{" /
>>                         "|" / "}" /
>>                         "~"
>> 
>> atom            =       [CFWS] 1*atext [CFWS]
>> 
>> dot-atom        =       [CFWS] dot-atom-text [CFWS]
>> 
>> dot-atom-text   =       1*atext *("." 1*atext)
>
> So, they can contain things like "$foo@$bar", which will be mangled if
> passed to the shell, even with double quotes.

atext includes ' -- how inconvenient for shell's sake. Indeed, the
"":s does noe disallog $var expansion, but avoids potential problems
with ', |, & and ` (and smaller problems with ~, *,  + and ?).
Without ' allowed in msg-id writing arg between '':s in shell command
line would have been convenient.

Now that ":s are removed from the id: argument, maybe also '<' and
">" could be removed... (or was it xapian which handles this?)

>
> [1] http://tools.ietf.org/html/rfc2822#section-3.6.4
>
> Cheers,
> Daniel

Tomi


More information about the notmuch mailing list