[comp.mail.mush] Dealing with old mail programs?

sbw@naucse.UUCP (Steve Wampler) (11/21/89)

I need to know if there's an easy way to have mush work a little
more nicely with old style mailers.  I regularly get mail from
several sites whose mailers don't place an empty line at the
start of the message body.  Since I don't have mush display all
headers, it just as regularly eats the first few lines of the
message.  (Particularly when the message starts out: 'Steve:...')

Is there an easy way to teach mush about these mailers?
-- 
	Steve Wampler
	{....!arizona!naucse!sbw}

argv%turnpike@Sun.COM (Dan Heller) (11/22/89)

In article <1817@naucse.UUCP> sbw@naucse.UUCP (Steve Wampler) writes:
> I need to know if there's an easy way to have mush work a little
> more nicely with old style mailers.  I regularly get mail from
> several sites whose mailers don't place an empty line at the
> start of the message body.  Since I don't have mush display all
> headers, it just as regularly eats the first few lines of the
> message.  (Particularly when the message starts out: 'Steve:...')

More specifically, you are having problems -only- when the message
starts as 'Steve:...' because if there is no blank line between that
line and the other headers, how would mush know that the line in
question is a header or not?  How would you recommend that it be
implemented?  Mush does not require a blank line between headers, 
but if there isn't one, unpredictable results may occur (as you have
noticed).  This is on reason why mush forces a blank line for you
on outgoing messages.

dan

schaefer@ogccse.ogc.edu (Barton E. Schaefer) (11/22/89)

In article <128243@sun.Eng.Sun.COM> argv@sun.UUCP (Dan Heller) writes:
} In article <1817@naucse.UUCP> sbw@naucse.UUCP (Steve Wampler) writes:
} > I need to know if there's an easy way to have mush work a little
} > more nicely with old style mailers.  I regularly get mail from
} > several sites whose mailers don't place an empty line at the
} > start of the message body.
} 
} Mush does not require a blank line between headers, 

Dan's statement is, unfortunately, only half right.

The part of mush that parses header information (for purposes of
constructing the "headers" display etc.) does not require a blank line.

The part that displays messages, copies them to files, etc., DOES
require a blank line.

Somewhere in msgs.c, in the function copy_msg():

    if (*line == '\n') {
	if (on_hdr) {	/* blank line -- end of header */

You need to make two changes. (1) At the top of copy_msg(), declare

    char *p;

(You may also wish to delete the block-scoped declarations of *p that
occur elsewhere in that function.)  (2) Change the test to

    if (*line == '\n' || (p = any(line, " \t:")) && *p != ':') {

This will handle the case of any non-header line that doesn't start out
with "Steve:".  Unless you've ignored yourself, that won't matter. :-)
-- 
Bart Schaefer          "Sometimes I think the surest sign that intelligent life
                        exists elsewhere in the universe is that none of it has
schaefer@cse.ogi.edu        tried to contact us."                     -- Calvin
(used to be cse.ogc.edu)

sbw@naucse.UUCP (Steve Wampler) (11/30/89)

From article <128243@sun.Eng.Sun.COM>, by argv%turnpike@Sun.COM (Dan Heller):
 
> More specifically, you are having problems -only- when the message
> starts as 'Steve:...' because if there is no blank line between that
> line and the other headers, how would mush know that the line in
> question is a header or not?  How would you recommend that it be
> implemented?

Well, one thing that I could live with pretty easily is to have
a list of 'legitimate' headers (set in .mushrc, say).  If it
isn't in this list, then assume it's not a header.  Of course,
it would be nice to be able to easily add to the list, since
the term 'legitimate header' is pretty vague in maildom.  If the
list is empty, then all headers are legitimate and things work
as they do now.
-- 
	Steve Wampler
	{....!arizona!naucse!sbw}

argv%turnpike@Sun.COM (Dan Heller) (11/30/89)

In article <1829@naucse.UUCP> sbw@naucse.UUCP (Steve Wampler) writes:
>From article <128243@sun.Eng.Sun.COM>, by argv%turnpike@Sun.COM (Dan Heller):
>> More specifically, you are having problems -only- when the message
>> starts as 'Steve:...' because if there is no blank line between that
>> line and the other headers, how would mush know that the line in
>> question is a header or not?  How would you recommend that it be
>> implemented?
>
>Well, one thing that I could live with pretty easily is to have
>a list of 'legitimate' headers (set in .mushrc, say).

The user cannot be responsible for dictating this sort of thing.
Mail has specific required headers and other infinitely numerous
optional headers that are legitimately part of the header of a
message.  If mush believed what the user said was a particular
set of legitimate headers, as soon as it came to an unknown header,
it would think the rest of it was part of a message and you'd be
doing all sorts of things wrong.
dan