Re: [Nmh-workers] problem with mhshow after mhfixmsg

2014-11-20 Thread David Levine
Ken wrote:

> I ... believe you are correct. I say this is fine to commit.

I'm glad it turned out to be a simple fix.

A different issue is that, in this case, mhfixmsg didn't need to
add the text/plain version of the text/html part because the
message already contained one.  Here's the original message
structure excluding most of the image parts:

 msg part  type/subtype  size description
   3   multipart/alternative1786K
 boundary="Apple-Mail-2-23735733"
 1 multipart/related1784K
 type="text/html"
 boundary="Apple-Mail-3-23735734"
 1.1   text/html  11K
 charset="iso-8859-1"
 1.2   image/tiff9350
 name="pastedGraphic1.tiff"
 disposition "inline" filename="pastedGraphic1.tiff"
 2 text/plain1168
 charset="iso-8859-1"

The problem is that the two text parts aren't alternatives of a
multipart.  I'd say that message structure is presumptuous:  it
doesn't let the recipient display the images if they can't
display the html.

Anyway, I was initially thinking that mhfixmsg couldn't deal
with this, but it can.  It should look at the type of the
multipart/related and use that as the type of the alterative.

I just committed a fix, nmh's introduction to the world of
multipart/related.

David

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] smtp submission, tls, sasl, ...

2014-11-20 Thread Lyndon Nerenberg

On Nov 20, 2014, at 8:04 PM, Paul Fox  wrote:

>> The diagnostics suck and need to be fixed.  In their defence, the
>> ':587' on the end of the address is a hint.
> 
> that doesn't appear unless -snoop is used.  and you know, i actually
> looked at the post man page for a -debug, or a -verbose.  for some
> reason i never thought to look for -snoop, which of course is on the
> send manpage anyway.  sigh.

You're right.  Post could do a lot better.  I will take a peek and see if I 
can't clear up the error messages a bit.



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] smtp submission, tls, sasl, ...

2014-11-20 Thread Paul Fox
lyndon wrote:
 > 
 > On Nov 20, 2014, at 6:01 PM, Paul Fox  wrote:
 > 
 > > right.  reporting the error precisely is hard.  but given that we're
 > > changing the default client behavior, adding a hint to the message
 > > might be appropriate:
 > > post: problem initializing server on port 587; [BHST] no servers available
 > > post: try -snoop, or check server and port configuration (see mh-tailor(1))
 > 
 > The diagnostics suck and need to be fixed.  In their defence, the
 > ':587' on the end of the address is a hint.

that doesn't appear unless -snoop is used.  and you know, i actually
looked at the post man page for a -debug, or a -verbose.  for some
reason i never thought to look for -snoop, which of course is on the
send manpage anyway.  sigh.

 > 
 > Meanwhile, I am hacking TLS support into inc's POP code, and it's
 > quickly becoming apparent the assorted bits of network-related code
 > need to be consolidated.  This gives a good opportunity to clean up
 > the server-contact configs, auth/security info, etc.  Given the
 > IETF's recent enlightenment over security, this is a great chance
 > to overhaul the code and actually leap *ahead* of the world on
 > something :-)

whoa.  i'll believe it when i see it.  :-)


=--
 paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 25.0 degrees)

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


[Nmh-workers] smtp submission, tls, sasl, ...

2014-11-20 Thread Lyndon Nerenberg

On Nov 20, 2014, at 6:01 PM, Paul Fox  wrote:

> right.  reporting the error precisely is hard.  but given that we're
> changing the default client behavior, adding a hint to the message
> might be appropriate:
> post: problem initializing server on port 587; [BHST] no servers available
> post: try -snoop, or check server and port configuration (see mh-tailor(1))

The diagnostics suck and need to be fixed.  In their defence, the ':587' on the 
end of the address is a hint.

Meanwhile, I am hacking TLS support into inc's POP code, and it's quickly 
becoming apparent the assorted bits of network-related code need to be 
consolidated.  This gives a good opportunity to clean up the server-contact 
configs, auth/security info, etc.  Given the IETF's recent enlightenment over 
security, this is a great chance to overhaul the code and actually leap *ahead* 
of the world on something :-)

--lyndon



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] configuring message submission port

