aboutsummaryrefslogtreecommitdiffstats
path: root/mail/popper
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1998-06-30 14:42:18 +0800
committerache <ache@FreeBSD.org>1998-06-30 14:42:18 +0800
commit04bbd53b2d2da9e7ec57bb24f699bb589c79d5ed (patch)
treecd24947c4876bf1121fd559feaa2757ee7034e6d /mail/popper
parent536a4de838e4a65fc1ec7939fc0acd06fbe99efd (diff)
downloadfreebsd-ports-gnome-04bbd53b2d2da9e7ec57bb24f699bb589c79d5ed.tar.gz
freebsd-ports-gnome-04bbd53b2d2da9e7ec57bb24f699bb589c79d5ed.tar.zst
freebsd-ports-gnome-04bbd53b2d2da9e7ec57bb24f699bb589c79d5ed.zip
Fix two longstanding bugs with Return-Path patch
1) wrong mbox size calculation 2) Return-Path was _never_ sent out
Diffstat (limited to 'mail/popper')
-rw-r--r--mail/popper/files/patch-ad129
1 files changed, 87 insertions, 42 deletions
diff --git a/mail/popper/files/patch-ad b/mail/popper/files/patch-ad
index 65055ce13f06..620e4d77c1bd 100644
--- a/mail/popper/files/patch-ad
+++ b/mail/popper/files/patch-ad
@@ -13,18 +13,23 @@ Return-Path not skipped, fixed now.
-- Andrey Chernov
8-Oct-1997
-*** pop_dropcopy.c.orig Fri Jul 25 21:42:07 1997
---- pop_dropcopy.c Wed Oct 8 10:36:34 1997
+This patch hits again: wrong mbox size calculation and Return-Path was never
+writted out
+ -- Andrey Chernov
+ 30-Jun-1998
+
+*** pop_dropcopy.c.orig Thu Nov 20 00:20:38 1997
+--- pop_dropcopy.c Tue Jun 30 10:19:40 1998
***************
-*** 151,156 ****
---- 151,187 ----
+*** 155,160 ****
+--- 155,191 ----
return(ti != 0);
}
+ char *
+ return_path (const char *unixfrom)
+ {
-+ static char tmpbuf[BUFSIZ];
++ static char tmpbuf[MAXLINELEN];
+ int fromlen = sizeof("From ") - 1;
+ const char *fp, *hp, *cp, *ep;
+
@@ -42,13 +47,13 @@ Return-Path not skipped, fixed now.
+
+ if (hp) {
+ ep = strrchr(++hp, '\n');
-+ snprintf(tmpbuf, sizeof(tmpbuf), "Return-Path: %.*s!%.*s\n",
++ snprintf(tmpbuf, sizeof(tmpbuf)-2, "Return-Path: %.*s!%.*s",
+ ep - hp, hp,
+ cp - fp, fp);
+ } else
-+ snprintf(tmpbuf, sizeof(tmpbuf), "Return-Path: %.*s\n",
++ snprintf(tmpbuf, sizeof(tmpbuf)-2, "Return-Path: %.*s",
+ cp - fp, fp);
-+
++ strcat(tmpbuf, "\n");
+ return tmpbuf;
+ }
+
@@ -56,8 +61,8 @@ Return-Path not skipped, fixed now.
* with thousands of mail spool files. Unix uses a linear list to
* save directory information and the following methods attempt to
***************
-*** 275,280 ****
---- 306,312 ----
+*** 279,284 ****
+--- 310,316 ----
char buffer[MAXLINELEN]; /* Read buffer */
MD5_CTX mdContext;
unsigned char digest[16];
@@ -66,8 +71,8 @@ Return-Path not skipped, fixed now.
#ifdef DEBUG
if(p->debug)
***************
-*** 340,345 ****
---- 372,380 ----
+*** 343,348 ****
+--- 375,383 ----
(p->mmdf_separator ? !strcmp(p->mmdf_separator, buffer) :
isfromline(buffer))) {
@@ -78,20 +83,24 @@ Return-Path not skipped, fixed now.
/* skip over the MMDF trailer */
expecting_trailer = 0;
***************
-*** 385,390 ****
---- 420,428 ----
+*** 388,393 ****
+--- 423,435 ----
mp->retr_flag = FALSE;
mp->orig_retr_state = FALSE;
mp->uidl_str = "\n";
+ mp->return_path = rpath ? strdup(rpath) : NULL;
-+ if (rpath)
-+ mp->length += strlen(rpath) + 1;
++ if (rpath) {
++ int i = strlen(rpath) + 1;
++ mp->length += i;
++ p->drop_size += i;
++ mp->lines++;
++ }
#ifdef DEBUG
if(p->debug)
pop_log(p,POP_DEBUG, "Msg %d being added to list", mp->number);
***************
-*** 463,468 ****
---- 501,508 ----
+*** 466,471 ****
+--- 508,515 ----
mp->retr_flag = TRUE;
mp->orig_retr_state = TRUE;
}
@@ -101,8 +110,8 @@ Return-Path not skipped, fixed now.
} else {
content_nchar += nchar;
***************
-*** 502,507 ****
---- 542,548 ----
+*** 505,510 ****
+--- 549,555 ----
int content_length, content_nchar, cont_len;
MD5_CTX mdContext;
unsigned char digest[16];
@@ -111,8 +120,8 @@ Return-Path not skipped, fixed now.
FILE *mail_drop; /* Streams for fids */
***************
-*** 574,579 ****
---- 615,623 ----
+*** 577,582 ****
+--- 622,630 ----
(p->mmdf_separator ? !strcmp(p->mmdf_separator, buffer) :
isfromline(buffer))) {
@@ -123,20 +132,31 @@ Return-Path not skipped, fixed now.
expecting_trailer = 0;
continue;
***************
-*** 619,624 ****
---- 663,671 ----
+*** 622,628 ****
mp->retr_flag = FALSE;
mp->orig_retr_state = FALSE;
mp->uidl_str = "\n";
-+ mp->return_path = rpath ? strdup(rpath) : NULL;
-+ if (rpath)
-+ mp->length += strlen(rpath) + 1;
-
+!
+ #ifdef DEBUG
+ if(p->debug)
+ pop_log(p,POP_DEBUG, "Msg %d being added to list", mp->number);
+--- 670,682 ----
+ mp->retr_flag = FALSE;
+ mp->orig_retr_state = FALSE;
+ mp->uidl_str = "\n";
+! mp->return_path = rpath ? strdup(rpath) : NULL;
+! if (rpath) {
+! int i = strlen(rpath) + 1;
+! mp->length += i;
+! p->drop_size += i;
+! mp->lines++;
+! }
#ifdef DEBUG
if(p->debug)
+ pop_log(p,POP_DEBUG, "Msg %d being added to list", mp->number);
***************
-*** 701,706 ****
---- 748,755 ----
+*** 705,710 ****
+--- 759,766 ----
mp->retr_flag = TRUE;
mp->orig_retr_state = TRUE;
}
@@ -145,18 +165,6 @@ Return-Path not skipped, fixed now.
}
} else {
content_nchar += nchar;
---- pop_send.c Mon Feb 17 13:14:25 1997
-+++ pop_send.c Mon Feb 17 13:15:28 1997
-@@ -84,6 +84,9 @@
- /* Skip the first line (the sendmail "From" or MMDF line) */
- (void)fgets (buffer,MAXMSGLINELEN,p->drop);
-
-+ if (mp->return_path)
-+ pop_sendline(p, mp->return_path);
-+
- /* Send the header of the message followed by a blank line */
- while (fgets(buffer, MAXMSGLINELEN, p->drop)) {
- if (!strncasecmp(buffer, "Content-Length:", 15) ||
--- popper.h Mon Feb 17 13:15:44 1997
+++ popper.h Mon Feb 17 13:35:48 1997
@@ -260,6 +263,8 @@
@@ -168,3 +176,40 @@ Return-Path not skipped, fixed now.
} MsgInfoList;
typedef struct { /* POP parameter block */
+*** pop_send.c.old Thu Nov 20 00:20:38 1997
+--- pop_send.c Tue Jun 30 10:06:23 1998
+***************
+*** 38,43 ****
+--- 38,44 ----
+ register int msg_num;
+ register int msg_lines;
+ register int uidl_sent = 0;
++ register int rpath_sent = 0;
+ char buffer[MAXMSGLINELEN];
+
+ /* Convert the first parameter into an integer */
+***************
+*** 86,91 ****
+--- 87,93 ----
+ /* Send the header of the message followed by a blank line */
+ while (fgets(buffer, MAXMSGLINELEN, p->drop)) {
+ if (!strncasecmp(buffer, "Content-Length:", 15) ||
++ (mp->return_path && !strncasecmp(buffer,"Return-Path:",12)) ||
+ !strncasecmp(buffer, "X-UIDL:", 7)) { /* Skip UIDLs */
+ continue; /* Content-Length is MTA dependent, don't send to MUA */
+ }
+***************
+*** 96,101 ****
+--- 98,109 ----
+ sprintf(uidl_buf, "%s %s", "X-UIDL:", mp->uidl_str);
+ pop_sendline(p, uidl_buf);
+ uidl_sent++;
++ }
++ if (mp->return_path && !rpath_sent && (*buffer=='\n' ||
++ !strncasecmp(buffer,"Status:",7) ||
++ !strncasecmp(buffer,"Received:",9))) {
++ pop_sendline(p, mp->return_path);
++ rpath_sent++;
+ }
+
+ pop_sendline(p, buffer);