Hi Inigo,
Well you've got lots of questions - and I've got a few answers.
Firstly,if the VSNL help-desk is right (!!??!!) then the student mail
server is POP3 enabled.I don't know too much about POP3,but I assume you
need a TCP/IP link for fetchmail to access your mail account.This is not
possible in the student account case.I'm also a little confused about
this,so if anybody can enlighten us on how to use fetchmail (if at all
possible) on a student account,I'm waiting.
At the moment I use the archaic way of going to the cmd line,typing sz
$MAIL and then running pine and deleting all my messages.If somebody can
help out regarding POP3 access then the problem of sending mail in batches
would also be solved as well as that of downloading mail.
Now,regarding filtering,just use procmail.Now I run pine so my mail
directory is ~/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
*powerful*,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 (in Inigo's case it would be
called inigo) 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 < 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
~/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=/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin
2 MAILDIR=$HOME/mail
3 DEFAULT=$MAILDIR/saved-messages
4 :0:
5 * ^From:.*guhafam
6 /dev/null
7 :0:
8 * ^Subject:.*CCL
9 $MAILDIR/"Mailing Lists"/CompuChem
10 :0:
11 * (^Subject:.*ilug-cal)|(^Reply-To:.*ilug-cal)|(^From:.*indradg)
12 $MAILDIR/"Mailing Lists"/"ILUG - Cal"
(NOTE: Remove the line numbers in the first column - I put them just for
explanatory purposes!)
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!)
Line 2: Your mail directory.~/mail for pine users and ~/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!).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!
Consider the recipe starting at Line 10.Here I need not specify any flags
since the default is to check in the header.Next my condition states that
if any line beginning with Subject: followed by one or more spaces and
then ilug-cal OR any mail in which the Reply-to address is ilug-cal OR any
mail from Indra should go into the file ILUG - CAL which is contained in
the directory "Mailing Lists" under y mail directory ~/mail.
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 "Mailing Lists" directory under my mail directory
~/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.
Bye,
Rajarshi
<[EMAIL PROTECTED]>
----------------------------------------------
Do molecular biologists wear designer genes ??
----------------------------------------------
Any sufficiently advanced technology is
indistinguishable from magic.
-- Arthur C. Clarke
-----------------------------------------------
--
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