]> Pileus Git - ~andy/fetchmail/commitdiff
Clean up the generated trace headers.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 29 Nov 1998 18:22:58 +0000 (18:22 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 29 Nov 1998 18:22:58 +0000 (18:22 -0000)
svn path=/trunk/; revision=2232

NEWS
driver.c
env.c

diff --git a/NEWS b/NEWS
index 9430c2dd778e3fffcded51162e708b903d3a32c3..cd3f8cf94217e9a52080423c47b568f220816ee0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
                                Release Notes:
 
+fetchmail-4.6.9 ():
+* Better RFC822 conformance in fetchmail trace headers.
+
 fetchmail-4.6.8 (Sat Nov 28 21:07:46 EST 1998):
 * Added bounce-mail capability on SMTP/ESMTP error conditions.
 * Internationalization support via GNU gettext from Arnaldo Carvalho de Melo
index cad5a82226400b233d1d525f3ca478a28d728723..42283c69e25ff8f8d7665b22596188d54dd91e2c 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -915,13 +915,17 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
        if (n != -1)
        {
            /*
+            * This header is technically invalid under RFC822.
+            * POP3, IMAP, etc. are not legal mail-parameter values.
+            *
             * We used to include ctl->remotename in this log line,
             * but this can be secure information that would be bad
             * to reveal.
             */
-           sprintf(buf, "\tby fetchmail-%s %s\r\n",
-                   RELEASE_ID,
-                   protocol->name);
+           sprintf(buf, "\tby %s with %s (fetchmail-%s)\r\n",
+                   fetchmailhost,
+                   protocol->name,
+                   RELEASE_ID);
            n = stuffline(ctl, buf);
            if (n != -1)
            {
@@ -940,7 +944,12 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
                    if (strchr(idp->id, '@'))
                        sprintf(buf+1, "for %s", idp->id);
                    else
-                       sprintf(buf+1, "for %s/%s", idp->id, ctl->destaddr);
+                       /*
+                        * This could be a bit misleading, as destaddr is
+                        * the forwarding host rather than the actual 
+                        * destination.  Most of the time they coincide.
+                        */
+                       sprintf(buf+1, "for %s@%s", idp->id, ctl->destaddr);
                    sprintf(buf+strlen(buf), " (%s); ",
                            MULTIDROP(ctl) ? "multi-drop" : "single-drop");
                }
diff --git a/env.c b/env.c
index 95d93be234cde67b4664591c8f0d068e7b121287..ee6359c459f42fc004d6405876d05614e683ed46 100644 (file)
--- a/env.c
+++ b/env.c
@@ -116,15 +116,14 @@ char *rfc822timestamp(void)
     time(&now);
 #ifdef HAVE_STRFTIME
     /*
-     * Conform to RFC822.  This is typically going to emit
-     * a three-letter timezone for %Z, which is going to
-     * be marked "obsolete syntax" in 822bis.  Note that we
-     * generate a 4-digit year here, avoiding Y2K hassles.
-     * Note: max length of this timestamp in an English locale
-     * should be 29 chars, assuming a 3-character timezone.
+     * Conform to RFC822. Note that we generate a 4-digit year here,
+     * avoiding Y2K hassles. Note: max length of this timestamp in an
+     * English locale should be 32 chars, assuming a 5-character timezone
+     * of the form [+-]nnnn.  The only things that should vary by locale
+     * are the day and month abbreviations.
      */
     strftime(buf, sizeof(buf)-1, 
-            "%a, %d %b %Y %H:%M:%S %Z", localtime(&now));
+            "%a, %d %b %Y %H:%M:%S %z", localtime(&now));
 #else
     /*
      * This is really just a portability fallback, as the