subject: deliver.c diff from: jfesler@gigo.com This diff makes the leading "^From " lines accepted. Otherwise you have to strip them before feeding to deliver. jfesler@gigo.com *** cyrus-imapd-v1.5.19.orig/imap/deliver.c Fri Oct 16 10:59:22 1998 --- cyrus-imapd-v1.5.19/imap/deliver.c Sun Jul 9 15:38:03 2000 *************** *** 514,519 **** --- 514,533 ---- } } + /* stripfrom(buffer) will take + a multiline buffer, and if the leading line is "From .*", + remove that line from the buffer (shrinking the text length + in the process). */ + + void stripfrom(char *buf) { + char *p; + if (strncmp(buf,"From ",5)) return; + p=strchr(buf,'\n'); + if (!p) return; + p++; + memmove(buf,p,strlen(p)+1); + } + struct protstream * savemsg(return_path, idptr, notifyptr, sizeptr, lmtpmode) char *return_path; *************** *** 529,534 **** --- 543,549 ---- int sawnotifyheader = 0; char buf[8192], *p; struct stat sbuf; + int virgin; if (!idptr && !notifyptr) scanheader = 0; if (idptr) *idptr = 0; *************** *** 576,582 **** --- 591,604 ---- hostname ? hostname : ""); } + + virgin=1; while (fgets(buf, sizeof(buf)-1, stdin)) { + if (virgin) { + /* Only strip the leading "From " line if this is the first read */ + stripfrom(buf); + virgin=0; + } p = buf + strlen(buf) - 1; if (*p == '\n') { if (p == buf || p[-1] != '\r') {