2014-11-20 Thread Paul Fox
one thing (okay, a couple of things) did occur to me:

ken wrote:
 > paul wrote:
 > >i've just build/installed latest git.  now that post defaults to port
 > >587, i'm wondering how to configure the port number back to 25.  i've
 > >found the -port option to send and post, but no mention of a means
 > >to configure this in mts.conf.  
 > 
 > Well, I guess our thinking was you could always configure this in
 > your .mh_profile, e.g.:
 > 
 > send: -port 25

a personal .mh_profile doesn't seem like the right place for this. 
and while mhn.defaults would work (right?) it would sure look out of
place there.  i'm not sure what i'm suggesting, though.  adding another
central config file seems just as bad.

 > 
 > >the error, when attempting to send a message, is:
 > >
 > >post: problem initializing server; [BHST] no servers available
 > >send: message not delivered to anyone
 > >
 > >which isn't particularly indicative that it's actually the default
 > >port that's changed.
 > 
 > If you add -snoop, the errors become more verbose:
 > 
 > What now? send -server localhost -snoop
 > Trying to connect to "localhost" ...
 > Connecting to ::1:587...
 > Connection failed: Connection refused
 > Connecting to 127.0.0.1:587...
 > Connection failed: Connection refused
 > Connecting to fe80::1%lo0:587...
 > Connection failed: Connection refused
 > post: problem initializing server; [BHST] no servers available
 > send: message not delivered to anyone
 > 
 > In true nmh fashion, this was also the subject of a discussion here:
 > 
 >http://lists.nongnu.org/archive/html/nmh-workers/2009-01/msg9.html

right.  reporting the error precisely is hard.  but given that we're
changing the default client behavior, adding a hint to the message
might be appropriate:
 post: problem initializing server on port 587; [BHST] no servers available
 post: try -snoop, or check server and port configuration (see mh-tailor(1))

paul
=--
 paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 29.1 degrees)

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] configuring message submission port

2014-11-20 Thread Peter Davis
On Thu, Nov 20, 2014 at 06:42:01PM -0500, Ken Hornstein wrote:
> 
> My thinking is that if we're going to go that route, we really should
> simply make the port number be configurable; we had a user who wanted
> to speak SMTP on port 80 (yeah, I thought it was strange).

I know Fastmail.com has a smtps-proxy on port 80. This is handy if, for 
example, your network is blocking outbound access to the usual
ports.

-pd


-- 

Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] configuring message submission port

2014-11-20 Thread Lyndon Nerenberg

On Nov 20, 2014, at 3:42 PM, Ken Hornstein  wrote:

> My thinking is that if we're going to go that route, we really should
> simply make the port number be configurable; we had a user who wanted
> to speak SMTP on port 80 (yeah, I thought it was strange).

The entire internet runs over port 80.  Didn't you get the memo?

--lyndon



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] configuring message submission port

2014-11-20 Thread Ken Hornstein
>okay -- i can accept all that.
>
>but at the least the documentation needs to keep up.  mts.conf.man,
>mh-tailor, the FAQ, should all mention that the basic client
>connectivity has changed.

Fair enough; that's a valid criticism.  The FAQ is Bill's baby; it's kind
of out of date and I haven't really wanted to tackle it.  But I will take
on updating those man pages.

--Ken

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] configuring message submission port

2014-11-20 Thread Paul Fox
okay -- i can accept all that.

but at the least the documentation needs to keep up.  mts.conf.man,
mh-tailor, the FAQ, should all mention that the basic client
connectivity has changed.

paul


