From 74d6825e0e5dd0b44ed8438f2dbcc0a1ef3602c7 Mon Sep 17 00:00:00 2001 From: David Levine Date: Tue, 12 Jun 2012 21:36:16 -0500 Subject: [PATCH] Generate a From: header, using localmbox, if the user doesn't provide a -from when sending with mhmail. --- man/mhmail.man | 7 ++++++- uip/mhmail.c | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/man/mhmail.man b/man/mhmail.man index 6e3cf13..261fbc7 100644 --- a/man/mhmail.man +++ b/man/mhmail.man @@ -88,7 +88,12 @@ By using .B \-from .IR addr , you can specify the \*(lqFrom:\*(rq header of -the draft. Naturally, +the draft. If no +.B \-from +switch is used when sending, +.B mhmail +will supply a \*(lqFrom:\*(rq header field using the sender's local mailbox. +Naturally, .B post will fill\-in the \*(lqSender:\*(rq header correctly. 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 +#include #include #include #include @@ -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); -- 1.7.10.4