John,

Using fetchmail and procmail are far easier than the HOWTO's present
them. Using fetchmail is just a matter of issuing the command to get the
mail from the server by a user in a terminal window. Like this:

        fetchmail mail.hostname.com     <ENTER>

If your system $USERname differs from that of your ISP username, (that
which appears in your email address before the "@" symbol then you would
invoke fetchmail like this:

        fetchmail -u username mail.hostname.com

If you want it to run as a daemon in the background simply add "-d 150" in
the syntax. That will cause fetchmail to poll the mail server every 150
seconds. There is also a utility included with Mandrake called
Fetchmailconf that will allow you to setup and .fetchmailrc file on your
system that will poll the server as soon as a net connection is detected
when ever you connect to the net.

As for procmail the only thing you have to do to use that is to setup up a
.procmailrc file in your home dir and you're set. It get's read every time
fetchmail get's the mail because fetchmail hands off the mail upon
receiving it to procmail who then delivers the mail to
/var/spool/mail/$USER. I've sent along a copy of my .procmailrc file for
you to look at. Please feel free to do what ever you wish with it. If you
want to use it or any portion of it just save it to your home dir as
.procmailrc and it will work. Notice though how the "recipes" are
constructed. That's the secret of using procmail to do your filtering. If
you want more documentation check the man pages for procmail and
procmailex.

-- 
Mark

/*      I never worry about the to-jams.
 *      Once I've stuck my foot in my mouth
 *      it's already too late...just make sure
 *      you chew them thoroughly before swallowing!
 */     
        Registered Linux user #182496
             *   Pine 4.21   *

On Mon, 23 Oct 2000 5:36pm ,John Rye spake passionately in a message:

> Larry Marshall wrote:
> > 
> > > I'm not sure if that's possible.
> > 
> > I'm not sure what in the message you don't think is possible so I
> > can't comment on this.
> > 
> > > Although I have been wondering about that
> > > myself. Fetchmail gets the mail from the ISP and passes passes the mail
> > > off to procmail who then filters the messages and deposits them to their
> > > prescribed destination. Those that are destined for my "Inbox" get
> > > deposited in /var/spool/mail/$USER. Other messages that are defined in
> > > .procmailrc are place in their respective folders in $HOME/mail where Pine
> > > reads them.
> > 
> > Here, however, I think you're presuming too much.  There are many ways
> > to skin this cat and procmail is only one of them.  I don't even have
> > procmail setup and yet filter inbound mail heavily.  This could be
> > part of my problem when using Pine (as you've suggested) but it will
> > filter/distribute mail to a number of folders without even a hint of
> > .procmailrc in my home directory.  Netscape doesn't even deal with
> > standard mailrouting and everything gets dumped into ~/nsmail which
> > holds the folders.
> > 
> > The problem I've seen with Pine has something to do with Pine's
> > operation, not inbound mail in my view.  I suspect that it has to do
> > with how the eXpunge command purges its buffer.  If I don't leave Pine
> > loaded all the time I don't have the problem.  If I do, I can delete
> > msgs and all of a sudden I can have as many as 3 copies of the same
> > bunch of msgs back in the mail folders.  Since my normal operation is
> > to D all msgs as I read them (except for those I want to keep which
> > are filed into other folders) followed with an X before leaving the
> > folder, these complete replica sets of the msgs I'd read a couple
> > hours previously (and they're in the same order as they were when I
> > read them) is easy to see.
> 
> Adding to my earlier one - it's now obvious that the fetchmail/procmail
> combo will do what I want to do, all I have to do now is absorb the
> fetchmail and procmail howtos simultaneously!!
> 
> Cheers
> 
> 
#.procmailrc
# routes incoming mail to appropriate boxes
PATH=/usr/bin:/usr/bin/local
MAILDIR=$HOME/mail
DEFAULT=/var/spool/mail/mdw1982
LOGFILE=$HOME/procmail/log
SHELL=/bin/sh

####################################################
#               THE KILL FILE FILTER               #
####################################################
# this filter is going to take care of those       #
# annoying jerks on the mailing lists that insist  #
# on talking about Napster, and just plain have    #
# bad attitudes                                    #
####################################################
# THE FOLLOWING RETARDS HAVE MADE IT TO THE 'KILL LIST
# HALL OF FAME:
# FROM: *Mwinold                SUBJECT: *Napster
# FROM: *[EMAIL PROTECTED]
#############################################################################
# recipe for killing dup messages from mailing lists
:0 Wh: msgid.lock
| formail -D 8192 msgid.cache

###################################################################
###################################################################
# rules for running the kill list
# Napster
:0:
* ^Subject:.*(Napster|napster|Gnutella|MP3|sex|XXX|girls|Girls)
/dev/null

:0:
* ^Subject:.*(Cnet|Money|Time|Work at Home|work at home)
/dev/null

# kill filter for morons sending XML Commerce Pro cart messages
:0:
* ^Subject:.*(XML CommnercePro - Cart 4082 Disabled)
/dev/null

# George Bush OT 
:0:
* ^Subject:.*(OT Microsoft and George W. Bush)
/dev/null

# filter for CartNetwork - these guys just don't get it and I'm not going to 
# either any more! :)

:0:
* ^From:.*(CartNetwork <[EMAIL PROTECTED]>)
/dev/null

# filter to kill the miserable George Bush thread that just won't DIE
:0:
* ^Subject:.*(OT Microsoft and George W. Bush)
/dev/null
######################################################################
#       END KILL FILTER         **      END KILL FILTER         ######
######################################################################


############################################################
# The Twit filter ## The Twit Filter #######################
############################################################
:0:
* ^From:.*(Mwinold)
/dev/null

:0:
* ^From:.*([EMAIL PROTECTED])
/dev/null

############################################################
#       END TWIT FILTER         **      END TWIT FILTER ####
############################################################

############################################################
#       RULES FOR SUBSCRIBED MAILING LISTS      ############
############################################################

######################
# MANDRAKE NEWBIE LIST
######################
#first mail rule - rule for linux newbie list
:0:
* ^Subject:.*(newbie)
newbie # puts all mail from the newbie list in this folder

####################
MANDRAKE EXPERT LIST
####################
# second rule - rule for linux expert list
:0:
* ^Subject:.*(expert)
expert # places all mail from the expert list into it's folder

####################
# LINUX TODAY E-MAGS
####################
# filter rule for Linux Today
:0:
* ^From:.*(Linux Today|Linux Central New Products)
linuxtoday

####################
# LINWARE LIST UNSUBED
####################
# third rule - rule to place mail from linware list to it's folder
:0:
* ^(From|Cc|To).*linware
#linware
/dev/null

##########################
# KERNEL PANIC NEWBIE LIST
##########################
# filter rule for kplug newbie list 
:0:
* ^(To|Cc|From).*kplug-newbie
kplug-newbie

##############################
# KERNEL PANIC DISCUSSION LIST
##############################
# filter rule for kplug discussion list
:0:
* ^(To|Cc|From).*kplug-list
kplug-list


# this rule is currently not in use
# rule for mysql
#:0:
#* ^(From|To|Cc).*mysql
#mysql

# rule to filter for exmh-users
:0:
* ^(Reply-To|To).*exmh-users
/dev/null

Reply via email to