Hi,
    Here's Rajarshi's procmail tip, which was posted earlier on this list
also. Could be possible site material - check it out..


Riddhi

+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+-
TIPS N TRICKS
+AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8-
Mail filtering :Rajarshi Guha +ADw-jijog+AEA-psynet.net+AD4-
+AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBf-

Regarding filtering,just use procmail.Now I run pine so my mail
directory is +AH4-/mail.Within this I've made several mail folders and sub
folders - these are basically plain text files.Before running procmail you
have to make .procmailrc file where you keep 'recipes' which are simple
scripts telling procmail which mail should go where.Basically the
filtering is done using regular expressions.(Procmail is
+ACo-powerful+ACo-,especially the concept of weights.Read the man pages for
procmail).I've included a few from my .procmailrc as examples

After making your recipe file,you have to follow a few steps.
Basically procmail acts on a per mail basis.So somehow we have to extract
each mail from the downloaded mail file
and pass it to procmail which will then dump it in the
required mail box.This is achieved using formail.The command line
invocation would be:

formail -s procmail +ADw- guhafam

Here guhafam is my mail file downloaded from VSNL.
The -s option tells formail to break up the input (in this case the
guhafam file) into separate mail messages and pass them to a program (in
this case procmail),starting a new program for each mail.

After this just start pine and go to your various folders and check your
mail
(In my case I've automated this: I log on,download the mail manually,log
off and run pine.In my case pine is a shell script which parses the
downloaded mail file,distributes it to my mail folders and then runs pine)

(All the above is still valid if you use Netscape.If you look at your
+AH4-/nsmail directory,you will see that most mail boxes are simple files and
nothing fancy.So you can supply these filenames as the mail boxes to
procmails recipes.)

Below is my .procmailrc.If you are receiving mail from people/sites then
filtering is very easy by checking parts of the headers.Filtering based on
words or patterns in the body can be error prone (but this is where
weighted filtering comes into play - it can be used to simulate NL
filtering)

------------------------------------

1 PATH+AD0-/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin
2 MAILDIR+AD0AJA-HOME/mail
3 DEFAULT+AD0AJA-MAILDIR/saved-messages

4 :0:
5 +ACo- +AF4-From:.+ACo-guhafam
6 /dev/null

7 :0:
8 +ACo- +AF4-Subject:.+ACo-CCL
9 +ACQ-MAILDIR/+ACI-Mailing Lists+ACI-/CompuChem


(NOTE: Remove the line numbers in the first column - I put them just for
explanatory purposes+ACE-)

Line 1: The path.Defaults to /usr/bin.It's required because from within
recipes you can run other programs (and even send autoreply's to specific
mails+ACE-)

Line 2: Your mail directory.+AH4-/mail for pine users and +AH4-/nsmail for
Netscape users.

Line 3: The mailbox where mails which cannot be filtered (ie do not meet
any of the conditions) will be dumped.

Line 4: Indicates the beggining of a recipe.This line may contain some
more flags which indicate to procmail where to apply the filtering
conditions (header or body) and whether mail processing should be
dependent on previous conditions etc (read man procmailrc)

Line 5: The actual condition.Line must start with a star and a blank
space.The remaining portion is a regular expression, which in this case,
means: any line beginning with a From: followed by 1 or more spaces
followed by a guhafam.If any such line is found in a mail it will dump
that mail in the file specified in Line 6.

Line 6: In my case this line simply specifies where to dump the mail (note
that I give the full path name of the file.In this case it's /dev/null
because I don't like to read my own posts+ACE-).Actually the portion after the
condition line (Line 5) is called the action line - you can do what not
out here.Once again check out the man pages+ACE-

Similarly,for the recipe starting on line 7 says that any mail coming with
a Subject line containing string CCL should go into the mail folder call
ed CompuChem under the +ACI-Mailing Lists+ACI- directory under my mail directory
+AH4-/mail.

I've found procmail fantastically useful and very easy to learn.It's
extremely powerful and my only regret is that I don't have a more complex
mail setup so that I could check out all the other features.Use it and
love it.
+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4Afg-




--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/faq/listfaq.html

Reply via email to