[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] mhmail -from

From: David Levine
Subject: [Nmh-workers] mhmail -from
Date: Tue, 12 Jun 2012 19:09:55 -0500

I wrote:

> And I think that -from is now required when sending, so
> we'll have to update that in the man page.

Thinking about this some more:  -from is currently (1.5)
required by mhmail (actually, post).  mhmail is used in
scripts and by nmh internally to report errors, such as when
push fails.  So I think mhmail should support a default
-from using the user's local mailbox.  Any objection?


diff --git a/uip/mhmail.c b/uip/mhmail.c
index 76e9e80..6c5039c 100644
--- a/uip/mhmail.c
+++ b/uip/mhmail.c
@@ -8,6 +8,7 @@

 #include <h/mh.h>
+#include <h/mts.h>
 #include <h/signals.h>
 #include <h/utils.h>
 #include <signal.h>
@@ -140,6 +141,8 @@ main (int argc, char **argv)
        fprintf (out, "%sSubject: %s\n", resent ? "Resent-" : "", subject);
     if (from)
        fprintf (out, "%sFrom: %s\n", resent ? "Resent-" : "", from);
+    else
+       fprintf (out, "From: %s\n", getlocalmbox ());
     if (!resent)
        fputs ("\n", out);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]