procmail
[Top] [All Lists]

Re: Can procmail only read from stdin?

2001-01-11 09:10:12
On 11 Jan, Frank Joerdens wrote:
| What I would like to have is all my mail initially ending up in
| /var/spool/mail/frank (this happens to be my mbox) so I can briefly scan
| 'em all and _then_ manually to invoke procmail to put everything into
| its designated folder. AFAIK procmail only reads from stdin as soon as
| mail arrives. Can you change this behaviour?
| 

You can use procmail to post-process mail files. Something like:

$ cat pmtestrc 
# pmtestrc
LOGABSTRACT=all
PMDIR=$HOME/.procmail/test
LOGFILE=$PMDIR/pmtestlog
#VERBOSE=yes

DEFAULT=$PMDIR/pmtest.def

:0
* ^From.*\<gnetsmtp(_at_)graphnet\(_dot_)com
* ^To: *\<me(_at_)TRADERSDATA(_dot_)COM
$PMDIR/pmtest

$ pwd 
/home/deh/.procmail/test
$ ls -ltr
total 64
-rw-------   1 deh      users       55727 Jan 11 09:56 pmtest.inp
-rw-------   1 deh      users         201 Jan 11 09:57 pmtestrc
$ formail -s procmail ./pmtestrc <pmtest.inp 
$ ls -ltr
total 124
-rw-------   1 deh      users       55727 Jan 11 09:56 pmtest.inp
-rw-------   1 deh      users         201 Jan 11 09:57 pmtestrc
-rw-------   1 deh      users         481 Jan 11 09:57 pmtestlog
-rw-------   1 deh      users       19244 Jan 11 09:57 pmtest.def
-rw-------   1 deh      users       36483 Jan 11 09:57 pmtest
$ cat pmtestlog
From not_from_gnetsmtp(_at_)graphnet(_dot_)com  Mon Sep 18 10:57:19 2000
 Subject: 
  Folder: /home/deh/.procmail/test/pmtest.def
From gnetsmtp(_at_)graphnet(_dot_)com  Mon Sep 18 22:38:43 2000
 Subject: 
  Folder: /home/deh/.procmail/test/pmtest
From gnetsmtp(_at_)graphnet(_dot_)com  Tue Sep 19 22:46:40 2000
 Subject: 
  Folder: /home/deh/.procmail/test/pmtest
From gnetsmtp(_at_)graphnet(_dot_)com  Thu Sep 21 23:02:11 2000
 Subject: 
  Folder: /home/deh/.procmail/test/pmtest

[Note: msg size edited from log to avoid long lines above]

You can get more hints from the list archives. I usually get there
through www.procmail.org, but that seems to be down right now.

Don



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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