procmail
[Top] [All Lists]

Re: Not understanding some basics

2001-12-11 06:43:18
On Mon, Dec 10, 2001 at 10:30:19PM -0700, C. Porter Bassett wrote:
Well, I now have fetchmail and procmail working together on my win2k/cygwin
machine.  I am very pleased.

I am still trying to understand what I have done.  I have read the man page
for procmail, but I am still not understanding some things.

First of all, one of the lines in my .fetchmailrc is
mda "/usr/bin/procmail -d %T" 
I cannot figure out what the purpose of the  -d %T is.  If I leave off
those flags, it still works, but each email is missing a few key lines,
without which mail readers such as mutt or pine can't read them.
These are the lines that don't get put in without the -p %T:

From porter  Mon Dec 10 20:53:47 2001
[....]
Status: O
Content-Length: 1021
Lines: 28

Sorry not sure about this.

Also, can you use procmail to filter an already existing mailfile?  As a
simple case, I set my .procmailrc to do nothing but put all messages into
my inbox.  I try to run 
$ cat mailfile | procmail
but it interprets the entire mailfile as one long email, changing the first
Content-Length: line to the length of the rest of the file.

Yes you can use procmail to filter an already existing mailfile, but you
must use formail to break it up into separate mails again and then
formail sends this to procmail.  Check out man formail.

But here is an example.  Nb. make sure that in your .procmailrc you
don't have it saving messages to the same file (mailfile) though.

If you want to use your .procmailrc file as the filter ruleset:
$ formail -s procmail < ~/mail/mailfile
Or with a custom filter file called filter.rc:
$ formail -s procmail filter.rc < ~/mail/mailfile

HTH.
Cheers.
Mark.

Attachment: pgpVptLIHbCQu.pgp
Description: PGP signature

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