diff -cr alpine.orig/alpine-1.10/alpine/send.c alpine.new/alpine-1.10/alpine/send.c *** alpine.orig/alpine-1.10/alpine/send.c 2008-02-08 17:43:23.000000000 +0000 --- alpine.new/alpine-1.10/alpine/send.c 2008-06-19 09:24:42.000000000 +0100 *************** *** 4039,4044 **** --- 4039,4061 ---- pbf = save_previous_pbuf; g_rolenick = NULL; + /* Topal: Unmangle the body types. */ + if ((*body)->type == TYPEMULTIPART + && (*body)->topal_hack == 1) { + /* This was a single part message which Topal mangled. */ + dprint((9, "Topal: unmangling single part message\n")); + (*body)->type = TYPETEXT; + } + if ((*body)->type == TYPEMULTIPART + && (*body)->topal_hack != 1 + && (*body)->nested.part->body.type == TYPEMULTIPART + && (*body)->nested.part->body.topal_hack == 1) { + /* Topal mangled a multipart message. So the first nested part + is really TYPETEXT. */ + dprint((9, "Topal: unmangling first part of multipart message\n")); + (*body)->nested.part->body.type = TYPETEXT; + } + dprint((4, "=== send returning ===\n")); } *************** *** 5302,5323 **** rfc822_parse_content_header(nb, (char *) ucase((unsigned char *) buf+8),s); if(nb->type == TYPETEXT && nb->subtype && (!b->subtype || strucmp(b->subtype, nb->subtype))){ ! if(b->subtype) ! fs_give((void **) &b->subtype); ! b->subtype = nb->subtype; nb->subtype = NULL; ! mail_free_body_parameter(&b->parameter); b->parameter = nb->parameter; nb->parameter = NULL; mail_free_body_parameter(&nb->parameter); } ! mail_free_body(&nb); } --- 5319,5368 ---- rfc822_parse_content_header(nb, (char *) ucase((unsigned char *) buf+8),s); + /* Topal: We're working on the first + text segment of the message. If + the filter returns something that + isn't TYPETEXT, then we need to + pretend (later on) that this is in + fact a TYPETEXT, because Topal has + already encoded it.... + + Original code path first, then an + alternate path. + */ if(nb->type == TYPETEXT && nb->subtype && (!b->subtype || strucmp(b->subtype, nb->subtype))){ ! if(b->subtype) ! fs_give((void **) &b->subtype); ! ! b->subtype = nb->subtype; ! nb->subtype = NULL; ! ! mail_free_body_parameter(&b->parameter); ! b->parameter = nb->parameter; ! nb->parameter = NULL; ! mail_free_body_parameter(&nb->parameter); ! } ! else if(F_ON(F_ENABLE_TOPAL_HACK, ps_global)){ ! /* Perhaps the type isn't TYPETEXT, ! and the hack is requested. So, ! let's mess with the types. */ ! if(nb->type != TYPETEXT){ ! b->type = nb->type; b->subtype = nb->subtype; nb->subtype = NULL; ! ! dprint((9, "Topal: mangling body!\n")); mail_free_body_parameter(&b->parameter); b->parameter = nb->parameter; nb->parameter = NULL; mail_free_body_parameter(&nb->parameter); + b->topal_hack = 1; + } } ! /* Topal: end */ mail_free_body(&nb); } Only in alpine.new/alpine-1.10/alpine: send.c.orig diff -cr alpine.orig/alpine-1.10/imap/src/c-client/mail.h alpine.new/alpine-1.10/imap/src/c-client/mail.h *** alpine.orig/alpine-1.10/imap/src/c-client/mail.h 2008-02-15 19:04:45.000000000 +0000 --- alpine.new/alpine-1.10/imap/src/c-client/mail.h 2008-06-19 09:24:42.000000000 +0100 *************** *** 775,780 **** --- 775,781 ---- unsigned long bytes; /* size of text in octets */ } size; char *md5; /* MD5 checksum */ + unsigned short topal_hack; /* set to 1 if topal has wrecked the sending */ void *sparep; /* spare pointer reserved for main program */ }; diff -cr alpine.orig/alpine-1.10/pith/conf.c alpine.new/alpine-1.10/pith/conf.c *** alpine.orig/alpine-1.10/pith/conf.c 2008-03-14 18:15:38.000000000 +0000 --- alpine.new/alpine-1.10/pith/conf.c 2008-06-19 09:26:41.000000000 +0100 *************** *** 2739,2744 **** --- 2739,2746 ---- F_SEND_WO_CONFIRM, h_config_send_wo_confirm, PREF_SEND, 0}, {"strip-whitespace-before-send", "Strip Whitespace Before Sending", F_STRIP_WS_BEFORE_SEND, h_config_strip_ws_before_send, PREF_SEND, 0}, + {"enable-topal-hack", "Enable Topal hack for OpenPGP/MIME messages", + F_ENABLE_TOPAL_HACK, h_config_enable_topal_hack, PREF_HIDDEN, 0}, {"warn-if-blank-fcc", "Warn if Blank Fcc", F_WARN_ABOUT_NO_FCC, h_config_warn_if_fcc_blank, PREF_SEND, 0}, {"warn-if-blank-subject", "Warn if Blank Subject", Only in alpine.new/alpine-1.10/pith: conf.c.orig diff -cr alpine.orig/alpine-1.10/pith/conftype.h alpine.new/alpine-1.10/pith/conftype.h *** alpine.orig/alpine-1.10/pith/conftype.h 2008-03-14 18:15:38.000000000 +0000 --- alpine.new/alpine-1.10/pith/conftype.h 2008-06-19 09:24:42.000000000 +0100 *************** *** 492,497 **** --- 492,498 ---- F_MARK_FCC_SEEN, F_MULNEWSRC_HOSTNAMES_AS_TYPED, F_STRIP_WS_BEFORE_SEND, + F_ENABLE_TOPAL_HACK, F_QUELL_FLOWED_TEXT, F_COMPOSE_ALWAYS_DOWNGRADE, F_SORT_DEFAULT_FCC_ALPHA, Only in alpine.new/alpine-1.10/pith: conftype.h.orig diff -cr alpine.orig/alpine-1.10/pith/pine.hlp alpine.new/alpine-1.10/pith/pine.hlp *** alpine.orig/alpine-1.10/pith/pine.hlp 2008-03-14 18:34:08.000000000 +0000 --- alpine.new/alpine-1.10/pith/pine.hlp 2008-06-19 09:24:42.000000000 +0100 *************** *** 3133,3138 **** --- 3133,3139 ----