Fixed problem with calling /usr/sbin/postconf when this file does not exist. Now...
authorJan-Erik Revsbech <jer@moccompany.com>
Mon, 24 Jan 2005 15:33:18 +0000 (15:33 +0000)
committerJan-Erik Revsbech <jer@moccompany.com>
Mon, 24 Jan 2005 15:33:18 +0000 (15:33 +0000)
exists.

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@541 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_htmlmail.php

index f7a646a..7d5cd22 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+2004-01-24  Jan-Erik Revsbech  <jer@moccompany.com>
+       * The check to see if Postfix version 1.XX is used requires that the executable /usr/sbin/postconf exists. If it does not exists, some php configurations will die with an error. Now htmlmail makes a check to see if the files exists before calling it.
 2004-01-22  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Fixed bug #0000668: Removed spurious comma (,) from pages table definition in t3lib/stddb/tables.sql
index 9e396d0..d2f0695 100755 (executable)
@@ -246,17 +246,22 @@ class t3lib_htmlmail {
 
 
        /**
+        * Constructor for the class. Make a check to see if Postfix version below 2.XX is used. 
+        * If this is the case all calls to mail() must not be called with the -f parameter to correctly set
+        * the Return-Path header.
         * @return      [type]          ...
         */
        function t3lib_htmlmail () {
                if(!ini_get('safe_mode')) {
                        $res = Array();
-                       @exec('/usr/sbin/postconf mail_version',$res);
-                       if(!empty($res[0])) {
-                               $temp = explode("=",$res[0]);
-                               list($major,$minor,$micro) = explode(".",trim($temp[1]));
-                               if($major == 1) {
-                                       $this->postfix_version1 = true;
+                       if(file_exists('/usr/sbin/postconf')) {
+                               @exec('/usr/sbin/postconf mail_version',$res);
+                               if(!empty($res[0])) {
+                                       $temp = explode("=",$res[0]);
+                                       list($major,$minor,$micro) = explode(".",trim($temp[1]));
+                                       if($major == 1) {
+                                               $this->postfix_version1 = true;
+                                       }
                                }
                        }
                }