procmail
[Top] [All Lists]

Re: forward mechanism

1997-03-09 20:52:04
On Sun, 9 Mar 1997 18:31:50 -0500 (EST),
walt(_at_)snowhite(_dot_)cis(_dot_)uoguelph(_dot_)ca wrote:
NOTE: My logname is walt but the home directory is cs1272.

This is very funny.

the .forward doesn't work and contains:
"|IFS=' '&&p=/stud/senior/cs1272/bin.dec/procmail&&test -f $p&&exec $p -Y 
f-||exit 75 #walt"

What does "doesn't work" mean exactly? It just doesn't get invoked?

4)  What does your .procmailrc look like (including any INCLUDERC
files)?
<...>
INCLUDERC=$PMDIR/rc.testing
INCLUDERC=$PMDIR/rc.maillists

I would imagine that was supposed to mean "including the contents of
any INCLUDERC files" :^)

5)  What is the fully qualified path to the directory where Pine
expects to find its folders?
~/pine_mail and spool is /var/spool/mail/$LOGNAME
on a NFS mounted directory on another machine.

(How does Pine know where the spool is? You set $MAIL for it? Or you
start it up with an explicit pathname?)

6)  Can you capture and include the exact error message(s) you are
receiving?
I ran the following script (as suggested in the procmail manpage):

A lot of the lockfile voodoo in that script is for the situation where
you run this periodically without any supervision. If you can just
move your mail spool somewhere else and split it while you're
watching, the operational line in the example script is the "formail
-ns procmail" one. This will take the file read on standard input and
split it back into messages which are then fed to Procmail one by one.

The problem with fiddling with your inbox is that if you receive mail
while you are fiddling, you will screw up. Now, don't try this at
home, but I have succeeded in moving my inbox to a different file
without losing any mail. However, as a security measure, you should be
placing a lock on the spool while moving it somewhere.

Naive and dangerous way to do it:

 $ # Kids, don't try this at home
 $ cp /var/spool/mail/walt /tmp/inbox && echo -n >/var/spool/mail/walt

Here's a version which is much more comfortable but which you might
need to tweak a little: 

 $ ls -l /var/spool/mail/walt          # take note of permissions just in case
 $ lockfile /var/spool/mail/walt.lock  # now lock it while copying
 $ cp /var/spool/mail/walt /tmp/inbox
 $ cmp /var/spool/mail/walt /tmp/inbox # make sure there's no differences
 $ >/var/spool/mail/walt               # truncate original, we have a copy
 $ rm -f /var/spool/mail/walt.lock     # release lock now

 $ formail -ns procmail </tmp/inbox    # feed mail to Procmail

Since the script you tried actually tells you what's wrong, it
shouldn't be too hard to fix, either. The lockfile(1) manual page
tells you it tries to figure out what your mail spool is by looking at
the /etc/passwd file, but since as you say you have a fairly
nonstandard setup, it can't, and so it fails. Instead of -ml or -mu,
try the lockfile and rm commands from the above snippet. Test them in
interactive use first, though. In particular, you might not have
permission to create the lockfile in the spool directory yourself.
(You may be able to persuade your admin to give lockfile applicable
setgid permissions if it doesn't have them.)

(Another caution: On my home system, I was not able to prevent mail
delivery to myself by taking a lock on my $MAIL file. Is this not what
is supposed to happen? Didn't matter if I used lockfile -ml or an
explicit $MAIL.lock. Here at the University it seemed to work as I
expected at least with -ml.)

+ lockfile -l1024 -ml 
lockfile: Can't determine your mailbox, who are you?
Usage: lockfile -nnn | -r nnn | -l nnn | -s nnn | -! | -ml | -mu | file ...

So what this one is trying is essentially equivalent to 
lockfile -l1024 /var/spool/mail/walt.lock 

+ lockfile -mu 
lockfile: Can't determine your mailbox, who are you?
Usage: lockfile -nnn | -r nnn | -l nnn | -s nnn | -! | -ml | -mu | file ...

And this one tries to remove that same lockfile, i.e. 
rm -f /var/spool/mail/walt.lock

procmail: Couldn't create "/var/spool/mail/1272"

Wasn't that supposed to be "cs1272"?

I hope I haven't made anything less clear with this ... I'm sure the
gurus on the list will point out any errors in the above. 

Hope this helps,

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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