diff options
-rw-r--r-- | init.h | 10 | ||||
-rw-r--r-- | mutt.h | 1 | ||||
-rw-r--r-- | protos.h | 2 | ||||
-rw-r--r-- | send.c | 4 | ||||
-rw-r--r-- | sendlib.c | 13 |
5 files changed, 25 insertions, 5 deletions
@@ -410,6 +410,16 @@ struct option_t MuttVars[] = { ** Useful to avoid the tampering certain mail delivery and transport ** agents tend to do with messages. */ + { "envelope_from", DT_BOOL, R_NONE, OPTENVFROM, 0 }, + /* + ** .pp + ** When \fIset\fP, mutt will try to derive the message's \fIenvelope\fP + ** sender from the "From:" header. Note that this information is passed + ** to sendmail command using the "-f" command line switch, so don't set this + ** option if you are using that switch in $$sendmail yourself, + ** or if the sendmail on your machine doesn't support that command + ** line switch. + */ { "escape", DT_STR, R_NONE, UL &EscChar, UL "~" }, /* ** .pp @@ -284,6 +284,7 @@ enum OPTDELETEUNTAG, OPTEDITHDRS, OPTENCODEFROM, + OPTENVFROM, OPTFASTREPLY, OPTFCCATTACH, OPTFCCCLEAR, @@ -241,7 +241,7 @@ int mutt_get_password (char *, char *, size_t); int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, size_t); int mutt_get_tmp_attachment (BODY *); int mutt_index_menu (void); -int mutt_invoke_sendmail (ADDRESS *, ADDRESS *, ADDRESS *, const char *, int); +int mutt_invoke_sendmail (ADDRESS *, ADDRESS *, ADDRESS *, ADDRESS *, const char *, int); int mutt_is_autoview (BODY *, const char *); int mutt_is_mail_list (ADDRESS *); int mutt_is_message_type(int, const char *); @@ -898,8 +898,8 @@ static int send_message (HEADER *msg) return mix_send_message (msg->chain, tempfile); #endif - i = mutt_invoke_sendmail (msg->env->to, msg->env->cc, msg->env->bcc, - tempfile, (msg->content->encoding == ENC8BIT)); + i = mutt_invoke_sendmail (msg->env->from, msg->env->to, msg->env->cc, + msg->env->bcc, tempfile, (msg->content->encoding == ENC8BIT)); return (i); } @@ -1629,7 +1629,8 @@ strsysexit(int e) int -mutt_invoke_sendmail (ADDRESS *to, ADDRESS *cc, ADDRESS *bcc, /* recips */ +mutt_invoke_sendmail (ADDRESS *from, /* the sender */ + ADDRESS *to, ADDRESS *cc, ADDRESS *bcc, /* recips */ const char *msg, /* file containing message */ int eightbit) /* message contains 8bit chars */ { @@ -1660,8 +1661,15 @@ mutt_invoke_sendmail (ADDRESS *to, ADDRESS *cc, ADDRESS *bcc, /* recips */ ps = NULL; i++; } + if (eightbit && option (OPTUSE8BITMIME)) args = add_option (args, &argslen, &argsmax, "-B8BITMIME"); + + if (option (OPTENVFROM) && from && !from->next) + { + args = add_option (args, &argslen, &argsmax, "-f"); + args = add_args (args, &argslen, &argsmax, from); + } if (DsnNotify) { args = add_option (args, &argslen, &argsmax, "-N"); @@ -1850,7 +1858,8 @@ static void _mutt_bounce_message (FILE *fp, HEADER *h, ADDRESS *to, const char * mutt_copy_bytes (fp, f, h->content->length); fclose (f); - mutt_invoke_sendmail (to, NULL, NULL, tempfile, h->content->encoding == ENC8BIT); + mutt_invoke_sendmail (NULL, to, NULL, NULL, tempfile, + h->content->encoding == ENC8BIT); } if (msg) |