ken wrote:
 > >i've just build/installed latest git.  now that post defaults to port
 > >587, i'm wondering how to configure the port number back to 25.  i've
 > >found the -port option to send and post, but no mention of a means
 > >to configure this in mts.conf.  
 > 
 > Well, I guess our thinking was you could always configure this in
 > your .mh_profile, e.g.:
 > 
 > send: -port 25
 > 
 > We've been getting away with putting stuff in mts.conf ... and I'll be
 > honest, the idea of writing more code to parse entries in mts.conf really
 > does not appeal to me.
 > 
 > >the error, when attempting to send a message, is:
 > >
 > >post: problem initializing server; [BHST] no servers available
 > >send: message not delivered to anyone
 > >
 > >which isn't particularly indicative that it's actually the default
 > >port that's changed.
 > 
 > If you add -snoop, the errors become more verbose:
 > 
 > What now? send -server localhost -snoop
 > Trying to connect to "localhost" ...
 > Connecting to ::1:587...
 > Connection failed: Connection refused
 > Connecting to 127.0.0.1:587...
 > Connection failed: Connection refused
 > Connecting to fe80::1%lo0:587...
 > Connection failed: Connection refused
 > post: problem initializing server; [BHST] no servers available
 > send: message not delivered to anyone
 > 
 > In true nmh fashion, this was also the subject of a discussion here:
 > 
 >http://lists.nongnu.org/archive/html/nmh-workers/2009-01/msg9.html
 > 
 > >if adding a port specifier (does it need to be per-server?) to
 > >mts.conf is too hard, perhaps the "mts" parameter should gain a new
 > >"submission" alternative, which would always imply port 587.  "smtp"
 > >would continue to imply port 25.
 > 
 > My thinking is that if we're going to go that route, we really should
 > simply make the port number be configurable; we had a user who wanted
 > to speak SMTP on port 80 (yeah, I thought it was strange).
 > 
 > >(i've configured my local postfix listen on 587, so things are
 > >working, but it seems there's a documentation (or functionality) piece
 > >missing in MH.)
 > 
 > The problem is that there are more and more knobs you can adjust when it
 > comes to message submission (c.f. SASL, TLS, authentication, etc etc).
 > I don't think it makes sense to put those all in mts.conf.  Once you've
 > come to that realization then it's not very far to get to the point of
 > not adding any new features to mts.conf and stick with .mh_profile
 > customization for the vast majority of things.  This was sort-of hashed
 > out this July:
 > 
 >   http://lists.nongnu.org/archive/html/nmh-workers/2014-07/msg0.html
 > 
 > --Ken
 > 
 > ___
 > Nmh-workers mailing list
 > Nmh-workers@nongnu.org
 > https://lists.nongnu.org/mailman/listinfo/nmh-workers

=--
 paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 29.7 degrees)

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] configuring message submission port

2014-11-20 Thread Ken Hornstein
>i've just build/installed latest git.  now that post defaults to port
>587, i'm wondering how to configure the port number back to 25.  i've
>found the -port option to send and post, but no mention of a means
>to configure this in mts.conf.  

Well, I guess our thinking was you could always configure this in
your .mh_profile, e.g.:

send: -port 25

We've been getting away with putting stuff in mts.conf ... and I'll be
honest, the idea of writing more code to parse entries in mts.conf really
does not appeal to me.

>the error, when attempting to send a message, is:
>
>post: problem initializing server; [BHST] no servers available
>send: message not delivered to anyone
>
>which isn't particularly indicative that it's actually the default
>port that's changed.

If you add -snoop, the errors become more verbose:

What now? send -server localhost -snoop
Trying to connect to "localhost" ...
Connecting to ::1:587...
Connection failed: Connection refused
Connecting to 127.0.0.1:587...
Connection failed: Connection refused
Connecting to fe80::1%lo0:587...
Connection failed: Connection refused
post: problem initializing server; [BHST] no servers available
send: message not delivered to anyone

In true nmh fashion, this was also the subject of a discussion here:

   http://lists.nongnu.org/archive/html/nmh-workers/2009-01/msg9.html

>if adding a port specifier (does it need to be per-server?) to
>mts.conf is too hard, perhaps the "mts" parameter should gain a new
>"submission" alternative, which would always imply port 587.  "smtp"
>would continue to imply port 25.

My thinking is that if we're going to go that route, we really should
simply make the port number be configurable; we had a user who wanted
to speak SMTP on port 80 (yeah, I thought it was strange).

>(i've configured my local postfix listen on 587, so things are
>working, but it seems there's a documentation (or functionality) piece
>missing in MH.)

The problem is that there are more and more knobs you can adjust when it
comes to message submission (c.f. SASL, TLS, authentication, etc etc).
I don't think it makes sense to put those all in mts.conf.  Once you've
come to that realization then it's not very far to get to the point of
not adding any new features to mts.conf and stick with .mh_profile
customization for the vast majority of things.  This was sort-of hashed
out this July:

  http://lists.nongnu.org/archive/html/nmh-workers/2014-07/msg0.html

