procmail
[Top] [All Lists]

Re: "Couldn't chdir to /home/bdt" and "forward problems"

2000-03-28 11:11:43
"DUMONT Benoit" <vertigo17(_at_)mail(_dot_)EUnet(_dot_)pt> writes:
Here is my problem:
I created the file
/home/bdt/.procmailrc as:

PATH=/bin:/usr/bin:/sbin:/usr/sbin

Don't do this unless you *know* that the compiled in path is
inadequate, and in that case, consider just prefixing or appending the
missing directories to the compiled in the value, ala

        PATH = $PATH:/usr/local/bin


VERBOSE=yes
SHELL=/bin/sh
MAILDIR=/home/bdt

If /home/bdt is user bdt's home directory, then this isn't needed, as
procmail by default starts in $HOME.


:0c
! jerome(_at_)killine(_dot_)com
:0
! bdt(_at_)killine(_dot_)com

If user bdt's .procmailrc forwards to himself, it'll loop!  Since
procmail will deliver to the user's default mailspool if it hasn't hit a
delivering recipe by the time it completes the user's .procmailrc file,
you can just remove that second recipe.


When I test it with the command line (as user "bdt"):
procmail -m .procmailrc <test.txt
The log gives me an error "Couldn't chdir to "/home/bdt":
the log file is:

procmail: Skipped ""
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi 
jerome(_at_)killine(_dot_)com"


The problem is almost certainly that you edited the .procmailrc file on
a Windows machine which saved it with CRLFs as the line ending instead of
just LFs.  You need to remove the bogus carriage-returns.  You may be
able to do this with your editor, or you can do it from the UNIX command
line with something like:

     tf -d \\015 < .procmailrc > .procmailrc.fixed
     mv .procmailrc.fixed .procmailrc

This also explains why jerome isn't getting a copy of the message: the
message is being sent to
        jerome(_at_)killine(_dot_)com^M

which isn't a valid email address, so sendmail drops it and returns an
error.  You would have discovered this if you had placed the 'w' flag on
the recipes above.

So, drop the assignment to PATH, drop the assignment to HOME, add a 'w'
flag to the first recipe, drop the second recipe, then resave the file
with carriage-returns.


Philip Guenther

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