summaryrefslogtreecommitdiff
path: root/maidag
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-12-08 21:11:55 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2011-12-08 21:11:55 +0200
commitada8b8cfa6957d99831c7318e572628006b1ca66 (patch)
treee97372c7fed0232a91103bb9b23f3c74dc435599 /maidag
parent76cc330864a9680365123c86f8d5a394f952dcc5 (diff)
downloadmailutils-ada8b8cfa6957d99831c7318e572628006b1ca66.tar.gz
mailutils-ada8b8cfa6957d99831c7318e572628006b1ca66.tar.bz2
Use UTC in From_ separators in accordance with RFC 4155.
* examples/mta.c (make_tmp): Use gmtime + mu_c_streamftime to create From_ line. * libmailutils/mailbox/msgenv.c (message_envelope_date): Use gmtime. * maidag/deliver.c (make_tmp): Likewise. * maidag/lmtp.c (cfun_data): Likewise. * readmsg/readmsg.c (print_unix_header): Use gmtime.
Diffstat (limited to 'maidag')
-rw-r--r--maidag/deliver.c5
-rw-r--r--maidag/lmtp.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/maidag/deliver.c b/maidag/deliver.c
index 4cff626a9..d6279e72e 100644
--- a/maidag/deliver.c
+++ b/maidag/deliver.c
@@ -69,9 +69,12 @@ make_tmp (const char *from)
if (from)
{
time_t t;
+ struct tm *tm;
time (&t);
- mu_stream_printf (out, "From %s %s", from, ctime (&t));
+ tm = gmtime (&t);
+ mu_stream_printf (out, "From %s ", from);
+ mu_c_streamftime (out, "%c%n", tm, NULL);
}
else
{
diff --git a/maidag/lmtp.c b/maidag/lmtp.c
index 0273e20cc..b06927e90 100644
--- a/maidag/lmtp.c
+++ b/maidag/lmtp.c
@@ -346,6 +346,7 @@ cfun_data (mu_stream_t iostr, char *arg)
int rc;
mu_stream_t flt, tempstr;
time_t t;
+ struct tm *tm;
int xlev = MU_XSCRIPT_PAYLOAD, xlev_switch = 0, buf_switch = 0;
struct mu_buffer_query oldbuf;
@@ -375,7 +376,10 @@ cfun_data (mu_stream_t iostr, char *arg)
/* Write out envelope */
time (&t);
- rc = mu_stream_printf (tempstr, "From %s %s", mail_from, ctime (&t));
+ tm = gmtime (&t);
+ rc = mu_stream_printf (tempstr, "From %s ", mail_from);
+ if (rc == 0)
+ rc = mu_c_streamftime (tempstr, "%c%n", tm, NULL);
if (rc)
{
maidag_error (_("copy error: %s"), mu_strerror (rc));

Return to:

Send suggestions and report system problems to the System administrator.