[Top][All Lists]

[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: Wed, 14 Feb 2007 03:42:15 -0600 (CST)

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

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.

It can be implemented easily [1], however I
strongly doubt that would be right.  As I said,
the 'From ' marker is not a message header, so I
see no reason why -h, which is supposed to show
all *headers*, should display it as
well. Besides, as I said earlier, in the
majority of mailbox formats, there's no 'From '
marker at all...

Thank you for patches [1] and [2].  I hope to be
able to try them in the next day or two.

I certainly understand the principled distinction
you are making between genuine RFC-2822 headers
and the BSD mbox 'From ' marker, as this relates
to the -h option.  I also understand your point
that the 'From ' marker is unnecessary for
anything but BSD mbox format mail files.

Nonetheless, I would observe that the elm
version of readmsg is quite useful for copying
verbatim one or more messages from one mbox-format
mailbox into another mbox-format mailbox, using the
-h option.  It would be useful to have similar
functionality in the GNU Mailutils readmsg,
regardless of which option flag must be requested to
access this functionality, because eventually,
maintenance of elm will likely cease.

As I mentioned obliquely in my prior post, the GNU
Mailutils readmsg (with your patch dated Mon, 12 Feb
2007 10:40:35 +0200 applied) appears to provide the
same functionality, but instead of using the -h
option, the user must request the -w 'From_ \'
option.  It probably wouldn't much matter to most
users whether they use -h or -w 'From_ \', but this
behavior of -w appears to be accidental or at least
undocumented.  Therefore, new users would not know
how to access this functionality, and even users
already aware of the functionality and how to access
it are not assured that the functionality won't be
removed, inadvertently or otherwise, in the future.
Is there a mechanism to make this an "official"
feature/functionality/behavior of readmsg so that the
feature/functionality/behavior will persist?

     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_ \' .

No, this does not work.  But this does:

      readmsg -h -w From_

On my test system (Debian Sarge), after the patch
you offered on 12 Feb 2007, the invocation

  readmsg -w 'From_ \' -f source.mbox 5 6 7 >destination.mbox

copies messages 5, 6, and 7 from source.mbox to
destination.mbox with the 'From ' marker *and* all
headers intact.  I haven't yet tried your patch
[2] of 13 Feb 2007; I wonder if -w 'From_ \' still works.

     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.

Which ones, exactly?

The ones I mentioned prior:  " ' !

     Including " or ' in the
     argument to -w provokes a segfault.

I have fixed it [2]. Thanks for reporting.

     Including ! in the argument appears to artificially
     terminate the list; anything thereafter is

The specification of '!' i\'''''''''''''''n the original
documentation is rather obscure: in particular,
the precedence of the operator is not specified.
It is not clear, for example, whether the two
specifications '!X-From- X-From' and 'X-From
!X-From-' are different.

In my implementation, negation has higher
precedence than normal patterns, so to include
all headers, matching 'X-From*', except those
matching 'X-From-*' one should use:

  -w '!X-From- X-From'

I have not seen documentation for readmsg that
specifies that the arguments to -w are treated as
"patterns", so I wasn't aware that ! is intended
to be special.  I was looking at the info page and
the (Debian) man page for readmsg.  Perhaps I
wasn't looking at the correct docs; if so, I

Thanks again for your help and the quick patches.

Best regards,

--Neil R. Ormos

reply via email to

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