fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [11295] api: add switch for email-logging


From: Sigurd Nes
Subject: [Fmsystem-commits] [11295] api: add switch for email-logging
Date: Mon, 16 Sep 2013 13:20:18 +0000

Revision: 11295
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11295
Author:   sigurdne
Date:     2013-09-16 13:20:16 +0000 (Mon, 16 Sep 2013)
Log Message:
-----------
api: add switch for email-logging

Modified Paths:
--------------
    trunk/admin/templates/base/config.tpl
    trunk/phpgwapi/inc/class.mailer_smtp.inc.php
    trunk/phpgwapi/inc/class.send.inc.php

Modified: trunk/admin/templates/base/config.tpl
===================================================================
--- trunk/admin/templates/base/config.tpl       2013-09-16 11:49:22 UTC (rev 
11294)
+++ trunk/admin/templates/base/config.tpl       2013-09-16 13:20:16 UTC (rev 
11295)
@@ -118,7 +118,31 @@
                        </select>
                </td>
        </tr>
+
+       <tr class="row_on">
+    <td>{lang_SMTPDebug}:</td>
+               <td>
+                       <select name="newsettings[SMTPDebug]">
+                               <option value="0">{lang_No}</option>
+                               <option 
value="1"{selected_SMTPDebug_1}>commands</option>
+                               <option 
value="2"{selected_SMTPDebug_2}>commands and data</option>
+                       </select>
+               </td>
+       </tr>
+
+       <tr class="row_off">
+    <td>{lang_Debugoutput}:</td>
+               <td>
+                       <select name="newsettings[Debugoutput]">
+                               <option value="echo">echo</option>
+                               <option 
value="html"{selected_Debugoutput_html}>html</option>
+                               <option 
value="errorlog"{selected_Debugoutput_errorlog}>error log</option>
+                       </select>
+               </td>
+       </tr>
        
+ 
+ 
    <tr class="th">
     <td colspan="2">&nbsp;<b>{lang_appearance}</b></td>
        </tr>

Modified: trunk/phpgwapi/inc/class.mailer_smtp.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.mailer_smtp.inc.php        2013-09-16 11:49:22 UTC 
(rev 11294)
+++ trunk/phpgwapi/inc/class.mailer_smtp.inc.php        2013-09-16 13:20:16 UTC 
(rev 11295)
@@ -33,10 +33,47 @@
                        $this->PluginDir = PHPGW_INCLUDE_ROOT . 
'/phpgwapi/inc/phpmailer/';
                        $this->Host = 
$GLOBALS['phpgw_info']['server']['smtp_server'];
                        $this->Port = 
isset($GLOBALS['phpgw_info']['server']['smtp_port']) ? 
$GLOBALS['phpgw_info']['server']['smtp_port'] : 25;
-                       $this->SMTPAuth = 
isset($GLOBALS['phpgw_info']['server']['smtpAuth']) && 
$GLOBALS['phpgw_info']['server']['smtpAuth'] == yes ? true : false;
                        $this->SMTPSecure = 
isset($GLOBALS['phpgw_info']['server']['smtpSecure']) ? 
$GLOBALS['phpgw_info']['server']['smtpSecure'] : '';
-                       $this->Username = 
isset($GLOBALS['phpgw_info']['server']['smtpUser']) ? 
$GLOBALS['phpgw_info']['server']['smtpUser'] : '';
-                       $this->Password =  
isset($GLOBALS['phpgw_info']['server']['smtpPassword']) ? 
$GLOBALS['phpgw_info']['server']['smtpPassword'] : '';
                        $this->Version = 'custom - phpGroupWare 1.73';
+                       $this->CharSet = 'utf-8';
+ 
+                       if ( 
isset($GLOBALS['phpgw_info']['server']['smtpAuth']) && 
$GLOBALS['phpgw_info']['server']['smtpAuth'] == 'yes' )
+                       {
+                               $this->SMTPAuth = true;
+                               $this->Username = 
isset($GLOBALS['phpgw_info']['server']['smtpUser']) ? 
$GLOBALS['phpgw_info']['server']['smtpUser'] : '';
+                               $this->Password =  
isset($GLOBALS['phpgw_info']['server']['smtpPassword']) ? 
$GLOBALS['phpgw_info']['server']['smtpPassword'] : '';
+                       }
+                       
+                   /**
+                    * SMTP class debug output mode.
+                    * Options: 0 = off, 1 = commands, 2 = commands and data
+                    * @type int
+                    */
+
+                       if ( 
isset($GLOBALS['phpgw_info']['server']['SMTPDebug']) )
+                       {
+                           $this->SMTPDebug = 
(int)$GLOBALS['phpgw_info']['server']['SMTPDebug'];
+                       }
+
+                   /**
+                * The function/method to use for debugging output.
+                * Options: 'echo', 'html' or 'error_log'
+                * @type string
+                * @see SMTP::$Debugoutput
+                */
+
+                       if ( 
isset($GLOBALS['phpgw_info']['server']['Debugoutput']) && 
$GLOBALS['phpgw_info']['server']['smtpAuth'] != 'echo' )
+                       {
+                               switch 
($GLOBALS['phpgw_info']['server']['Debugoutput'])
+                               {
+                                       case 'html':
+                                       $this->Debugoutput =  'html';
+                                       break;
+                                       case 'errorlog':
+                                       $this->Debugoutput =  'error_log';
+                                       break;
+                               default:
+                               }
+                       }
                }
        }

Modified: trunk/phpgwapi/inc/class.send.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.send.inc.php       2013-09-16 11:49:22 UTC (rev 
11294)
+++ trunk/phpgwapi/inc/class.send.inc.php       2013-09-16 13:20:16 UTC (rev 
11295)
@@ -157,16 +157,11 @@
                        $smtp->IsSMTP();
                        $smtp->Subject = $subject;
                        $smtp->Body    = $body;
-                       $smtp->AddCustomHeader('X-Mailer: phpGroupWare 
(http://www.phpgroupware.org)');
+                       $smtp->AddCustomHeader('X-Mailer: fmsystem 
(http://www.fmsystem.no)');
                        if($receive_notification)
                        {
                                
$smtp->AddCustomHeader("Disposition-Notification-To: {$smtp->From}");
                        }
-                       $smtp->Port = 
$GLOBALS['phpgw_info']['server']['smtp_port'] ? 
$GLOBALS['phpgw_info']['server']['smtp_port'] : 25;
-                       $smtp->Host     = 
$GLOBALS['phpgw_info']['server']['smtp_server'];
-                       $smtp->Encoding = '8bit';
-                       $smtp->CharSet = 'utf-8';
-                       $smtp->PluginDir = 
PHPGW_SERVER_ROOT."/phpgwapi/inc/phpmailer/";
 
                        if($content_type =='html')
                        {
@@ -192,13 +187,6 @@
                                }
                        }
 
-                       if ( $GLOBALS['phpgw_info']['server']['smtp_auth'] == 
'True' )
-                       {
-                               $smtp->SMTPAuth = true;
-                               $smtp->Username = 
$GLOBALS['phpgw_info']['server']['smtp_user'];
-                               $smtp->Password = 
$GLOBALS['phpgw_info']['server']['smtp_password'];
-                       }
-
                        // set a higher timeout for big messages
                        @set_time_limit(120);
                        #$smtp->SMTPDebug = 10;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]