procmail
[Top] [All Lists]

non-raw mode should always add an extra newline

1997-05-29 10:05:00
When procmail writes a message in mbox format it doesn't add an extra
blank line of the message already ends in a blank line.  This is a
mistake because it isn't reversible -- the trailing blank line in the
actual message is lost.

deliver makes this mistake, too, but BSD's mail.local and the /bin/mail
on a SVR4 derivative I have both get it right.

Here's a patch.

--- src/mailfold.c.~1~  Wed Apr  2 20:58:45 1997
+++ src/mailfold.c      Thu May 29 12:20:46 1997
@@ -84,9 +84,9 @@
       }
      while(len);
      if(!rawnonl)
-      { if(!len&&(lastdump<2||!(source[-1]=='\n'&&source[-2]=='\n')))
-          lastdump++,rwrite(s,newline,1);     /* message always ends with a */
-       emboxseparator(s);       /* newline and an optional custom separator */
+      { if(!len)
+          lastdump++,rwrite(s,newline,1);     /* message gets extra newline */
+       emboxseparator(s);               /* and an optional custom separator */
       }
 writefin:
      ;{ int serrno=errno;                     /* save any error information */
--- man/procmailrc.man.~1~      Fri Apr 11 06:29:00 1997
+++ man/procmailrc.man  Thu May 29 12:20:30 1997
@@ -177,8 +177,7 @@
 pipe).
 .TP
 .B @RAW_NONL@
-Raw mode, do not try to ensure the mail ends with an empty line, write
-it out as is.
+Raw mode, do not add an extra newline to the message, write it out as is.
 .PP
 There are some special conditions you can use that are not straight regular
 expressions.  To select them, the condition must start with:

-- 
Roderick Schertler
roderick(_at_)argon(_dot_)org

<Prev in Thread] Current Thread [Next in Thread>