Hello, and good morning.  (Or a bit later, it is.)

SZÉPE Viktor <[email protected]> wrote:
 |As I was searching the net, mailx-s are not able to compose HTML emails.
 |Please consider supporting
 |
 |cat email.html | s-nail --some-flag-for-html [email protected]

  ?0[steffen@wales nail.git]$ git grep -e text/plain --and -e XXX
  sendout.c:   contenttype = "text/plain"; /* XXX mail body - always 
text/plain, want XX? */

A first version of this comment was added in [cacee1b5] on
2013-01-02, however.
So today i think this won't happen before v15, i am sorry: it
wouldn't be impossible to do already (with the builtin simple HTML
converter as a mandatory precondition we, i think, could pretty
well create a multipart/alternative "twin" mail body in
sendout.c:mail1() before going to infix(), or very expensively
over and over again in infix()), but it would be very hacky and
expensive, and i still have i think two or three months to go for
v14.9, so much to do, and i didn't want to spend a single day on
this codebase in 2016!  Thus that will be 2017, add a year for
development: not before 2018.  I am truly sorry.

For non-multipart/alternative with a plain text version, but only
with a text/html body, which me myself and i won't support
directly, you could checkout the [next] branch and patch in the
attached diff, to end up like:

  ?0[steffen@wales nail.git]$ echo bla|./s-nail -:/ -d -ssub du@auch
  s-nail: user = steffen, homedir = /home/steffen
  s-nail: >>> MTA: "/usr/sbin/sendmail", arguments: "sendmail" "-i" "--" 
"du@auch"
  s-nail: >>> Date: Wed, 08 Jun 2016 13:16:08 +0200
  s-nail: >>> To: du@auch
  s-nail: >>> Subject: sub
  s-nail: >>> User-Agent: s-nail v14.8.8-167-g4c27f77-dirty
  s-nail: >>>
  s-nail: >>> bla
  s-nail: smemreset: freed 18 chunks/19051 bytes
  ?0[steffen@wales nail.git]$ echo bla|./s-nail -:/ -d -! -ssub du@auch
  s-nail: user = steffen, homedir = /home/steffen
  s-nail: >>> MTA: "/usr/sbin/sendmail", arguments: "sendmail" "-i" "--" 
"du@auch"
  s-nail: >>> Date: Wed, 08 Jun 2016 13:16:12 +0200
  s-nail: >>> To: du@auch
  s-nail: >>> Subject: sub
  s-nail: >>> User-Agent: s-nail v14.8.8-167-g4c27f77-dirty
  s-nail: >>> MIME-Version: 1.0
  s-nail: >>> Content-Type: text/html; charset=US-ASCII
  s-nail: >>>
  s-nail: >>> bla
  s-nail: smemreset: freed 18 chunks/19051 bytes

So then, with -!, you would get something that is flagged HTML.

 |All the best!

Sorry.
Ciao!

--steffen
diff --git a/main.c b/main.c
index 5177be9..6929f46 100644
--- a/main.c
+++ b/main.c
@@ -614,11 +614,11 @@ _X_arg_eval(struct X_arg *xhp) /* TODO error handling not right */
 int
 main(int argc, char *argv[])
 {
-   static char const optstr[] = "A:a:Bb:c:dEeFfHhiL:NnO:q:Rr:S:s:tu:VvX:::~#.",
+   static char const optstr[] = "A:a:Bb:c:dEeFfHhiL:NnO:q:Rr:S:s:tu:VvX:::~#.!",
       usagestr[] = N_(
          " Synopsis:\n"
          "  %s -h | --help\n"
-         "  %s [-BdEFintv~] [-: spec] [-A account]\n"
+         "  %s [-BdEFintv~!] [-: spec] [-A account]\n"
          "\t [-a attachment] [-b bcc-address] [-c cc-address]\n"
          "\t [-q file] [-r from-address] [-S var[=value]...]\n"
          "\t [-s subject] [-X cmd] [-.] to-address... [-- mta-option...]\n"
@@ -877,6 +877,9 @@ joarg:
       case '.':
          options |= OPT_SENDMODE;
          goto jgetopt_done;
+      case '!':
+         options |= OPT_EXCLAMATION;
+         break;
       case '?':
 jusage:
          if (emsg != NULL)
diff --git a/nail.h b/nail.h
index 2daef03..535338a 100644
--- a/nail.h
+++ b/nail.h
@@ -1180,6 +1180,7 @@ enum user_options {
    OPT_u_FLAG     = 1u<<13,   /* -u / $USER and pw->pw_uid != getuid(2) */
    OPT_TILDE_FLAG = 1u<<14,   /* -~ */
    OPT_BATCH_FLAG = 1u<<15,   /* -# */
+   OPT_EXCLAMATION = 1u<<30,  /* -! */
 
    /*  */
    OPT_MEMDEBUG   = 1<<16,    /* *memdebug* */
diff --git a/sendout.c b/sendout.c
index 3133131..0cab793 100644
--- a/sendout.c
+++ b/sendout.c
@@ -603,7 +603,10 @@ infix(struct header *hp, FILE *fi) /* TODO check */
 
    pstate &= ~PS_HEADER_NEEDED_MIME; /* TODO a hack should be carrier tracked */
 
-   contenttype = "text/plain"; /* XXX mail body - always text/plain, want XX? */
+   if(options & OPT_EXCLAMATION)
+      contenttype = "text/html";
+   else
+      contenttype = "text/plain";
    convert = mime_type_classify_file(fi, &contenttype, &charset, &do_iconv);
 
 #ifdef HAVE_ICONV
@@ -2048,6 +2051,7 @@ j_mft_add:
 
    /* We don't need MIME unless.. we need MIME?! */
    if ((w & GMIME) && ((pstate & PS_HEADER_NEEDED_MIME) ||
+         (options & OPT_EXCLAMATION) ||
          hp->h_attach != NULL || convert != CONV_7BIT ||
          asccasecmp(charset, "US-ASCII"))) {
       ++gotcha;
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
__________________________________
[email protected]

Reply via email to