[Exim] trusted_users apache and php_admin_value sendmail_fro…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jez Hancock
Päiväys:  
Vastaanottaja: Exim Users List
Aihe: [Exim] trusted_users apache and php_admin_value sendmail_from
Hi,

I'm trying to configure apache (php actually) on a per vhost basis
to send email from the local user that owns the vhost/domain.

I have the following in my exim configuration file:

trusted_users = www
trusted_groups = www

(where apache runs as the 'www' user)

and I have this in my apache httpd.conf file:

<VirtualHost 213.152.51.194:80>
    ServerName psycasz-fear.com
    ServerAlias www.psycasz-fear.com psychasz-fear.com www.psychasz-fear.com www.sfear.co.uk sfear.co.uk
    ServerAdmin webmaster@???
    DocumentRoot /home/psycasz/web/www.psycasz-fear.com
    php_admin_value sendmail_path "/usr/local/sbin/exim -f webmaster@???"
</VirtualHost>


I am running the following script - /home/psycasz/web/www.psycasz-fear.com/forum/mailtest.php -
via a browser to test the configuration:

<?php
if ($_POST["address"]=="") {

echo "<form action=\"mailtest.php\" method=post><p>Address to email: <input type=text name=address></p>";
echo "<p><input type=submit value=\"Send email\"></p>";

} else {

mail($_POST["address"],"Testing mail() function","This is a test email", "From: webmaster@???");

echo "<p>Mail sent. Were any errors shown? If there were, mail is probably not set up correctly.</p>";
phpinfo();
}

?>

However when I enter any email address in the address form field, the
mail is not processed by Exim at all - let alone sent with the 'From:'
header set correctly.

Are there any glaring problems with the above?

FWIW:

- the output from phpinfo(); shows the sendmail_from php.ini value *is*
set correctly to: "/usr/local/sbin/exim -f webmaster@???"

- the address webmaster@??? *is* valid and functioning
correctly

- after removing the 'php_admin_value' line from the apache vhost
config, the mailtest.php script *does* work correctly - although of
course it still bounces mail back to the exim postmaster user which is
exactly what I'm trying to avoid :P

Many thanks for your time.

--
Jez Hancock
- System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - personal weblog
http://ipfwstats.sf.net/        - ipfw peruser traffic logging