Autor: Brian Candler Datum: To: Bruce Richardson, Marc Perkel CC: Exim Users Betreff: Re: [exim] Apache executing Exim
On Wed, Mar 23, 2005 at 09:42:53AM +0000, Bruce Richardson wrote: > On Tue, Mar 22, 2005 at 10:01:10PM -0800, Marc Perkel wrote:
> > I'm trying to figure out which apache script is generating messages. How
> > can I change something so that there's some way to figure out what
> > script is creating what messages.
>
> You can use -oMr to change the value placed in $received_protocol. So
> have each script invoke sendmail/exim with a different value for that
> parameter.
... as long as your Apache user or group is listed in trusted_users or
trusted_groups.
Assuming that your CGI is doing a fork/exec of exim, another solution is
temporarily to replace exim with a script which makes a note of what its
parent is, which at that instant should be the CGI itself. This means you
don't have to touch the scripts themselves.
Example (untested): if you are invoking /usr/exim/bin/exim, move it out of
the way and replace it with
#!/bin/sh
echo "I am $$, parent is $PPID: `ps -p $PPID`" >>/tmp/exim.log
exec /usr/exim/bin/exim-4.50-1 "$@"
Remember to chmod +x this script. Any lost mail as a result of experimenting
with this script is entirely your own responsibility however! :-)