Subject: More on procmail, Pine 3.95 filtering, etc

From: [email-masked]
Date: 18 Feb 1997 17:09:55 EST

[This message has also been posted to Usenet]
Hello all,
 Thanks to everyone who responded to my earlier posting about mail filtering,
procmail, etc.

I just had another thought. I am using Tenex mailbox format for some of my
larger folders since I found that Pine 3.95 works significantly faster when
using Tenex format. 

So some folders are Tenex, others are regular UCB format. Of course, Pine
handles them seamlessly and thats one of the things I love about Pine!

That being the case, does Procmail automatically append to the mail folder in
the appropriate format after first checking the existing format or does it
blindly append in UCB format.

If so, wont it *destroy* a Tenex format folder, thus rendering it completely
unusable? 

This is a pretty darned important consideration before jumping into procmail
and I just wanted to make sure.

Thanks again,
--Vikas

---

From: ADAM Sulmicki <[email-masked]>
Date: Tue, 18 Feb 1997 17:53:16 -0500 (EST)

->That being the case, does Procmail automatically append to the mail folder in
->the appropriate format after first checking the existing format or does it
->blindly append in UCB format.
->
->If so, wont it *destroy* a Tenex format folder, thus rendering it completely
->unusable? 
->
->This is a pretty darned important consideration before jumping into procmail
->and I just wanted to make sure.

You cannot use procmail to append to tenex folder. 

You have to do something like that 
(this part is from ~/.pinerc file )
-----------------
#Pine Mailing List
#* ^TO.*pine-info
:0: pine.lock.proc
* ^From [email-masked]
| FolderIt pine 2
-----------------

(and this is contest of script FolderIt) 
-----------------
#!/bin/csh -f
umask 077
cp /dev/null /homes/adam/mail/spool/$1
sed -e 1d | tmail adam+mail/spool/$1
cat /homes/adam/mail/spool/$1 >> /homes/adam/mail/incoming/$1
if ( $2 == "2" ) then
        cat /homes/adam/mail/spool/$1 >> /homes/adam/mail/archive/$1
endif
-----------------
of course for you the important line is just the line 4 
where the mail is first pocessses by sed and then  by tmail
(the tmail and imap needed to compile tmail you can get from 
 ftp://ftp.cac.washington.edu/mail/)

so you will want put in your procmail something like 
| sed -e 1d | tmail  vikas+mail/pine

as mine script does much more, as it saves it to incoming folder and 
also makes backup copy it if when it is said to do one. (any one want
write faster version of the FolderIt script?) Aand as a side feature 
you have the copy of lates email for each folder stored in the spool dir.

..the reason for umask and spool dir is mostly b/c tmail would complain if 
the destination folder does not exist or has wrong permissions.

Beside that you can display in one window the output of procmaillog to
see what new mail is coming in (tail -f ~/mail/procmail.log) as the
pine does not inform well about new mail when multiple folders are used.

But for this you will want make those changes to tmail.c so that it does
not print all the trash out to the procmail.log 

123 vigrid% diff -c tmail.c.OLD tmail.c
*** tmail.c     Tue Feb 18 01:05:52 1997
--- tmail.c.OLD Tue Feb 18 01:03:21 1997
***************
*** 202,211 ****
        while ((c = getchar ()) != EOF) putc (c,f);
      }
      else {
+ /* ADAM #1
+    don't print info about new lines
        mm_log ("tmail called with LF-only newlines",WARN);
+ */
        if ((tmp[0] != 'F') || (tmp[1] != 'r') || (tmp[2] != 'o') ||
          (tmp[3] != 'm') || (tmp[4] != ' ')) {
        *s++ = '\015';          /* overwrite NL with CRLF */
--- 202,208 ----
***************
*** 418,428 ****
      return fail (tmp,EX_CANTCREAT);
    }
                                /* note success */
+ /* ADAM #2
+    don't print info about delivered
    sprintf (tmp,"delivered to %.80s",path);
    mm_log (tmp,NIL);
+ /*
                                /* make sure nothing evil this way comes
*/
    return delivery_unsafe (path,uid,&sbuf,tmp);
  }
--- 415,422 ----

and in ~/.procmailrc setup 
-----------------
MAILDIR=$HOME/mail/incoming
LOGFILE=$MAILDIR/procmail.log
VERBOSE=no
LOGABSTRACT=all
-----------------

and then you can add somethig like that to your .xinitrc 

xterm +ls -title "Mail Log" -geometry 80x10-0-0 \
 -e tail -f /homes/adam/mail/incoming/procmail.log &

-Adam