--Ken

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


[Nmh-workers] configuring message submission port

2014-11-20 Thread Paul Fox
i've just build/installed latest git.  now that post defaults to port
587, i'm wondering how to configure the port number back to 25.  i've
found the -port option to send and post, but no mention of a means
to configure this in mts.conf.  

the error, when attempting to send a message, is:

post: problem initializing server; [BHST] no servers available
send: message not delivered to anyone

which isn't particularly indicative that it's actually the default
port that's changed.

if adding a port specifier (does it need to be per-server?) to
mts.conf is too hard, perhaps the "mts" parameter should gain a new
"submission" alternative, which would always imply port 587.  "smtp"
would continue to imply port 25.

(i've configured my local postfix listen on 587, so things are
working, but it seems there's a documentation (or functionality) piece
missing in MH.)

paul
=--
 paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 37.9 degrees)

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] problem with mhshow after mhfixmsg

2014-11-20 Thread Ken Hornstein
>i think the fix might be a simple extension of a previous fix i made
>(c9794733) in show_multi_internal().
>[...]

I ... believe you are correct.  I say this is fine to commit.

--Ken

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] problem with mhshow after mhfixmsg

2014-11-20 Thread Paul Fox
i think the fix might be a simple extension of a previous fix i made
(c9794733) in show_multi_internal().

