[Typo3-dev] safe mode and mail() in class.t3lib_htmlmail.php

Lars E. D. Jensen ledj-typo3 at dcmedia.biz
Mon Oct 25 17:56:35 CEST 2004


Jan-Erik Revsbech wrote:

> Unfortunally that doesn't resolve the problem. Both sendmail and many
> other mailer engines will owerwrite the returnpath of the email with ther
> user calling the sendmail command (which is exactly what mail does). You
> need to give it the -f flag in order to set the return path correctly, and
> this is what the fifth parameter in mail is for. If you have another
> solution, please let me know and I'll change it.

Well, I don't see any solution with PHP because of safe mode restrictions
but... 

one way to avoid sendmail compatible binaries replacing the Return-Path is
to add a php_admin_value to the apache virtual host conf or the global
conf...

For whatever reason it's only changeable in PHP_INI_SYSTEM mode meaning that
it can't be set through a .htaccess file.

But if you ask your ISP nicely, he may change it for you. You can change it
by adding the -f flag to your php sendmail configuration.

php_admin_value sendmail_path "/path/to/virtualhost/smexec/sendmail -t -i
-finfo at domain.com"

Then only Return-Path will be changed, everything else in the header is
untouched.
I've tested this with a sendmail compatible qmail binary.

Although it's a very static configuration, I think this is better than
having the default webserver address in your Return-Path.

Actually I don't understand why the fifth parameter has been disabled in
safe mode. IMHO safe mode should only concentrate on script permission
issues and not how external programs are called.

-- 
Med venlig hilsen / Best regards
Lars E. D. Jensen - DCmedia - TYPO3 Business Solutions
+45 3116 5002 / +45 3695 9177
ledj at dcmedia.biz - http://dcmedia.biz




More information about the TYPO3-dev mailing list