changeset 101936:696b3e7c297b

(mbx_delimit_begin): Also write the current time.
author Glenn Morris <rgm@gnu.org>
date Wed, 11 Feb 2009 03:59:52 +0000
parents b6d5d903f0ce
children e6f035f6e27e
files lib-src/ChangeLog lib-src/movemail.c
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Wed Feb 11 03:52:56 2009 +0000
+++ b/lib-src/ChangeLog	Wed Feb 11 03:59:52 2009 +0000
@@ -1,3 +1,7 @@
+2009-02-11  Glenn Morris  <rgm@gnu.org>
+
+	* movemail.c (mbx_delimit_begin): Also write the current time.
+
 2009-02-10  Glenn Morris  <rgm@gnu.org>
 
 	* movemail.c (mbx_delimit_begin, mbx_delimit_end): Write mbox rather
--- a/lib-src/movemail.c	Wed Feb 11 03:52:56 2009 +0000
+++ b/lib-src/movemail.c	Wed Feb 11 03:59:52 2009 +0000
@@ -683,6 +683,8 @@
 #include <winsock.h>
 #endif
 #include <pwd.h>
+#include <string.h>
+#include <time.h>
 
 #define NOTOK (-1)
 #define OK 0
@@ -923,7 +925,16 @@
 mbx_delimit_begin (mbf)
      FILE *mbf;
 {
-  if (fputs ("From movemail\n", mbf) == EOF)
+  time_t now;
+  struct tm *ltime;
+  char fromline[40] = "From movemail ";
+
+  now = time (NULL);
+  ltime = localtime (&now);
+
+  strcat (fromline, asctime (ltime));
+
+  if (fputs (fromline, mbf) == EOF)
     return (NOTOK);
   return (OK);
 }