Hello list,

i'm sorry but there is yet another bug in S-nail, since
2012-12-20: if you want to look at a multipart/alternative message
that has no plain text (thus most likely only a HTML) part (and
without *print-alternatives* set), then that part is not
displayed.  It is displayed via 'P', however, and fwiw.

Why would BSD magazine send a multipart/alternative message with
only a HTML part and no alternative at all?  Unholy marriage of
multiple bugs, imho...

The patch is attached, and i've already pushed it onto [master].
I'm afraid i will even have to release yet another subminor of
S-nail, v14.4.5!  Oh [peep]!  I will build up my courage over the
weekend, and then let's see...

--steffen
Date:   2013-10-18 22:29:11 +0200

    send.c:sendpart(): fix yet another bug from 2012-12..
    
    Crap!  [0d43a999] (Change "Part X:" display message.., 2012-12-20)
    unfortunately changed the way multipart/alternative messages have
    been handled.  We yet had a fix with plain HTML mails (forgot
    when), but today the shitty BSD magazine sent out
    a multipart/alternative message with only a HTML part (no
    alternative), which revealed this bug (actual message content only
    viewable via 'P' aka view-all).
    
    We should not have 'return'ed.
---
 send.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/send.c b/send.c
index 87370d5..c242069 100644
--- a/send.c
+++ b/send.c
@@ -819,8 +819,11 @@ skip:
 	case MIME_ALTERNATIVE:
 		if ((action == SEND_TODISP || action == SEND_QUOTE) &&
 				value("print-alternatives") == NULL) {
+			size_t done = FAL0;
 			for (np = ip->m_multipart; np; np = np->m_nextpart) {
-				if (np->m_ct_type_plain != NULL && /* XXX */
+				if (np->m_mimecontent == MIME_TEXT_PLAIN)
+					++done;
+				if (done > 0 && np->m_ct_type_plain != NULL &&
 						action != SEND_QUOTE) {
 					_print_part_info(&rest, np, doign,
 						level);
@@ -828,16 +831,18 @@ skip:
 						CONV_NONE, SEND_MBOX, qf,
 						stats, NULL);
 				}
-				if (np->m_mimecontent == MIME_TEXT_PLAIN) {
+				if (done == 1 && np->m_mimecontent ==
+						MIME_TEXT_PLAIN) {
 					rt = sendpart(zmp, np, obuf, doign,
 							qf, action, stats,
 							level + 1);
 					quoteflt_reset(qf, origobuf);
 					if (rt < 0)
-						return -1;
+						break;
 				}
 			}
-			return rt;
+			if (done > 0)
+				return rt;
 		}
 		/*FALLTHRU*/
 	case MIME_MULTI:
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
S-nail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/s-nail-users

Reply via email to