nmh-workers
[Top] [All Lists]

[Nmh-workers] mhmail -from

2012-06-12 19:10:08
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?

David


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);

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>
  • [Nmh-workers] mhmail -from, David Levine <=