commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-512-gada8b8c


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-512-gada8b8c
Date: Thu, 08 Dec 2011 19:13:35 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=ada8b8cfa6957d99831c7318e572628006b1ca66

The branch, master has been updated
       via  ada8b8cfa6957d99831c7318e572628006b1ca66 (commit)
      from  76cc330864a9680365123c86f8d5a394f952dcc5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ada8b8cfa6957d99831c7318e572628006b1ca66
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Dec 8 21:11:55 2011 +0200

    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.

-----------------------------------------------------------------------

Summary of changes:
 examples/mta.c                |    5 ++++-
 libmailutils/mailbox/msgenv.c |    2 +-
 libproto/imap/mbox.c          |    5 +----
 maidag/deliver.c              |    5 ++++-
 maidag/lmtp.c                 |    6 +++++-
 readmsg/readmsg.c             |    2 +-
 6 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/examples/mta.c b/examples/mta.c
index 4b15317..c9572b9 100644
--- a/examples/mta.c
+++ b/examples/mta.c
@@ -222,6 +222,7 @@ make_tmp (mu_stream_t in)
   if (n >= 5 && memcmp (buf, "From ", 5))
     {
       time_t t;
+      struct tm *tm;
       const char *from = from_address ();
       if (!from)
        {
@@ -230,7 +231,9 @@ make_tmp (mu_stream_t in)
        }
          
       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);
     }
 
   mu_stream_write (out, buf, n, NULL);
diff --git a/libmailutils/mailbox/msgenv.c b/libmailutils/mailbox/msgenv.c
index 57f3a07..9577c0d 100644
--- a/libmailutils/mailbox/msgenv.c
+++ b/libmailutils/mailbox/msgenv.c
@@ -57,7 +57,7 @@ message_envelope_date (mu_envelope_t envelope, char *buf, 
size_t len,
       char tmpbuf[MU_DATETIME_FROM_LENGTH+1];
       t = time (NULL);
       n = mu_strftime (tmpbuf, sizeof tmpbuf, 
-                       MU_DATETIME_FROM, localtime (&t));
+                       MU_DATETIME_FROM, gmtime (&t));
       n = mu_cpystr (buf, tmpbuf, len);
     }
   if (pnwrite)
diff --git a/libproto/imap/mbox.c b/libproto/imap/mbox.c
index c8a0dea..87cc10c 100644
--- a/libproto/imap/mbox.c
+++ b/libproto/imap/mbox.c
@@ -1536,11 +1536,8 @@ imap_envelope_date (mu_envelope_t envelope, char 
*buffer, size_t buflen,
      parsed, use the calendar time. */
   if (now == (time_t)-1)
     {
-      struct tm *gmt;
-
       time (&now);
-      gmt = gmtime (&now);
-      tm = *gmt;
+      tm = *gmtime (&now);
     }
 
   {
diff --git a/maidag/deliver.c b/maidag/deliver.c
index 4cff626..d6279e7 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 0273e20..b06927e 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));
diff --git a/readmsg/readmsg.c b/readmsg/readmsg.c
index 367c746..d06977f 100644
--- a/readmsg/readmsg.c
+++ b/readmsg/readmsg.c
@@ -184,7 +184,7 @@ print_unix_header (mu_message_t message)
       struct tm *tm;
 
       t = time (NULL);
-      tm = localtime (&t);
+      tm = gmtime (&t);
       mu_strftime (datebuf, sizeof datebuf, MU_DATETIME_FROM, tm);
       buf = datebuf;
     }


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]