Hi!

moss <[EMAIL PROTECTED]> wrote:

> On Thu, 29 Jul 1999, [iso-8859-1] Daniel Gonz�lez
> Gasull wrote:
> 
> > Also read the email-filtering-faq.  I *strongly*
> > recommend it.  It is at ftp://rtfm.mit.edu .  I
> > think it was in the /usenet/comp.mail.misc/
> > directory.  I'm not sure 8-)

I advocate you to read this FAQ.

> i've been messing around trying to config procmail
> with my setup, in various ways, but i still manage
> to fail every attempt... maybe someone out there
> can help me,, i _have_ read all the docs, but i am
> just confused as to what i need to setup

I've attached my own ~/.procmailrc for you.

> i have been using pine to connect to my
> mailserver, which has both imap and pop3... simple
> config, inbox set to {server}inbox , blah blah...
> i have been manually sorting out messages to
> folders on disk, and figured i could do it a
> better way with filters, mainly procmail

You need to fetch all the messages from the server.
You can't do that with Pine.  Pine let you pick
individually the messages from the POP server.  It's
a good feature, but it isn't good if you want to
automatically sort and filter the messages.

You need a program to fetch all the messages from
the server, and put them on your
/var/spool/mail/moss (I presume that your login at
your Linux box is "moss").  Try fetchmail
<http://www.tuxedo.org/~esr/fetchmail>.  You can
also get it from the FTP server of your Linux
distribution.

> i have not been downloading all the messages to
> disk in a local inbox (per se), but rather downing
> the mails into their appropriate folders (in
> ~/mail)... how may i use procmail to it's fullest
> advantage? will it sort the mails at the server
> itself, or will i have to down the messages to a
> local inbox, _then_ have it sort it out ?

The second.  You cannot sort the messages on the
server.

<off-topic>
An alternative to this is to use a forward email
account at http://www.bigfoot.com (It's free), and
sort the incoming messages forwarding each of them
to different email addresses depending of what you
want.  Then you can fetch the email from any of
these accounts.

I don't use Big Foot, but I know that is the best
forwarding freemail service.
</off-topic>

> also, where does the .forward come in? how is the
> whole process started?

Simply put the following line in your ~/.forward :

"|IFS=' ' && p=/usr/bin/procmail && test -f $p && exec $p -Yf- || exit 75 #moss"

Beware1: I presume that your login account at your
Linux box is "moss".

Beware2: DON'T DO THAT IF YOU STILL DON'T HAVE A
~/.procmailrc !

Hope this helps. :-)

-- 
Daniel Gonz�lez Gasull       o          "Language is a virus
mailto:[EMAIL PROTECTED]     o  __/|_ ,  from another planet."
PGP RSA key 1024/EEA93A69  o  /o    \/  -- William Burroughs
                              \__~__/\  
                                 `      
Protect privacy, boycott Intel: http://www.bigbrotherinside.org
#Set on when debugging
VERBOSE=off

#Replace 'Mail' with your mail directory (Pine uses mail, Elm uses Mail)
MAILDIR=$HOME/mail              #you'd better make sure it exists

#Directory for storing procmail log and rc files
PMDIR=$HOME/etc/procmail

PATH=/usr/local/bin:/usr/bin:/bin
DEFAULT=$MAILDIR/INBOX          #completely optional
LOGFILE=$PMDIR/log              #recommended
# INCLUDERC=$PMDIR/rc.testing   #for testing

FROM=`formail -xFrom:`
SUBJECT=`formail -xSubject:`    # regular field
RETURNRECEIPTTO=`formail -xReturn-Receipt-To:`


## Duplicated messages:
#       If  you  are subscribed to several mailinglists and people
#       cross-post to some of them, you  usually  receive  several
#       duplicate mails (one from every list).  The following sim-
#       ple recipe eliminates duplicate mails.  It  tells  formail
#       to  keep an 8KB cache file in which it will store the Mes-
#       sage-IDs of the most recent  mails  you  received.   Since
#       Message-IDs  are  guaranteed  to  be  unique for every new
#       mail, they are ideally suited to weed out duplicate mails.
#       Simply put the following recipe at the top of your rcfile,
#       and no duplicate mail will get past it.

:0 Whc: .msgid.lock
| formail -D 8192 .msgid.cache

:0 a:
duplicates

## end Duplicated messages

## Backup

# If you are fairly new to procmail and plan to experiment a
# little bit it often helps to have a  safety  net  of  some
# sort.  Inserting the following two recipes above all other
# recipes will make sure that of all  arriving  mail  always
# the  last  32 messages will be preserved.  In order for it
# to work as intended, you have to create a directory  named
# `backup' in $MAILDIR prior to inserting these two recipes.

