diff --git a/mailx-12.1-mime.dif b/mailx-12.1-mime.dif deleted file mode 100644 index 8b7da2e..0000000 --- a/mailx-12.1-mime.dif +++ /dev/null @@ -1,67 +0,0 @@ ---- mime.c -+++ mime.c 2006-07-20 13:42:19.000000000 +0200 -@@ -758,7 +758,7 @@ mime_isclean(FILE *f) - } else if (c == '\0') { - isclean |= MIME_HASNUL; - break; -- } else if ((c < 040 && (c != '\t' && c != '\f')) || c == 0177) { -+ } else if ((c < 040 && (c != '\t' && c != '\f' && c != '\b')) || c == 0177) { - isclean |= MIME_CTRLCHAR; - } - } while (c != EOF); -@@ -825,6 +825,8 @@ get_mime_convert(FILE *fp, char **conten - * ^I or ^L in text/plain bodies. However, some - * obscure character sets actually contain these - * characters, so the content type can be set. -+ * Beside ^I or ^L from RFC 2046 we accept also -+ * backspace ^H often used in enhanced text. - */ - if ((*contenttype = value("contenttype-cntrl")) == NULL) - *contenttype = "application/octet-stream"; ---- sendout.c -+++ sendout.c 2006-09-27 12:22:06.000000000 +0200 -@@ -433,7 +433,7 @@ infix(struct header *hp, FILE *fi, int d - iconvd = (iconv_t)-1; - } - if ((isclean & (MIME_HASNUL|MIME_CTRLCHAR)) == 0 && -- isclean & MIME_HIGHBIT && -+ isclean & MIME_HIGHBIT && ascncasecmp(tcs, "ANSI_X3.4", 9) && - charset != NULL && asccasecmp(charset, tcs)) { - if (iconvd != (iconv_t)-1) - iconv_close(iconvd); -@@ -1128,8 +1128,9 @@ puthead(struct header *hp, FILE *fo, enu - return 1; - if ((addr = hp->h_organization) != NULL || - (addr = value("ORGANIZATION")) != NULL) { -+ size_t len = strlen(addr); - fwrite("Organization: ", sizeof (char), 14, fo); -- if (mime_write(addr, sizeof *addr, strlen(addr), fo, -+ if (len && mime_write(addr, sizeof *addr, len, fo, - action == SEND_TODISP ? - CONV_NONE:CONV_TOHDR, - action == SEND_TODISP ? -@@ -1174,9 +1175,10 @@ puthead(struct header *hp, FILE *fo, enu - if (hp->h_subject != NULL && w & GSUBJECT) { - fwrite("Subject: ", sizeof (char), 9, fo); - if (ascncasecmp(hp->h_subject, "re: ", 4) == 0) { -+ size_t len = strlen(hp->h_subject + 4); - fwrite("Re: ", sizeof (char), 4, fo); -- if (mime_write(hp->h_subject + 4, sizeof *hp->h_subject, -- strlen(hp->h_subject + 4), -+ if (len && mime_write(hp->h_subject + 4, -+ sizeof *hp->h_subject, len, - fo, action == SEND_TODISP ? - CONV_NONE:CONV_TOHDR, - action == SEND_TODISP ? -@@ -1184,8 +1186,9 @@ puthead(struct header *hp, FILE *fo, enu - NULL, (size_t)0) == 0) - return 1; - } else if (*hp->h_subject) { -- if (mime_write(hp->h_subject, sizeof *hp->h_subject, -- strlen(hp->h_subject), -+ size_t len = strlen(hp->h_subject); -+ if (len && mime_write(hp->h_subject, -+ sizeof *hp->h_subject, len, - fo, action == SEND_TODISP ? - CONV_NONE:CONV_TOHDR, - action == SEND_TODISP ? diff --git a/mailx-12.1.tar.bz2 b/mailx-12.1.tar.bz2 deleted file mode 100644 index 93258e0..0000000 --- a/mailx-12.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f14933d3bca269b142ffac7b628d5a153e29d771d5430433edb444bfb3fdb9b -size 268853 diff --git a/mailx-12.2-mime.dif b/mailx-12.2-mime.dif new file mode 100644 index 0000000..89d2234 --- /dev/null +++ b/mailx-12.2-mime.dif @@ -0,0 +1,186 @@ +--- def.h ++++ def.h 2007-04-17 13:32:43.960721000 +0200 +@@ -142,7 +142,8 @@ enum mimeclean { + MIME_LONGLINES = 002, /* has lines too long for RFC 2822 */ + MIME_CTRLCHAR = 004, /* contains control characters */ + MIME_HASNUL = 010, /* contains \0 characters */ +- MIME_NOTERMNL = 020 /* lacks a terminating newline */ ++ MIME_NOTERMNL = 020, /* lacks a terminating newline */ ++ MIME_UTF8 = 040 /* UTF-8 high bit characters */ + }; + + enum tdflags { +--- mime.c ++++ mime.c 2007-04-17 15:08:06.352702764 +0200 +@@ -258,7 +258,10 @@ getcharset(int isclean) + if (isclean & (MIME_CTRLCHAR|MIME_HASNUL)) + charset = NULL; + else if (isclean & MIME_HIGHBIT) { +- charset = wantcharset ? wantcharset : value("charset"); ++ if (isclean & MIME_UTF8) ++ charset = defcharset; ++ if (charset == NULL) ++ charset = wantcharset ? wantcharset : value("charset"); + if (charset == NULL) { + charset = defcharset; + } +@@ -730,6 +733,7 @@ mime_isclean(FILE *f) + lastc = c; + c = getc(f); + curlen++; ++ check: + if (c == '\n' || c == EOF) { + /* + * RFC 821 imposes a maximum line length of 1000 +@@ -742,10 +746,38 @@ mime_isclean(FILE *f) + curlen = 1; + } else if (c & 0200) { + isclean |= MIME_HIGHBIT; ++ if (c & 0100) { ++ int n, follow; ++ ++ if ((c & 040) == 0) /* 110xxxxx */ ++ follow = 1; ++ else if ((c & 020) == 0) /* 1110xxxx */ ++ follow = 2; ++ else if ((c & 010) == 0) /* 11110xxx */ ++ follow = 3; ++ else if ((c & 004) == 0) /* 111110xx */ ++ follow = 4; ++ else if ((c & 002) == 0) /* 1111110x */ ++ follow = 5; ++ else ++ continue; ++ ++ for (n = 0; n < follow; n++) { ++ lastc = c; ++ c = getc(f); ++ ++ if ((c & 0200) == 0 || (c & 0100) || ++ (c == '\0') || (c == '\n') || (c == EOF)) { ++ curlen += n; ++ goto check; ++ } ++ } ++ isclean |= MIME_UTF8; ++ } + } else if (c == '\0') { + isclean |= MIME_HASNUL; + break; +- } else if ((c < 040 && (c != '\t' && c != '\f')) || c == 0177) { ++ } else if ((c < 040 && (c != '\t' && c != '\f' && c != '\b')) || c == 0177) { + isclean |= MIME_CTRLCHAR; + } + } while (c != EOF); +@@ -814,13 +846,16 @@ get_mime_convert(FILE *fp, char **conten + * ^I or ^L in text/plain bodies. However, some + * obscure character sets actually contain these + * characters, so the content type can be set. ++ * Beside ^I or ^L from RFC 2046 we accept also ++ * backspace ^H often used in enhanced text. + */ + if ((*contenttype = value("contenttype-cntrl")) == NULL) + *contenttype = "application/octet-stream"; + } else + *contenttype = "text/plain"; + *charset = getcharset(*isclean); +- } ++ } else if (ascncasecmp(*contenttype, "text/", 5) == 0) ++ *charset = getcharset(*isclean); + return convert; + } + +--- sendout.c ++++ sendout.c 2007-04-17 15:11:40.576871634 +0200 +@@ -206,7 +206,7 @@ attach_file(struct attachment *ap, FILE + size_t bufsize, count; + int lastc = EOF; + #ifdef HAVE_ICONV +- char *tcs; ++ char *tcs = NULL; + #endif + + if ((fi = Fopen(ap->a_name, "r")) == NULL) { +@@ -231,8 +231,16 @@ attach_file(struct attachment *ap, FILE + send_boundary, contenttype); + if (charset == NULL) + putc('\n', fo); +- else +- fprintf(fo, ";\n charset=%s\n", charset); ++ else { ++#ifdef HAVE_ICONV ++ if (wantcharset && ascncasecmp(wantcharset, "ANSI_X3.4", 9)) ++ tcs = wantcharset; ++ if (tcs) ++ fprintf(fo, ";\n charset=%s\n", tcs); ++ else ++#endif ++ fprintf(fo, ";\n charset=%s\n", charset); ++ } + if (ap->a_content_disposition == NULL) + ap->a_content_disposition = "attachment"; + fprintf(fo, "Content-Transfer-Encoding: %s\n" +@@ -254,16 +262,15 @@ attach_file(struct attachment *ap, FILE + iconv_close(iconvd); + iconvd = (iconv_t)-1; + } +- tcs = gettcharset(); + if ((isclean & (MIME_HASNUL|MIME_CTRLCHAR)) == 0 && + ascncasecmp(contenttype, "text/", 5) == 0 && + isclean & MIME_HIGHBIT && +- charset != NULL && asccasecmp(charset, tcs)) { +- if ((iconvd = iconv_open_ft(charset, tcs)) == (iconv_t)-1 && ++ charset != NULL && tcs != NULL && asccasecmp(charset, tcs)) { ++ if ((iconvd = iconv_open_ft(tcs, charset)) == (iconv_t)-1 && + errno != 0) { + if (errno == EINVAL) + fprintf(stderr, catgets(catd, CATSET, 179, +- "Cannot convert from %s to %s\n"), tcs, charset); ++ "Cannot convert from %s to %s\n"), charset, tcs); + else + perror("iconv_open"); + Fclose(fi); +@@ -467,6 +474,7 @@ infix(struct header *hp, FILE *fi, int d + } + if ((isclean & (MIME_HASNUL|MIME_CTRLCHAR)) == 0 && + ascncasecmp(contenttype, "text/", 5) == 0 && ++ ascncasecmp(tcs, "ANSI_X3.4", 9) && + isclean & MIME_HIGHBIT && + charset != NULL && asccasecmp(charset, tcs)) { + if (iconvd != (iconv_t)-1) +@@ -1160,8 +1168,9 @@ puthead(struct header *hp, FILE *fo, enu + return 1; + if ((addr = hp->h_organization) != NULL || + (addr = value("ORGANIZATION")) != NULL) { ++ size_t len = strlen(addr); + fwrite("Organization: ", sizeof (char), 14, fo); +- if (mime_write(addr, sizeof *addr, strlen(addr), fo, ++ if (len && mime_write(addr, sizeof *addr, len, fo, + action == SEND_TODISP ? + CONV_NONE:CONV_TOHDR, + action == SEND_TODISP ? +@@ -1206,9 +1215,10 @@ puthead(struct header *hp, FILE *fo, enu + if (hp->h_subject != NULL && w & GSUBJECT) { + fwrite("Subject: ", sizeof (char), 9, fo); + if (ascncasecmp(hp->h_subject, "re: ", 4) == 0) { ++ size_t len = strlen(hp->h_subject + 4); + fwrite("Re: ", sizeof (char), 4, fo); +- if (mime_write(hp->h_subject + 4, sizeof *hp->h_subject, +- strlen(hp->h_subject + 4), ++ if (len && mime_write(hp->h_subject + 4, ++ sizeof *hp->h_subject, len, + fo, action == SEND_TODISP ? + CONV_NONE:CONV_TOHDR, + action == SEND_TODISP ? +@@ -1216,8 +1226,9 @@ puthead(struct header *hp, FILE *fo, enu + NULL, (size_t)0) == 0) + return 1; + } else if (*hp->h_subject) { +- if (mime_write(hp->h_subject, sizeof *hp->h_subject, +- strlen(hp->h_subject), ++ size_t len = strlen(hp->h_subject); ++ if (len && mime_write(hp->h_subject, ++ sizeof *hp->h_subject, len, + fo, action == SEND_TODISP ? + CONV_NONE:CONV_TOHDR, + action == SEND_TODISP ? diff --git a/mailx-12.1.dif b/mailx-12.2.dif similarity index 93% rename from mailx-12.1.dif rename to mailx-12.2.dif index 1811cd4..043ec39 100644 --- a/mailx-12.1.dif +++ b/mailx-12.2.dif @@ -5,9 +5,9 @@ +patch -p 0 -s --suffix=".rplyto" < ../mailx-12.1-replyto.patch +patch -p 0 -s --suffix=".ttychr" < ../nail-11.25-ttychar.dif +patch -p 0 -s --suffix=".toaddr" < ../nail-11.25-toaddr.dif -+patch -p 0 -s --suffix=".mime" < ../mailx-12.1-mime.dif ++patch -p 0 -s --suffix=".mime" < ../mailx-12.2-mime.dif --- Makefile -+++ Makefile 2006-07-20 14:18:51.000000000 +0200 ++++ Makefile 2007-04-17 12:12:48.536367085 +0200 @@ -10,6 +10,7 @@ PREFIX = /usr/local BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man @@ -16,15 +16,15 @@ DESTDIR = -@@ -91,7 +92,7 @@ config.h LIBS: +@@ -51,7 +52,7 @@ SHELL = /bin/sh + # + # Binaries are stripped with this command after installation. + # +-STRIP = strip ++STRIP = true - install: all - test -d $(DESTDIR)$(BINDIR) || mkdir -p $(DESTDIR)$(BINDIR) -- $(UCBINSTALL) -c -s mailx $(DESTDIR)$(BINDIR)/mailx -+ $(UCBINSTALL) -c mailx $(DESTDIR)$(BINDIR)/mailx - test -d $(DESTDIR)$(MANDIR)/man1 || mkdir -p $(DESTDIR)$(MANDIR)/man1 - $(UCBINSTALL) -c -m 644 mailx.1 $(DESTDIR)$(MANDIR)/man1/mailx.1 - test -d $(DESTDIR)$(SYSCONFDIR) || mkdir -p $(DESTDIR)$(SYSCONFDIR) + ########################################################################### + ########################################################################### --- aux.c +++ aux.c 2006-07-20 13:42:19.000000000 +0200 @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)aux.c 2.83 ( @@ -67,7 +67,7 @@ #include --- cmd3.c +++ cmd3.c 2006-07-20 13:42:19.000000000 +0200 -@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)cmd3.c 2.83 +@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)cmd3.c 2.84 #include #include @@ -117,7 +117,7 @@ #include --- fio.c +++ fio.c 2006-07-20 13:42:19.000000000 +0200 -@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)fio.c 2.70 ( +@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)fio.c 2.71 ( #endif #endif /* not lint */ @@ -168,7 +168,7 @@ */ --- lex.c +++ lex.c 2006-07-20 13:42:19.000000000 +0200 -@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)lex.c 2.85 ( +@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)lex.c 2.86 ( #endif #endif /* not lint */ @@ -178,7 +178,7 @@ #include --- list.c +++ list.c 2006-07-20 13:42:19.000000000 +0200 -@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)list.c 2.60 +@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)list.c 2.61 #endif #endif /* not lint */ @@ -231,7 +231,7 @@ struct name *to, *cc, *bcc, *smopts, *replyto; struct attachment *attach; char *subject, *cp, *ef, *qf = NULL, *fromaddr = NULL, *Aflag = NULL; -@@ -394,8 +394,11 @@ main(int argc, char *argv[]) +@@ -395,8 +395,11 @@ main(int argc, char *argv[]) case '?': usage: fprintf(stderr, catgets(catd, CATSET, 135, @@ -245,7 +245,7 @@ } } if (ef != NULL) { -@@ -436,11 +439,13 @@ usage: +@@ -437,11 +440,13 @@ usage: goto usage; } if (Rflag && to != NULL) { @@ -342,7 +342,7 @@ --- mime.c +++ mime.c 2006-07-20 13:42:19.000000000 +0200 -@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)mime.c 2.66 +@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)mime.c 2.67 #endif /* DOSCCS */ #endif /* not lint */ diff --git a/mailx-12.2.tar.bz2 b/mailx-12.2.tar.bz2 new file mode 100644 index 0000000..755b4eb --- /dev/null +++ b/mailx-12.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc2a2031e31c10f82cf4b60fe9228707ad41c3c2c32a695de3fa19a95fc38e63 +size 269281 diff --git a/mailx.changes b/mailx.changes index 09d36cd..9b03bd1 100644 --- a/mailx.changes +++ b/mailx.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Apr 17 15:25:22 CEST 2007 - werner@suse.de + +- Update to heirloom mailx 12.2 +- Add UTF-8 detection (bug #262658) +- Do not convert text attachments to terminal charset but send + character set (bug #262658) +- Improve the support of text/ MIME types other than text/plain + (bug #262658) + ------------------------------------------------------------------- Wed Nov 15 13:32:38 CET 2006 - werner@suse.de diff --git a/mailx.spec b/mailx.spec index 502b366..4090f5f 100644 --- a/mailx.spec +++ b/mailx.spec @@ -1,7 +1,7 @@ # -# spec file for package mailx (Version 12.1) +# spec file for package mailx (Version 12.2) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -13,18 +13,18 @@ Name: mailx BuildRequires: krb5-devel openssl-devel pcre postfix URL: http://heirloom.sourceforge.net/mailx.html -License: Other License(s), see package +License: BSD License and BSD-like Group: Productivity/Networking/Email/Utilities Provides: mail Requires: smtp_daemon Autoreqprov: on -Version: 12.1 -Release: 21 +Version: 12.2 +Release: 1 Summary: A MIME-Capable Implementation of the mailx Command Source: mailx-%{version}.tar.bz2 Patch: mailx-%{version}.dif Patch1: nail-11.25-path.dif -Patch2: mailx-%{version}-replyto.patch +Patch2: mailx-12.1-replyto.patch Patch3: nail-11.25-ttychar.dif Patch4: nail-11.25-toaddr.dif Patch5: mailx-%{version}-mime.dif @@ -84,7 +84,14 @@ Authors: %doc %{_mandir}/man1/mail.1.gz %doc %{_mandir}/man1/mailx.1.gz -%changelog -n mailx +%changelog +* Tue Apr 17 2007 - werner@suse.de +- Update to heirloom mailx 12.2 +- Add UTF-8 detection (bug #262658) +- Do not convert text attachments to terminal charset but send + character set (bug #262658) +- Improve the support of text/ MIME types other than text/plain + (bug #262658) * Wed Nov 15 2006 - werner@suse.de - Do not send the mail to a reply-to address (bug #218447) * Wed Sep 27 2006 - werner@suse.de