Ordinarily, whenever
sendmail executes a program via the
prog delivery agent, it does so from within the
sendmail queue directory. One unfortunate side
effect of this behavior is that shell scripts written with the C
shell (and possibly other programs) can fail because they cannot
stat(2) the current directory. To alleviate this
problem, V8 sendmail introduced the
D= delivery agent equate. This equate allows you
to specify a series of directories for sendmail
to attempt to chdir(2) into before invoking the
delivery program.
The form of the D= delivery agent equate looks
like this:
D=path1:path2...
The D= is followed by a colon-separated series of
directory pathnames. Before running the delivery program,
sendmail tries to chdir(2)
into each in turn, leftmost to rightmost, until it succeeds. If it
does not succeed with any of the directories (perhaps because none of
them exists), sendmail remains in its queue
directory.
One recommended setting for the D= delivery agent
equate is this:
D=$z:/
Here, sendmail first tries to
chdir(2) into the directory defined by the
$z sendmail macro ($z). That macro either contains the full pathname
of the recipient's home directory or is NULL. If it
is NULL or if the home directory is unavailable, the
chdir(2) fails, and
sendmail instead does a
chdir(2) to the / (root)
directory.
In using V8 sendmail's
mc configuration, the value given to
D= can be easily changed only for the
prog delivery agent, which defaults to:
D=$z:/
For prog it can be redefined by using
LOCAL_SHELL_DIR, as, for example:
define(`LOCAL_SHELL_DIR', `$z:/disks/3/secure') this must be
MAILER(`local') before this
Here, LOCAL_SHELL_DIR is given a new value before the
prog delivery agent is loaded (via the
local).
For all other delivery agents you must first copy an existing
delivery agent definition, then modify it as outlined in Section 20.3.2.
If the D= argument is missing, the following error
is printed and D= becomes undefined:
mailer agent_name: null working directory