:0 c
${MAILDIR}/backup

:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,32d`

## end Backup

##
## PGP
##
:0
* !^Content-Type: message/
* !^Content-Type: multipart/
* !^Content-Type: application/pgp
{
        # Add a "Content-Type: application/pgp" header so Mutt will know the
        # mail is encrypted.
        :0 fBw
        * ^-----BEGIN PGP MESSAGE-----
        * ^-----END PGP MESSAGE-----
        | formail -A "X-MIME-Autoconverted: to application/pgp by gasull@Atreyu with 
procmail" \
            -i "Content-Type: application/pgp; format=text; x-action=encrypt"

        # Add a "Content-Type: application/pgp" header so Mutt will know the
        # mail is signed.
        :0 fBw
        * ^-----BEGIN PGP SIGNED MESSAGE-----
        * ^-----BEGIN PGP SIGNATURE-----
        * ^-----END PGP SIGNATURE-----
        | formail -A "X-MIME-Autoconverted: to application/pgp by gasull@Atreyu with 
procmail"\
            -i "Content-Type: application/pgp; format=text; x-action=sign"
}
## End PGP

## X-sun-attachment
:0 fw
* ^Content-Type: X-sun-attachment
| emil -B ba -F MIME
## end X-sun-attachment

## 8bit
#       The following  example  preconverts  all  plain-text  mail
#       arriving  in certain encoded MIME formats into a more com-
#       pact 8-bit format which can be  used  and  displayed  more
#       easily by most programs.  The mimencode(1) program is part
#       of Nathaniel Borenstein's metamail package.

#              :0
#              * ^Content-Type: *text/plain
#              {
#                :0 fbw
#                * ^Content-Transfer-Encoding: *quoted-printable
#                | mimencode -u -q
#
#                   :0 Afhw
#                   | formail -I "Content-Transfer-Encoding: 8bit" \
#                       -A "X-MIME-Autoconverted: from quoted-printable to 8bit by 
gasull@atreyu"
#
#                :0 fbw
#                * ^Content-Transfer-Encoding: *base64
#                | mimencode -u -b
#
#                   :0 Afhw
#                   | formail -I "Content-Transfer-Encoding: 8bit" \
#                       -A "X-MIME-Autoconverted: from base64 to 8bit by gasull@atreyu"
#              }

## end 8bit

## Digests

# The next recipe will split up Digests into their individual messages.
# Don't do this if you use a global lockfile before this recipe (deadlock)

#:0
#* ^Subject:.*Digest
#|formail +1 -A \
#       "X-MIME-Autoconverted: Auto spliting up digests <gasull@Atreyu>" \
#       -ds procmail

## end Digests

## mailing lists

# +IN.news :

:0:
* ^TO.*Linux-Announce
${MAILDIR}/IN.news

:0:
* ^From.*Webmonkey Frontdoor
${MAILDIR}/IN.news

:0:
* ^From.*Wired News
${MAILDIR}/IN.news

:0:
* ^TO.*[EMAIL PROTECTED]
${MAILDIR}/IN.news

:0:
* ^TO.*[EMAIL PROTECTED]
${MAILDIR}/IN.news

:0:
* ^From.*[EMAIL PROTECTED]
${MAILDIR}/IN.news

:0:
* ^TO.*press-releases@
${MAILDIR}/IN.news


## Opened Mailing lists:

#:0
#* ^TO.*[EMAIL PROTECTED]
#|formail +1 -A \
#       "X-MIME-Autoconverted: Auto spliting up digests <gasull@Atreyu>" \
#       -A "To: Debian user <[EMAIL PROTECTED]>" -ds procmail -f

:0:
* ^TO.*[EMAIL PROTECTED]
${MAILDIR}/IN.debian-user

:0:
* ^TO.*kde-user@
${MAILDIR}/IN.kde-user

:0:
* ^TO.*[EMAIL PROTECTED]
${MAILDIR}/IN.SLUG

:0:
* ^TO.*linux-newbie@
${MAILDIR}/IN.linux-newbie

:0:
* ^TO.*linux-config@
${MAILDIR}/IN.linux-config

:0:
* ^TO.*[EMAIL PROTECTED]
${MAILDIR}/IN.mutt-users

:0:
* ^TO.*[EMAIL PROTECTED]
${MAILDIR}/IN.pgp-users

### end mailing lists

## ICQ
#       Forward all urgent mail to my ICQ
#       (and keep a copy of it here).
:0 fw
* ^X-Priority: 1
{
    :0 c
    ! [EMAIL PROTECTED]
}
## end ICQ

Reply via email to