[kronolith] sendmail problems (was: Reminders not conforming to RFC 2822)

Otto Stolz Otto.Stolz at uni-konstanz.de
Fri Apr 7 07:22:41 PDT 2006


Hello,

I was trying to send mail from Kronolith/Horde via the local sendmail binary.

Jan Schneider wrote:
> http://pear.php.net/mail, this error message is not coming from Horde code.

Meanwhile, I have found /opt/php4/lib/php/Mail/sendmail.php. (Though
I had hoped to get away without digging into the PHP sources.)

The problem is that it uses the PHP is_file function to check whether
the sendmail binary is a "regular file" (whatever that means). Apparently,
is_file fails if open_basedir is set -- which is not mentioned in the
PHP manual at <http://de.php.net/manual/en/function.is-file.php>. By the
way, is_file is the wrong question, anyway; the code should have asked
if the sendmail binary is_executable.

That is_file problem is already known as PEAR bug #6033
<http://pear.php.net/bugs/bug.php?id=6033>.

The work-around is to put a hard link to the sendmail binary
into the horde directory, or into the document root (parent
directory of horde).

However, then I got the message: "sendmail returned error code -1",
regardless of the RC yielded by the binary (I have tested this with
a stub).

So I endet up with the following corrections in /opt/php4/lib/php/Mail/sendmail.php:
18d17
< // Local amendmends by <Otto.Stolz at uni-konstanz.de>
122c121
<         if (@is_executable($this->sendmail_path)) { // 2005-04-03 OS
---
 >         if (@is_file($this->sendmail_path)) {
138c137
<         if ($result > 0) {  // 2005-04-03 OS
---
 >         if ($result != 0) {
and (as said above) a hardlink to the sendmail binary.

Best wishes,
   Otto Stolz








More information about the kronolith mailing list