From: Thomas Roessler Date: Mon, 11 Jun 2001 16:55:57 +0000 (+0000) Subject: Use the EMAIL environment variable as the default for $from. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e1e219a7a1928a9c7cb8600624a206b801fdeb1;p=neomutt Use the EMAIL environment variable as the default for $from. --- diff --git a/doc/mutt.man b/doc/mutt.man index 66c87e1e0..0766c01b2 100644 --- a/doc/mutt.man +++ b/doc/mutt.man @@ -17,7 +17,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. .\" -.TH mutt 1 "July 2000" Unix "User Manuals" +.TH mutt 1 "June 2001" Unix "User Manuals" .SH NAME .PP mutt \- The Mutt Mail User Agent @@ -97,6 +97,8 @@ command which contains new mail. .PP .IP "EDITOR" Editor to invoke when composing a message. +.IP "EMAIL" +The user's e-mail address. .IP "HOME" Full path of the user's home directory. .IP "MAIL" diff --git a/doc/muttbug.man b/doc/muttbug.man index 27f92a48e..5b9aad8ee 100644 --- a/doc/muttbug.man +++ b/doc/muttbug.man @@ -1,7 +1,7 @@ .\" -*-nroff-*- .\" .\" -.\" Copyright (C) 1996-2000 Thomas Roessler +.\" Copyright (C) 1996-2000 Thomas Roessler .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -197,4 +197,4 @@ AUTHOR .PP .B flea and this manual page were written by Thomas Roessler -. +. diff --git a/init.c b/init.c index 3200851ae..792b16c8e 100644 --- a/init.c +++ b/init.c @@ -1808,6 +1808,9 @@ void mutt_init (int skip_sys_rc, LIST *commands) FREE (&token.data); } + if ((p = getenv ("EMAIL")) != NULL) + From = rfc822_parse_adrlist (NULL, p); + mutt_set_langinfo_charset (); mutt_set_charset (Charset); diff --git a/init.h b/init.h index a4bbeea0a..41291401e 100644 --- a/init.h +++ b/init.h @@ -577,12 +577,14 @@ struct option_t MuttVars[] = { { "forw_quote", DT_SYN, R_NONE, UL "forward_quote", 0 }, /* */ - { "from", DT_ADDR, R_NONE, UL &From, UL "" }, + { "from", DT_ADDR, R_NONE, UL &From, 0 }, /* ** .pp ** When set, this variable contains a default from address. It ** can be overridden using my_hdr (including from send-hooks) and ** ``$$reverse_name''. + ** .pp + ** Defaults to the EMAIL environment variable's content. */ { "gecos_mask", DT_RX, R_NONE, UL &GecosMask, UL "^[^,]*" }, /*