the crux is that no one should be reporting NOTOK for failure to
display parts that weren't actually requested.  failure should be
reserved for parts that we really attempted to display.  (i think the
default result value of NOTOK gets in the way of this, by making it
too easy to return NOTOK.  changing that default might be a path to
simplification that i haven't looked at.)

your workaround ('mhshow -part 1.1.2 -part 1.3') works because
it prevents the inner level from reporting failure, since something
has been displayed successfully.

if my thinking is correct (and it could certainly use review!), here's
a possible patch.  the only substantive change is the last stanza. 
(i've also renamed the "any_part_ok" variable to better match its
semantics.  it confused me, even though i named it in the first
place).

with this change, my original failure case now works, and "make check"
passes, but i don't know that that says enough.

paul


diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c
index b76a588..ee7dc75 100644
--- a/uip/mhshowsbr.c
+++ b/uip/mhshowsbr.c
@@ -569,7 +569,7 @@ show_multi_internal (CT ct, int alternate, int concatsw, 
int textonly,
 intalternating, nowalternate, result;
 struct multipart *m = (struct multipart *) ct->c_ctparams;
 struct part *part;
-int any_part_ok;
+int request_matched;
 CT p;
 
 alternating = 0;
@@ -586,7 +586,7 @@ show_multi_internal (CT ct, int alternate, int concatsw, 
int textonly,
  */
 
 result = alternate ? NOTOK : OK;
-any_part_ok = 0;
+request_matched = 0;
 
 for (part = m->mp_parts; part; part = part->mp_next) {
p = part->mp_part;
@@ -594,7 +594,7 @@ show_multi_internal (CT ct, int alternate, int concatsw, 
int textonly,
if (part_ok (p, 1) && type_ok (p, 1)) {
int inneresult;
 
-   any_part_ok = 1;
+   request_matched = 1;
 
inneresult = show_switch (p, nowalternate, concatsw, textonly,
  inlineonly, fmt);
@@ -623,7 +623,7 @@ show_multi_internal (CT ct, int alternate, int concatsw, 
int textonly,
}
 }
 
-if (alternating && !part && any_part_ok) {
+if (alternating && !part && request_matched) {
if (!alternate)
content_error (NULL, ct, "don't know how to display any of the 
contents");
result = NOTOK;
@@ -631,7 +631,9 @@ show_multi_internal (CT ct, int alternate, int concatsw, 
int textonly,
 }
 
 out:
-return result;
+/* if no parts matched what was requested, there can't have been
+ * any display errors, so we report OK. */
+return request_matched ? result : OK;
 }
 
 

=--
 paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 40.3 degrees)

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] Help! Beginning of Messages snipped off

2014-11-20 Thread norm
Ken Hornstein  writes:
>>I am having a problem with one one particular correspondent. When I reply
>>to his messages, the beginning of the body of my messages is snipped off.
>>
>>As an example, I am attaching:
>>
>>[...]
>>  preSend: My draft before I sent it.
>>  afterSend: What get sent
>
>These two ... do not seem to line up?  Specifically, "afterSend" contains
>lines that do not appear in preSend:
>
>This is line 4 of my reply.
>This is line 5 of my reply.
>
>I'm willing to believe we might be eating lines somewhere, but I have a
>hard time believing we're inserting them :-)

Obviously I was somehow confused. I don't know how.

>I will note preSend contains a bunch of NUL characters on the last line;
>we probably do poorly with that (and are not valid in email).

Yes, they were the culprit. When I get rid of them. All works. Thank
you very much, indeed.

They got inserted as part of a kludge I use to deal with replies, when
the message I am replying to has quotedPrintable.


Norman Shapiro

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] problem with mhshow after mhfixmsg

2014-11-20 Thread Ken Hornstein
>your explanation is great.  i'll think about what might fix it, but
>if you really think you'll be rewriting, i'm willing to let it slide
>if it gets tricky feeling.

As a short-term fix ... if you make sure you display one of the contents
of the innermost multipart/alternative as well as the part you want, it
should work fine (e.g., 'mhshow -part 1.1.2 -part 1.3' works).

--Ken

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] problem with mhshow after mhfixmsg

2014-11-20 Thread Paul Fox
ken wrote:
 > >i'm having a problem with mhshow showing some of the parts
 > >of a message, but only after the message has been run through
 > >mhfixmsg.
 > >
 > >before i start debugging mhshow (which i'm willing to do, though
 > >it will take me a while), i want to be sure that the output of
 > >mhfixmsg is valid MIME.
 > 
 > Okay, so I took a look at this and I can reproduce it.  It's not mhfixmsg's
 > fault.
 > 
 > The fault is because of the ... unusual (but valid) structure of this
 > message, and the logic inside of show_multi_internal().

thankyouthankyou.  david did some preliminary investigation, and then
punted to me (offline).  i was just about to delve in, and having been
in there before, i was sure my head would explode somewhere along the
way.  (such a mess when that happens.)

your explanation is great.  i'll think about what might fix it, but
if you really think you'll be rewriting, i'm willing to let it slide
if it gets tricky feeling.

paul

 > 
 > At the top level, this message has a multipart/alternative, and enters
 > show_multi_internal().  This sets alternating, but not alternate, which
 > is correct:
 > 
 > /*
 >  * alternate   -> we are a part inside an multipart/alternative
 >  * alternating -> we are a multipart/alternative
 >  */
 > 
 > The two sub-parts of the top-level multipart/alternative are a text/plain
 > and a multipart/related.
 > 
 > The multipart/related is decended into.  It contains a multipart/alternative
 > and multiple image/jpegs.  The sub-parts of THAT multipart/alternative are
 > a text/plain and text/html.  Both of the attempts to view the those
 > parts fail (because part_ok() returns false for both of them).
 > 
 > But THAT causes show_multi_internal() to return NOTOK.  Why?
 > Well, alternate is passed down as "true" from the top-level
 > multipart/alternative type.  The default return code for
 > show_multi_internal() is set to NOTOK if alternate is set.
 > And when processing the multipart/related, alternate is true (because
 > we're under the top-level multipart/alternative) but alternating
 > is false (because multipart/related is not an alternate part itself).
 > That short-circuits the multipart/related processing and it bails
 > out at that point; that bubbles up to the top-level alternative part
 > and you get the resulting error.
 > 
 > Are you confused?  I sure was.
 > 
 > As for a fix ... crud, I don't know.  I am reluctant to mess with that
 > alternative part processing, as it's kind of a mess (I was planning on
 > rototilling it for the next release).
 > 
 > --Ken
 > 
 > ___
 > Nmh-workers mailing list
 > Nmh-workers@nongnu.org
 > https://lists.nongnu.org/mailman/listinfo/nmh-workers

=--
 paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 40.6 degrees)

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] Help! Beginning of Messages snipped off

2014-11-20 Thread Ken Hornstein
>I am having a problem with one one particular correspondent. When I reply
>to his messages, the beginning of the body of my messages is snipped off.
>
>As an example, I am attaching:
>
>[...]
>   preSend: My draft before I sent it.
>   afterSend: What get sent

These two ... do not seem to line up?  Specifically, "afterSend" contains
lines that do not appear in preSend:

This is line 4 of my reply.
This is line 5 of my reply.

I'm willing to believe we might be eating lines somewhere, but I have a
hard time believing we're inserting them :-)

I will note preSend contains a bunch of NUL characters on the last line;
we probably do poorly with that (and are not valid in email).  Also,
there seems to be some character set conversion that happened along the
way; the outgoing draft (preSend) looks like it's in windows-1252 rather
than the final message which is in UTF-8. mhbuild won't do that (it
assumes the character set is correct) so I think something else had it's
hands on "preSend" before nmh's "send" got ahold of it.

