procmail
[Top] [All Lists]

new to procmail (bugs?)

1998-06-03 10:21:06
Hi,

I have started using procmail and am having some problems.
I am running procmail within a script given in the man page to sort all
my incoming mail
that gets popped by using Netscape messenger.  I want to sort all mail
in the file $HOME/.mail/Inbox


Here are the problems I am having.  (using procmail v3.10 1994/10/31)

Here is an entry in my .procmailrc

    :0
    * ^To(_dot_)*port-i386(_at_)NetBSD(_dot_)ORG
    NetBSD.sbd/port-i386

I am assuming here that it will look for the "NetBSD.sbd" directory
under my $MAILDIR
but it does not.  If I explicitely put in this entry:
    :0
    * ^To(_dot_)*port-i386(_at_)NetBSD(_dot_)ORG
    $MAILDIR/NetBSD.sbd/port-i386

this still will not work.   ($MAILDIR is set to
/export/home/rsimmons/.mail/
The error I get is "could not write to
/export/home/rsimmons//NetBSD.sbd/port-i386

(notice the two slashes where .mail should be)
It's as if it does read the environment variable but since .mail begins
with a dot it
gets ignored.  Is this a bug?

I have to put in the full path of the directory but I do not want this.
I want everything relative to
some environment variable.  I am sure I had this working like this one
time before.  Any ideas
on how to avoid putting in the absolute path to the folder where I want
to store mail?

----
Also I have ORGMAIL set in my script like:
export ORGMAIL=$HOME/.mail/Inbox

after running the script everything in Inbox gets erased and put in
/var/spool/mail/rsimmons
How do I make my script just leave everything in the Inbox file and not
put in /var/spool/mail/rsimmons?

Thanks

RS

--
Here is the script that I am using as given in man procmail

#!/bin/bash

ORGMAIL=$HOME/.mail/Inbox
echo "Making backup of Inbox";
cp $ORGMAIL $ORGMAIL.bak

 if cd $HOME &&
    test -s $ORGMAIL &&
    lockfile -r0 -l3600 .newmail.lock 2>/dev/null
 then
        trap "rm -f .newmail.lock" 1 2 3 15
        umask 077

         lockfile -l3600 -ml
        cat $ORGMAIL >>.newmail &&
        cat /dev/null >$ORGMAIL
        lockfile -mu
        echo "Sorting Mail.  Please wait ...";
        formail -s procmail < .newmail &&
        rm -f .newmail
        rm -f .newmail.lock
 fi
echo "Done";
exit 0





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