bug-mailutils
[Top][All Lists]
Advanced

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

Re: [bug-mailutils] Is this a Bug? Readmsg Omits From Line


From: Neil R. Ormos
Subject: Re: [bug-mailutils] Is this a Bug? Readmsg Omits From Line
Date: Mon, 12 Feb 2007 15:09:51 -0600 (CST)

Sergey Poznyakoff wrote:
Neil R. Ormos <address@hidden> wrote:

In at least one historical version of readmsg,
the -h option flag causes readmsg to copy the
"^From .*" line to the output, as does the -w
"From_" option.  By the "^From .*" line I mean
the line that signals the start of a new
message in an mbox-format mailbox file, not the
From: header line.

It is due to the basic differences between MU
implementation of readmsg and other versions.
First of all, MU readmsg is able to process
mailboxes of different formats.  All of them,
except UNIX mailboxes, do not contain 'From '
line.  Secondly, -w is said to select *headers*
from the message, and the 'From ' marker in a
UNIX mailbox is not a header at all.

I don't know whether this is intended behavior
or a bug.  The manual page does not specify
whether the "^From .*" line is supposed to be
copied to the output

Mailutils readmsg was planned as a full-fledged
replacement for the elm implementation.  From
this point of view, it surely must support -w
From_ notation (whenever it is possible).

1.  Thank you for the quick response and for the
    patch to fix the -w option.

2.  I don't mean to seem ungrateful, but what
    about the -h option?  The elm implementation
    of readmsg also copies the 'From ' marker if
    the -h option is supplied.  If Mailutils
    readmsg is intended to be a superset of elm
    readmsg, users may reasonably expect the -h
    option to duplicate the behavior of the elm
    implementation when the user desires to
    extract a verbatim copy of specified messages.

    I suppose that a reasonable workaround for
    extracting a verbatim copy of specified
    messages is to use an appropriate argument to
    -w, specifically -w 'From_ \' .  I have no
    idea why this works, but it does seem to copy
    the message verbatim, including the 'From '
    marker and all the headers.

    I would have thought that
      -w 'From_ a b c d ...' etc.
    should also work, and it mostly does, but some
    non-alpha characters are handled incorrectly.
    I have never seen mail headers start with a
    non-alpha character, but the RFCs apparently
    allow it; there appear to be 93 or so
    characters that can begin a header field name,
    although the alphas are case-folded, so only
    67 need be specified.  Including " or ' in the
    argument to -w provokes a segfault. Including
    ! in the argument appears to artificially
    terminate the list; anything thereafter is
    ignored.

The enclosed patch adds the `-w From_'
functionality.  When there is no `From ' marker
(e.g. when reading a Maildir folder), readmsg
will attempt to construct one from the available
data.  Notice that this may not always be
possible.

I will commit the improved version of this patch
later.

Thanks again.

Best regards,

--Neil Ormos




reply via email to

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