procmail
[Top] [All Lists]

Re: forwarding message to multiple recipients

2000-08-10 07:02:18
When Remo asked,

D> What path does the variable $MAILDIR point to? I haven't been able to find
D> where that variable is defined. What is this poor newbie missing?

Collin advised,

P> according to the manpage (man procmailrc) it's "$HOME/" -- unless your
P> site has something in /etc/procmailrc or something like that which
P> modifies it.  To find out, do something like this:

P>     :0 fbwi
P>     * ^Subject: MagicStringThatNeverAppearsInRealMail
P>     | echo $MAILDIR

P> and send a mail with that subject.

Better, 

   :0
   * ^Subject: magicstring etc.
   { LOG="MAILDIR is $MAILDIR
" }

than running echo, especially if there is no executable named echo and the
only echo is the one built into the shell.  If the only echo is the one
built into the shell, procmail won't find it unless you invoke a shell; also,
unless you're using procmail's -m option, procmail's stdout is closed, so 
echo will write nowhere, but LOG= writes to stderr.  Stderr will go to the
logfile if you've set one; otherwise it will go to the parent process's
stderr, so if you invoke procmail from an interactive command line, LOG=
will write to the terminal screen.

Anyhow, when procmail is invoked, MAILDIR defaults to $HOME (with two excep-
tions), but if you change the value of MAILDIR in your rcfile, or if procmail
is the LDA and it is changed in /etc/procmailrc, procmail chdirs to the new
value of MAILDIR.  Essentially, assigning MAILDIR is how you cd in a procmail
rcfile.

(The exceptions: if the rcfile is named on the command line and it starts
with "./" or if you invoke procmail with the -m option, MAILDIR defaults to
the current directory where the process was when procmail was invoked.)


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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