--Ken

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] problem with mhshow after mhfixmsg

2014-11-20 Thread Ken Hornstein
>i'm having a problem with mhshow showing some of the parts
>of a message, but only after the message has been run through
>mhfixmsg.
>
>before i start debugging mhshow (which i'm willing to do, though
>it will take me a while), i want to be sure that the output of
>mhfixmsg is valid MIME.

Okay, so I took a look at this and I can reproduce it.  It's not mhfixmsg's
fault.

The fault is because of the ... unusual (but valid) structure of this
message, and the logic inside of show_multi_internal().

At the top level, this message has a multipart/alternative, and enters
show_multi_internal().  This sets alternating, but not alternate, which
is correct:

/*
 * alternate   -> we are a part inside an multipart/alternative
 * alternating -> we are a multipart/alternative
 */

The two sub-parts of the top-level multipart/alternative are a text/plain
and a multipart/related.

The multipart/related is decended into.  It contains a multipart/alternative
and multiple image/jpegs.  The sub-parts of THAT multipart/alternative are
a text/plain and text/html.  Both of the attempts to view the those
parts fail (because part_ok() returns false for both of them).

But THAT causes show_multi_internal() to return NOTOK.  Why?
Well, alternate is passed down as "true" from the top-level
multipart/alternative type.  The default return code for
show_multi_internal() is set to NOTOK if alternate is set.
And when processing the multipart/related, alternate is true (because
we're under the top-level multipart/alternative) but alternating
is false (because multipart/related is not an alternate part itself).
That short-circuits the multipart/related processing and it bails
out at that point; that bubbles up to the top-level alternative part
and you get the resulting error.

Are you confused?  I sure was.

As for a fix ... crud, I don't know.  I am reluctant to mess with that
alternative part processing, as it's kind of a mess (I was planning on
rototilling it for the next release).

--Ken

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


[Nmh-workers] Help! Beginning of Messages snipped off

2014-11-20 Thread norm
I am having a problem with one one particular correspondent. When I reply
to his messages, the beginning of the body of my messages is snipped off.

As an example, I am attaching:

messageRepliedTo: The test message I replied to.
preSend: My draft before I sent it.
afterSend: What get sent
.mh_profile my mh_profile

Although I used norms-cool-editor to prepare the draft, I do not believe
that it touched the draft between preSend and afterSend.

Norman Shapiro
--- Begin Message ---
 of my reply.
This is line 3 of my reply.
This is line 4 of my reply.
This is line 5 of my reply.

