]> code.citadel.org Git - citadel.git/blobdiff - citadel/netmailer.c
* IMAP date strings. More stupidity.
[citadel.git] / citadel / netmailer.c
index 90a8bb83edae3c14a964ab44f368b04367cee843..b0a28e200ffdcfa540e71897c882d3ec333a3cc6 100644 (file)
@@ -1,9 +1,7 @@
 /*
- * netmailer for Citadel/UX
- * see copyright.doc for copyright information
+ * $Id$
  *
  * netproc calls this to export Citadel mail to RFC822-compliant mailers.
- * $Id$
  */
 
 #include <stdlib.h>
@@ -16,6 +14,7 @@
 #include <limits.h>
 #include <syslog.h>
 #include "citadel.h"
+#include "genstamp.h"
 
 void LoadInternetConfig(void);
 void get_config(void);
@@ -198,7 +197,8 @@ int main(int argc, char **argv)
        FILE *fp, *rmail;
        char sbuf[200], rbuf[200], cstr[100], fstr[128];
        char nbuf[64], pbuf[128], rmname[128], buf[128];
-       char subject[200];
+       char datestamp[256];
+       char subject[256];
        time_t mid_buf;
        time_t now;
        int mlist = 0;
@@ -206,7 +206,7 @@ int main(int argc, char **argv)
        openlog("netmailer", LOG_PID, LOG_USER);
        get_config();
        LoadInternetConfig();
-       sprintf(temp, tmpnam(NULL));    /* temp file name */
+       strcpy(temp, tmpnam(NULL));     /* temp file name */
 
        if ((argc < 2) || (argc > 3)) {
                fprintf(stderr, "netmailer: usage: "
@@ -286,7 +286,8 @@ int main(int argc, char **argv)
         */
        fprintf(rmail, "To: %s\n", rbuf);
        time(&now);
-       fprintf(rmail, "Date: %s", asctime(localtime(&now)));
+       datestring(datestamp, now, DATESTRING_RFC822);
+       fprintf(rmail, "Date: %s\n", datestamp);
        fprintf(rmail, "Message-Id: <%ld@%s>\n", (long) mid_buf, nbuf);
        fprintf(rmail, "X-Mailer: %s\n", CITADEL);
        fprintf(rmail, "Subject: %s\n", subject);