procmail
[Top] [All Lists]

Re: Procmail forking question (fwd)

1995-11-08 17:43:10
According to David W. Tamkin:
-> Mike Sprague had a cloning problem:
-> | ... it seems to use the wrong path name for the rcfile and gives the "Lost
-> | x" error.  Here x is /usr/local/mail/smartlist/./rc.submit.  I noticed that
-> | when flist starts the rc.submit rcfile, it does it with a relative path of
-> | ./rc.submit.  So for some reason, the fork attempts to use the full path to
-> | the smartlist user's home directory, then the ./rc.submit, so it fails.
-> 
-> You're right on the money about what's going wrong; if procmail is started
-> with the -m option (as flist starts it), all relative paths to rcfiles are
-> interpreted from the current directory; if $MAILDIR has been changed, the cwd
-> has changed, because procmail always chdirs to $MAILDIR.  That's why rcfiles
-> that clone procmail need to be specified on the command line with absolute
-> paths (or without -m, in which case they are considered relative to the uid's
-> $HOME, which doesn't get changed when $MAILDIR is changed).
-> 
-> I wonder why others haven't complained about this.  Did you add, remove, or
-> alter a MAILDIR assignment somewhere in SmartList's rcfiles?
-> 
-> Here's my only other suggestion.  My changes are commented:
-> 
->     # Assign these before procmail can be cloned:
->     olddir=$MAILDIR
->     MAILDIR=/path/to/directory/that/contains/rc.submit
-> 
->     :0 A c
->     * ? test -f $olddir/accept.txt # accept.txt's location is now $olddir
->     {
-> 
->       :0 fh
->       | formail -i"From: $listreq" -kbrtA"X-Loop: $listaddr" ; \
->      cat $olddir/accept.txt # as above
-> 
->       :0
->       ! $sendmailOPT -t
->     }
-> 
->     MAILDIR=$olddir # to set it back in case no clone was forked
->                  # or in case handoff to $SENDMAIL failed

        Thanks again Dave for the advice.  I tried your suggestion yet it
did not work.  For whatever reason, procmail seems to remain in the directory
above the list's directory (/usr/local/mail/smartlist and the list directory
is /usr/local/mail/smartlist/testing) even after I set the MAILDIR to
the list's directory.  Also, I still do not see why procmail trys to find
'/usr/local/mail/smartlist/./rc.submit' when it's supposed to be using 
relative paths; unless that is just how the error statement shows things.

        Is it possible I messed up the installation?  I don't see how no one
has come across this before.  I didn`t change the MAILDIR at all when I first
installed the software and I have only added the few lines Dave suggested.
The only place I can see where MAILDIR is set is rc.main, which doesn't even
get called, so I assume MAILDIR is set to /usr/local/mail/smartlist (the
list owner's homedir) by default.  BTW, rc.main sets MAILDIR to .etc.

        Another strange one is that the SmartList Manual says flist is supposed
to chdir to the list's dirctory, but it does not seem to do that.  Maybe I just
do not have a good enough understanding of what is going on.  I'm pretty good
at setting up UNIX stuff (it's my job!), yet this is really driving me nuts.

        Any ideas?  BTW, I appreciate everyone's help with this.  Also, could
someone let me know how to subscribe to the SmartList mailing list?

thanks,
mikeS

-- 
Mike Sprague  |       North Shore Access       | BOFH wannabe & UNIX SysAdmin 
mfs(_at_)shore(_dot_)net |  require 'std_disclaimer.pl'   |

"Can you still have fun?" - E. Anastasio

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Procmail forking question (fwd), mike sprague <=