"Jeff Rothenberg"  writes:
>This message has been generated using Apple’s Mail program, Version 7.3
>(1878.6), under Mac OS-X 10.9.5. Since the Mail program apparently uses a
>non-ASCII apostrophe, I include one above as the possessive “Apple” as well
>as open & close single quotes (here surrounding ‘single quotes’) and open &
>close double quotes (here surrounding "double quotes”). 
Norman Shapiro
--- End Message ---
Replied: Thu, 20 Nov 2014 08:32:51 -0800
Replied: "Jeff Rothenberg" 
Replied: n...@dad.org
Return-Path: 
X-Original-To: norm@localhost
Delivered-To: n...@localhost.dad.org
Received: from lad.dad.org (localhost [IPv6:::1])
	by lad.dad.org (Postfix) with ESMTP id 98A7F612C4
	for ; Thu, 20 Nov 2014 08:22:02 -0800 (PST)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail1.rawbw.com
X-Spam-Level: *
X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_HELO_PASS,SPF_SOFTFAIL
	autolearn=disabled version=3.3.1
Received: from imap.rawbw.com [198.144.192.43]
	by lad.dad.org with IMAP (fetchmail-6.3.17)
	for  (single-drop); Thu, 20 Nov 2014 08:22:05 -0800 (PST)
Received: from ns2.adzone.com (ns2.adzone.com [96.247.50.174])
	by mail1.rawbw.com (8.14.2/8.14.2) with ESMTP id sAKGJVfF062015
	for ; Thu, 20 Nov 2014 08:19:36 -0800 (PST)
	(envelope-from SRS0+OFbw+14+acm.org=jeff_rothenb...@4securemail.com)
Received: from mail.4securemail.com (mail.4securemail.com [64.34.211.28])
	by ns2.adzone.com (8.14.4/8.14.5) with ESMTP id sAKGJ4vQ021240
	for ; Thu, 20 Nov 2014 08:19:05 -0800
From: "Jeff Rothenberg" 
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
Subject: Example message to test Reply truncation bug
Date: Thu, 20 Nov 2014 08:19:18 -0800
Message-Id: <0a79c4c8-4f12-424a-a841-b5a5c38a5...@acm.org>
Cc: Jeff Rothenberg 
To: Norman Shapiro 
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
X-Mailer: Apple Mail (2.1878.6)

This message has been generated using Apple=92s Mail program, Version =
7.3 (1878.6),
under Mac OS-X 10.9.5.  Since the Mail program apparently uses a =
non-ASCII
apostrophe, I include one above as the possessive =93Apple=94 as well as =
open & close
single quotes (here surrounding =91single quotes=92) and open & close =
double quotes
(here surrounding "double quotes=94).=


preSend
Description: preSend
MH-Profile-Version: 1.0
Path: Mail
editor: neo
Aliasfile: aliases
repl:  -filter cite -nocc me -cc to -cc cc -anno
#: repl:  -nocc me -cc to -cc cc -anno
#: formatproc: /home/norm/lib/replyfilter
mhstore: -auto -clobber ask
nmh-storage: /t/Mime
sortm: -check -noall
Draft-folder: wind
send: -draftfolder +wind  -server smtp.tsoft.com
#:
#: All sequences are private, i.e. recorded in context
mh-sequences:
#:
Sequence-Negation: not
unseen-sequence: unseen
#:
#postproc:  /usr/local/nmh/lib/post
mhl: -width 1000
moreproc: mhless
mhshow-show-text/html:  google-chrome && google-chrome %F && sleep 4
refile: -retainsequences
Alternate-Mailboxes:
   acte...@dad.org, americanhomeshi...@dad.org, cleanersup...@dad.org,
   staroff...@dad.org, thinkm...@dad.org, u...@dad.org, westernun...@dad.org,
   yout...@dad.org, ama...@dad.org, a...@dad.org, associated...@dad.org,
   beansh...@dad.org, brownad...@dad.org, c...@dad.org, d...@dad.org,
   et...@dad.org, exab...@dad.org, firecrac...@dad.org, fl...@dad.org,
   goo...@dad.org, h...@dad.org, installshi...@dad.org, i...@dad.org,
   kitc...@dad.org, kitchen...@dad.org, la...@dad.org, networkwo...@dad.org,
   n...@dad.dad.org, n...@dad.org, n...@gad.dad.org, n...@smtp.rawbw.com,
   o...@dad.org, og...@dad.org, p...@dad.org, rbl...@dad.org, red...@dad.org,
   rei...@dad.org, safe...@dad.org, s...@dad.org, s...@tsoft.com,
   sourcefo...@dad.org, spamassas...@dad.org, t...@dad.org, ubta...@dad.org,
   v...@dad.org, walgre...@dad.org, weat...@dad.org, wellsfa...@dad.org,
   your...@dad.org, empowe...@dad.org
___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


[Nmh-workers] problem with mhshow after mhfixmsg

2014-11-20 Thread Paul Fox
i'm having a problem with mhshow showing some of the parts
of a message, but only after the message has been run through
mhfixmsg.

before i start debugging mhshow (which i'm willing to do, though
it will take me a while), i want to be sure that the output of
mhfixmsg is valid MIME.

here is the unprocessed message.  "mhshow -part 1.3 3" works fine
on this message.  you'll notice that there's no text/plain part
corresponding to part 1.1's text/html -- that's what mhfixmsg is
going to fix:

$ mhlist -verbose -disposition 3
 msg part  type/subtype  size description
   3   multipart/alternative1786K
 boundary="Apple-Mail-2-23735733"
 1 multipart/related1784K
 type="text/html"
 boundary="Apple-Mail-3-23735734"
 1.1   text/html  11K
 charset="iso-8859-1"
 1.2   image/tiff9350
 name="pastedGraphic1.tiff"
 disposition "inline"
   filename="pastedGraphic1.tiff"
 1.3   image/jpeg122K
 name="IMG_0833.jpeg"
 disposition "inline"
   filename="IMG_0833.jpeg"
 1.4   image/jpeg 94K
 name="IMG_0834.jpeg"
 disposition "inline"
   filename="IMG_0834.jpeg"
 1.5   image/jpeg114K
 name="IMG_0835.jpeg"
 disposition "inline"
   filename="IMG_0835.jpeg"
 1.6   image/jpeg 98K
 name="IMG_0826.jpeg"
 disposition "inline"
   filename="IMG_0826.jpeg"
 1.7   image/jpeg115K
 name="IMG_0827.jpeg"
 disposition "inline"
   filename="IMG_0827.jpeg"
 1.8   image/jpeg173K
 name="IMG_0828.jpeg"
 disposition "inline"
   filename="IMG_0828.jpeg"
 1.9   image/jpeg167K
 name="IMG_0829.jpeg"
 disposition "inline"
   filename="IMG_0829.jpeg"
 1.10  image/jpeg164K
 name="IMG_0830.jpeg"
 disposition "inline"
   filename="IMG_0830.jpeg"
 1.11  image/jpeg162K
 name="IMG_0831.jpeg"
 disposition "inline"
   filename="IMG_0831.jpeg"
 1.12  image/jpeg 88K
 name="IMG_0832.jpeg"
 disposition "inline"
   filename="IMG_0832.jpeg"
 2 text/plain1168
 charset="iso-8859-1"


here's the processed version.  after this conversion, running "mhshow
-part 1.1.1", "mhshow -part 1.1.2", or "mhshow -part 2" works fine. 
running "mhshow -part 1.3" (or any other 1.n part) gives this:
mhshow: don't know how to display any of the contents
(content multipart/alternative in message 4)

$ mhlist -verbose -disposition 3
 msg part  type/subtype  size description
   4   multipart/alternative1787K
 boundary="Apple-Mail-2-23735733"
 1 multipart/related1786K
 type="text/html"
 boundary="Apple-Mail-3-23735734"
 1.1   multipart/alternative  13K
 boundary="=_nmh-multipart1.1"
 1.1.1 text/html  11K
 charset="iso-8859-1"
 1.1.2 text/plain1281
 charset="iso-8859-1"
 1.2   image/tiff9350
 name="pastedGraphic1.tiff"
 disposition "inline"
   filename="pastedGraphic1.tiff"
 1.3   image/jpeg122K
 name="IMG_0833.jpeg"
 disposition "inline"
   filename="IMG_0833.jpeg"
 1.4   image/jpeg 94K
 name="IMG_0834.jpeg"
 disposition "inline"
   filename="IMG_0834.jpeg"
 1.5   image/jpeg114K
 name="IMG_0835.jpeg"
 disposition "inline"
   filename="IMG_0835.jpeg"
 1.6   image/jpeg 98K
 name="IMG_0826.jpeg"
 disposition "inline"
   filename="IMG_0826.jpeg"
 1.7   image/jpeg115K
 name="IMG_0827.jpeg"
 disposition "inline"
   filename="IMG_0827.jpeg"
 1.8   image/jpeg173K
 name="IMG_0828.jpeg"
 disposition "inline"
   filename="IMG_0828.jpeg"
 1.9   image/jpeg167K
 name="IMG_0829.jpeg"