diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-09-25 19:01:38 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-09-25 19:01:38 +0000 |
commit | 6d0db4109170a7b21f7da4b8acfb1ba30e2569b1 (patch) | |
tree | b23b811b0fe3ee73f2eadf95a7f0ede90013cc22 | |
parent | 7fd9a29550578849f6b83730f9274f7fc0db626d (diff) | |
download | fetchmail-6d0db4109170a7b21f7da4b8acfb1ba30e2569b1.tar.gz fetchmail-6d0db4109170a7b21f7da4b8acfb1ba30e2569b1.tar.bz2 fetchmail-6d0db4109170a7b21f7da4b8acfb1ba30e2569b1.zip |
Use stuffline to emit the bug-tracking header.
svn path=/trunk/; revision=1415
-rw-r--r-- | driver.c | 57 |
1 files changed, 32 insertions, 25 deletions
@@ -1054,41 +1054,48 @@ int num; /* index of message */ SMTP_data(ctl->smtp_socket); } + /* utter any per-message Received information we need here */ + n = 0; + sprintf(buf, "Received: from %s\n", ctl->server.truename); + if (stuffline(ctl, buf) != -1) { - time_t now; - - /* write a line describing fetchmail's processing of the message */ - sprintf(buf, - "Received: from %s\n\tby %s (fetchmail-%s %s run by %s)\n", - ctl->server.truename, + sprintf(buf, "\tby %s (fetchmail-%s %s run by %s)\n", fetchmailhost, RELEASE_ID, protocol->name, - ctl->remotename); - - if (!good_addresses) - sprintf(buf + strlen(buf), - "\tfor <%s@%s> (by default); ", - user, desthost); - if (good_addresses == 1) + ctl->remotename); + if (stuffline(ctl, buf) != -1) { - for (idp = xmit_names; idp; idp = idp->next) - if (idp->val.num == XMIT_ACCEPT) - { - sprintf(buf + strlen(buf), "\tfor <%s@%s> (%s); ", - idp->id, desthost, - MULTIDROP(ctl) ? "multi-drop" : "single-drop"); - break; /* only report first address */ - } + time_t now; + + buf[0] = '\t'; + if (good_addresses == 0) + { + sprintf(buf+1, + "for <%s@%s> (by default); ", + user, desthost); + } + else if (good_addresses == 1) + { + for (idp = xmit_names; idp; idp = idp->next) + if (idp->val.num == XMIT_ACCEPT) + break; /* only report first address */ + sprintf(buf+1, "for <%s@%s> (%s); ", + idp->id, desthost, + MULTIDROP(ctl) ? "multi-drop" : "single-drop"); + } + else + buf[1] = '\0'; + + time(&now); + strcat(buf, ctime(&now)); + n = stuffline(ctl, buf); } - time(&now); - strcat(buf, ctime(&now)); - strcpy(buf + strlen(buf) - 1, "\n"); } /* ship out the synthetic Received line and the headers */ - if (stuffline(ctl, buf) < 0 || stuffline(ctl, headers) < 0) + if (n == -1 || stuffline(ctl, headers) < 0) { error(0, errno, "writing RFC822 headers"); if (ctl->mda) |