Commit 4c786d87 authored by Gregory Anders's avatar Gregory Anders Committed by Kevin J. McCarthy
Browse files

Add local_date_header option

Add an option to convert the date used in the Date header into the local
(sender's) timezone. This is the current behavior and the option
defaults to true. Unsetting this option causes the date in the Date
header to be formatted using the GMT timezone.

This option is useful for privacy-sensitive users who may not wish to
divulge their sending timezone.
parent 791fc1c6
Pipeline #303255409 passed with stages
in 3 minutes and 10 seconds
......@@ -1954,6 +1954,12 @@ struct option_t MuttVars[] = {
** from your spool mailbox to your $$mbox mailbox, or as a result of
** a ``$mbox-hook'' command.
*/
{ "local_date_header", DT_BOOL, R_NONE, {.l=OPTLOCALDATEHEADER}, {.l=1} },
/*
** .pp
** If \fIset\fP, convert the date in the Date header of sent emails into local
** (sender's) timezone.
*/
{ "mail_check", DT_NUM, R_NONE, {.p=&BuffyTimeout}, {.l=5} },
/*
** .pp
......
......@@ -480,6 +480,7 @@ enum
OPTINCLUDEENCRYPTED,
OPTINCLUDEONLYFIRST,
OPTKEEPFLAGGED,
OPTLOCALDATEHEADER,
OPTMUTTLISPINLINEEVAL,
OPTMAILCAPSANITIZE,
OPTMAILCHECKRECENT,
......
......@@ -1759,8 +1759,18 @@ BODY *mutt_remove_multipart_alternative (BODY *b)
void mutt_make_date (BUFFER *s)
{
time_t t = time (NULL);
struct tm *l = localtime (&t);
time_t tz = mutt_local_tz (t);
struct tm *l;
time_t tz = 0;
if (option (OPTLOCALDATEHEADER))
{
l = localtime (&t);
tz = mutt_local_tz (t);
}
else
{
l = gmtime (&t);
}
tz /= 60;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment