From 02b26325d0e93e850f7ce45ef81629fd8b6def9c Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Wed, 27 Mar 2002 00:39:26 +0000 Subject: [PATCH] Fix encoder mode for text/plain; action=pgp-*. --- pgp.c | 5 +++++ sendlib.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pgp.c b/pgp.c index 3d6f52c3..041f4221 100644 --- a/pgp.c +++ b/pgp.c @@ -1285,6 +1285,11 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) return NULL; } + /* The following code is really correct: If noconv is set, + * a's charset parameter contains the on-disk character set, and + * we have to convert from that to utf-8. If noconv is not set, + * we have to convert from $charset to utf-8. + */ if (a->noconv) mutt_get_body_charset (from_charset, sizeof (from_charset), a); else diff --git a/sendlib.c b/sendlib.c index 1a105187..80224681 100644 --- a/sendlib.c +++ b/sendlib.c @@ -446,6 +446,12 @@ int mutt_write_mime_header (BODY *a, FILE *f) return (ferror (f) ? -1 : 0); } +#ifdef HAVE_PGP +# define write_as_text_part(a) (mutt_is_text_part(a) || mutt_is_application_pgp(a)) +#else +# define write_as_text_part(a) (mutt_is_text_part(a)) +#endif + int mutt_write_mime_body (BODY *a, FILE *f) { char *p, boundary[SHORT_STRING]; @@ -506,11 +512,11 @@ int mutt_write_mime_body (BODY *a, FILE *f) fc = fgetconv_open (fpin, 0, 0, 0); if (a->encoding == ENCQUOTEDPRINTABLE) - encode_quoted (fc, f, mutt_is_text_part (a)); + encode_quoted (fc, f, write_as_text_part (a)); else if (a->encoding == ENCBASE64) - encode_base64 (fc, f, mutt_is_text_part (a)); + encode_base64 (fc, f, write_as_text_part (a)); else if (a->type == TYPETEXT && (!a->noconv)) - encode_8bit (fc, f, mutt_is_text_part (a)); + encode_8bit (fc, f, write_as_text_part (a)); else mutt_copy_stream (fpin, f); @@ -520,6 +526,8 @@ int mutt_write_mime_body (BODY *a, FILE *f) return (ferror (f) ? -1 : 0); } +#undef write_as_text_part + #define BOUNDARYLEN 16 void mutt_generate_boundary (PARAMETER **parm) { -- 2.40.0