From: David Levine Date: Wed, 13 Jun 2012 02:36:16 +0000 (-0500) Subject: Generate a From: header, using localmbox, if the user doesn't provide X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=74d6825e0e5dd0b44ed8438f2dbcc0a1ef3602c7;p=mmh Generate a From: header, using localmbox, if the user doesn't provide a -from when sending with mhmail. --- 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);