Merge branch 'master' of github.com:Froxlor/Froxlor
This commit is contained in:
8
js/jquery.min.js
vendored
8
js/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PHPMailer SPL autoloader.
|
* PHPMailer SPL autoloader.
|
||||||
* PHP Version 5.0.0
|
* PHP Version 5
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @link https://github.com/PHPMailer/PHPMailer/
|
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
* @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2013 Marcus Bointon
|
* @copyright 2012 - 2014 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
@@ -30,5 +30,20 @@ function PHPMailerAutoload($classname)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register('PHPMailerAutoload');
|
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
|
||||||
|
//SPL autoloading was introduced in PHP 5.1.2
|
||||||
|
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||||
|
spl_autoload_register('PHPMailerAutoload', true, true);
|
||||||
|
} else {
|
||||||
|
spl_autoload_register('PHPMailerAutoload');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* Fall back to traditional autoload for old PHP versions
|
||||||
|
* @param string $classname The name of the class to load
|
||||||
|
*/
|
||||||
|
function __autoload($classname)
|
||||||
|
{
|
||||||
|
PHPMailerAutoload($classname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,102 +1,117 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PHPMailer RFC821 SMTP email transport class.
|
* PHPMailer RFC821 SMTP email transport class.
|
||||||
* Version 5.2.7
|
* PHP Version 5
|
||||||
* PHP version 5.0.0
|
|
||||||
* @category PHP
|
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @link https://github.com/PHPMailer/PHPMailer/
|
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
* @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @copyright 2013 Marcus Bointon
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2004 - 2008 Andy Prevost
|
* @copyright 2014 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer RFC821 SMTP email transport class.
|
* PHPMailer RFC821 SMTP email transport class.
|
||||||
*
|
* Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.
|
||||||
* Implements RFC 821 SMTP commands
|
|
||||||
* and provides some utility methods for sending mail to an SMTP server.
|
|
||||||
*
|
|
||||||
* PHP Version 5.0.0
|
|
||||||
*
|
|
||||||
* @category PHP
|
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @link https://github.com/PHPMailer/PHPMailer/blob/master/class.smtp.php
|
|
||||||
* @author Chris Ryan <unknown@example.com>
|
* @author Chris Ryan <unknown@example.com>
|
||||||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SMTP
|
class SMTP
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The PHPMailer SMTP Version number.
|
* The PHPMailer SMTP version number.
|
||||||
|
* @type string
|
||||||
*/
|
*/
|
||||||
const VERSION = '5.2.7';
|
const VERSION = '5.2.8';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP line break constant.
|
* SMTP line break constant.
|
||||||
|
* @type string
|
||||||
*/
|
*/
|
||||||
const CRLF = "\r\n";
|
const CRLF = "\r\n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SMTP port to use if one is not specified.
|
* The SMTP port to use if one is not specified.
|
||||||
|
* @type int
|
||||||
*/
|
*/
|
||||||
const DEFAULT_SMTP_PORT = 25;
|
const DEFAULT_SMTP_PORT = 25;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The maximum line length allowed by RFC 2822 section 2.1.1
|
||||||
|
* @type int
|
||||||
|
*/
|
||||||
|
const MAX_LINE_LENGTH = 998;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PHPMailer SMTP Version number.
|
* The PHPMailer SMTP Version number.
|
||||||
* @type string
|
* @type string
|
||||||
* @deprecated This should be a constant
|
* @deprecated Use the constant instead
|
||||||
* @see SMTP::VERSION
|
* @see SMTP::VERSION
|
||||||
*/
|
*/
|
||||||
public $Version = '5.2.7';
|
public $Version = '5.2.8';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP server port number.
|
* SMTP server port number.
|
||||||
* @type int
|
* @type int
|
||||||
* @deprecated This is only ever ued as default value, so should be a constant
|
* @deprecated This is only ever used as a default value, so use the constant instead
|
||||||
* @see SMTP::DEFAULT_SMTP_PORT
|
* @see SMTP::DEFAULT_SMTP_PORT
|
||||||
*/
|
*/
|
||||||
public $SMTP_PORT = 25;
|
public $SMTP_PORT = 25;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP reply line ending
|
* SMTP reply line ending.
|
||||||
* @type string
|
* @type string
|
||||||
* @deprecated Use the class constant instead
|
* @deprecated Use the constant instead
|
||||||
* @see SMTP::CRLF
|
* @see SMTP::CRLF
|
||||||
*/
|
*/
|
||||||
public $CRLF = "\r\n";
|
public $CRLF = "\r\n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug output level.
|
* Debug output level.
|
||||||
* Options: 0 for no output, 1 for commands, 2 for data and commands
|
* Options:
|
||||||
|
* * `0` No output
|
||||||
|
* * `1` Commands
|
||||||
|
* * `2` Data and commands
|
||||||
|
* * `3` As 2 plus connection status
|
||||||
|
* * `4` Low-level data output
|
||||||
* @type int
|
* @type int
|
||||||
*/
|
*/
|
||||||
public $do_debug = 0;
|
public $do_debug = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The function/method to use for debugging output.
|
* How to handle debug output.
|
||||||
* Options: 'echo', 'html' or 'error_log'
|
* Options:
|
||||||
|
* * `echo` Output plain-text as-is, appropriate for CLI
|
||||||
|
* * `html` Output escaped, line breaks converted to <br>, appropriate for browser output
|
||||||
|
* * `error_log` Output to error log as configured in php.ini
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
public $Debugoutput = 'echo';
|
public $Debugoutput = 'echo';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to use VERP.
|
* Whether to use VERP.
|
||||||
|
* @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
|
||||||
|
* @link http://www.postfix.org/VERP_README.html Info on VERP
|
||||||
* @type bool
|
* @type bool
|
||||||
*/
|
*/
|
||||||
public $do_verp = false;
|
public $do_verp = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SMTP timeout value for reads, in seconds.
|
* The timeout value for connection, in seconds.
|
||||||
|
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
||||||
|
* This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
|
||||||
|
* @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
|
||||||
* @type int
|
* @type int
|
||||||
*/
|
*/
|
||||||
public $Timeout = 15;
|
public $Timeout = 300;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SMTP timelimit value for reads, in seconds.
|
* The SMTP timelimit value for reads, in seconds.
|
||||||
@@ -137,7 +152,6 @@ class SMTP
|
|||||||
$this->smtp_conn = 0;
|
$this->smtp_conn = 0;
|
||||||
$this->error = null;
|
$this->error = null;
|
||||||
$this->helo_rply = null;
|
$this->helo_rply = null;
|
||||||
|
|
||||||
$this->do_debug = 0;
|
$this->do_debug = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,8 +178,7 @@ class SMTP
|
|||||||
break;
|
break;
|
||||||
case 'echo':
|
case 'echo':
|
||||||
default:
|
default:
|
||||||
//Just echoes whatever was received
|
echo gmdate('Y-m-d H:i:s')."\t".trim($str)."\n";
|
||||||
echo $str;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,19 +195,19 @@ class SMTP
|
|||||||
{
|
{
|
||||||
// Clear errors to avoid confusion
|
// Clear errors to avoid confusion
|
||||||
$this->error = null;
|
$this->error = null;
|
||||||
|
|
||||||
// Make sure we are __not__ connected
|
// Make sure we are __not__ connected
|
||||||
if ($this->connected()) {
|
if ($this->connected()) {
|
||||||
// Already connected, generate error
|
// Already connected, generate error
|
||||||
$this->error = array('error' => 'Already connected to a server');
|
$this->error = array('error' => 'Already connected to a server');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($port)) {
|
if (empty($port)) {
|
||||||
$port = self::DEFAULT_SMTP_PORT;
|
$port = self::DEFAULT_SMTP_PORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect to the SMTP server
|
// Connect to the SMTP server
|
||||||
|
if ($this->do_debug >= 3) {
|
||||||
|
$this->edebug('Connection: opening');
|
||||||
|
}
|
||||||
$errno = 0;
|
$errno = 0;
|
||||||
$errstr = '';
|
$errstr = '';
|
||||||
$socket_context = stream_context_create($options);
|
$socket_context = stream_context_create($options);
|
||||||
@@ -207,7 +220,6 @@ class SMTP
|
|||||||
STREAM_CLIENT_CONNECT,
|
STREAM_CLIENT_CONNECT,
|
||||||
$socket_context
|
$socket_context
|
||||||
);
|
);
|
||||||
|
|
||||||
// Verify we connected properly
|
// Verify we connected properly
|
||||||
if (empty($this->smtp_conn)) {
|
if (empty($this->smtp_conn)) {
|
||||||
$this->error = array(
|
$this->error = array(
|
||||||
@@ -217,13 +229,15 @@ class SMTP
|
|||||||
);
|
);
|
||||||
if ($this->do_debug >= 1) {
|
if ($this->do_debug >= 1) {
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
'SMTP -> ERROR: ' . $this->error['error']
|
'SMTP ERROR: ' . $this->error['error']
|
||||||
. ": $errstr ($errno)"
|
. ": $errstr ($errno)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($this->do_debug >= 3) {
|
||||||
|
$this->edebug('Connection: opened');
|
||||||
|
}
|
||||||
// SMTP server can take longer to respond, give longer timeout for first read
|
// SMTP server can take longer to respond, give longer timeout for first read
|
||||||
// Windows does not have support for this timeout function
|
// Windows does not have support for this timeout function
|
||||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||||
@@ -233,14 +247,11 @@ class SMTP
|
|||||||
}
|
}
|
||||||
stream_set_timeout($this->smtp_conn, $timeout, 0);
|
stream_set_timeout($this->smtp_conn, $timeout, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get any announcement
|
// Get any announcement
|
||||||
$announce = $this->get_lines();
|
$announce = $this->get_lines();
|
||||||
|
|
||||||
if ($this->do_debug >= 2) {
|
if ($this->do_debug >= 2) {
|
||||||
$this->edebug('SMTP -> FROM SERVER:' . $announce);
|
$this->edebug('SERVER -> CLIENT: ' . $announce);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,7 +262,7 @@ class SMTP
|
|||||||
*/
|
*/
|
||||||
public function startTLS()
|
public function startTLS()
|
||||||
{
|
{
|
||||||
if (!$this->sendCommand("STARTTLS", "STARTTLS", 220)) {
|
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Begin encrypted connection
|
// Begin encrypted connection
|
||||||
@@ -259,8 +270,7 @@ class SMTP
|
|||||||
$this->smtp_conn,
|
$this->smtp_conn,
|
||||||
true,
|
true,
|
||||||
STREAM_CRYPTO_METHOD_TLS_CLIENT
|
STREAM_CRYPTO_METHOD_TLS_CLIENT
|
||||||
)
|
)) {
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -288,7 +298,6 @@ class SMTP
|
|||||||
if (empty($authtype)) {
|
if (empty($authtype)) {
|
||||||
$authtype = 'LOGIN';
|
$authtype = 'LOGIN';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($authtype) {
|
switch ($authtype) {
|
||||||
case 'PLAIN':
|
case 'PLAIN':
|
||||||
// Start authentication
|
// Start authentication
|
||||||
@@ -351,7 +360,6 @@ class SMTP
|
|||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Though 0 based, there is a white space after the 3 digit number
|
//Though 0 based, there is a white space after the 3 digit number
|
||||||
//msg2
|
//msg2
|
||||||
$challenge = substr($this->last_reply, 3);
|
$challenge = substr($this->last_reply, 3);
|
||||||
@@ -411,13 +419,13 @@ class SMTP
|
|||||||
// Eliminates the need to install mhash to compute a HMAC
|
// Eliminates the need to install mhash to compute a HMAC
|
||||||
// Hacked by Lance Rushing
|
// Hacked by Lance Rushing
|
||||||
|
|
||||||
$b = 64; // byte length for md5
|
$bytelen = 64; // byte length for md5
|
||||||
if (strlen($key) > $b) {
|
if (strlen($key) > $bytelen) {
|
||||||
$key = pack('H*', md5($key));
|
$key = pack('H*', md5($key));
|
||||||
}
|
}
|
||||||
$key = str_pad($key, $b, chr(0x00));
|
$key = str_pad($key, $bytelen, chr(0x00));
|
||||||
$ipad = str_pad('', $b, chr(0x36));
|
$ipad = str_pad('', $bytelen, chr(0x36));
|
||||||
$opad = str_pad('', $b, chr(0x5c));
|
$opad = str_pad('', $bytelen, chr(0x5c));
|
||||||
$k_ipad = $key ^ $ipad;
|
$k_ipad = $key ^ $ipad;
|
||||||
$k_opad = $key ^ $opad;
|
$k_opad = $key ^ $opad;
|
||||||
|
|
||||||
@@ -437,7 +445,7 @@ class SMTP
|
|||||||
// the socket is valid but we are not connected
|
// the socket is valid but we are not connected
|
||||||
if ($this->do_debug >= 1) {
|
if ($this->do_debug >= 1) {
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
'SMTP -> NOTICE: EOF caught while checking if connected'
|
'SMTP NOTICE: EOF caught while checking if connected'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->close();
|
$this->close();
|
||||||
@@ -462,6 +470,9 @@ class SMTP
|
|||||||
if (!empty($this->smtp_conn)) {
|
if (!empty($this->smtp_conn)) {
|
||||||
// close the connection and cleanup
|
// close the connection and cleanup
|
||||||
fclose($this->smtp_conn);
|
fclose($this->smtp_conn);
|
||||||
|
if ($this->do_debug >= 3) {
|
||||||
|
$this->edebug('Connection: closed');
|
||||||
|
}
|
||||||
$this->smtp_conn = 0;
|
$this->smtp_conn = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -483,62 +494,52 @@ class SMTP
|
|||||||
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The server is ready to accept data!
|
/* The server is ready to accept data!
|
||||||
* according to rfc821 we should not send more than 1000
|
* According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
|
||||||
* including the CRLF
|
* so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
|
||||||
* characters on a single line so we will break the data up
|
* smaller lines to fit within the limit.
|
||||||
* into lines by \r and/or \n then if needed we will break
|
* We will also look for lines that start with a '.' and prepend an additional '.'.
|
||||||
* each of those into smaller lines to fit within the limit.
|
* NOTE: this does not count towards line-length limit.
|
||||||
* in addition we will be looking for lines that start with
|
|
||||||
* a period '.' and append and additional period '.' to that
|
|
||||||
* line. NOTE: this does not count towards limit.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Normalize the line breaks before exploding
|
// Normalize line breaks before exploding
|
||||||
$msg_data = str_replace("\r\n", "\n", $msg_data);
|
$lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
|
||||||
$msg_data = str_replace("\r", "\n", $msg_data);
|
|
||||||
$lines = explode("\n", $msg_data);
|
|
||||||
|
|
||||||
/* We need to find a good way to determine if headers are
|
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
|
||||||
* in the msg_data or if it is a straight msg body
|
* of the first line (':' separated) does not contain a space then it _should_ be a header and we will
|
||||||
* currently I am assuming rfc822 definitions of msg headers
|
* process all lines before a blank line as headers.
|
||||||
* and if the first field of the first line (':' separated)
|
|
||||||
* does not contain a space then it _should_ be a header
|
|
||||||
* and we can process all lines before a blank "" line as
|
|
||||||
* headers.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$field = substr($lines[0], 0, strpos($lines[0], ':'));
|
$field = substr($lines[0], 0, strpos($lines[0], ':'));
|
||||||
$in_headers = false;
|
$in_headers = false;
|
||||||
if (!empty($field) && !strstr($field, ' ')) {
|
if (!empty($field) && strpos($field, ' ') === false) {
|
||||||
$in_headers = true;
|
$in_headers = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//RFC 2822 section 2.1.1 limit
|
|
||||||
$max_line_length = 998;
|
|
||||||
|
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
$lines_out = null;
|
$lines_out = array();
|
||||||
if ($line == '' && $in_headers) {
|
if ($in_headers and $line == '') {
|
||||||
$in_headers = false;
|
$in_headers = false;
|
||||||
}
|
}
|
||||||
// ok we need to break this line up into several smaller lines
|
// ok we need to break this line up into several smaller lines
|
||||||
while (strlen($line) > $max_line_length) {
|
//This is a small micro-optimisation: isset($str[$len]) is equivalent to (strlen($str) > $len)
|
||||||
$pos = strrpos(substr($line, 0, $max_line_length), ' ');
|
while (isset($line[self::MAX_LINE_LENGTH])) {
|
||||||
|
//Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
|
||||||
// Patch to fix DOS attack
|
//so as to avoid breaking in the middle of a word
|
||||||
if (!$pos) {
|
$pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
|
||||||
$pos = $max_line_length - 1;
|
if (!$pos) { //Deliberately matches both false and 0
|
||||||
|
//No nice break found, add a hard break
|
||||||
|
$pos = self::MAX_LINE_LENGTH - 1;
|
||||||
$lines_out[] = substr($line, 0, $pos);
|
$lines_out[] = substr($line, 0, $pos);
|
||||||
$line = substr($line, $pos);
|
$line = substr($line, $pos);
|
||||||
} else {
|
} else {
|
||||||
|
//Break at the found point
|
||||||
$lines_out[] = substr($line, 0, $pos);
|
$lines_out[] = substr($line, 0, $pos);
|
||||||
|
//Move along by the amount we dealt with
|
||||||
$line = substr($line, $pos + 1);
|
$line = substr($line, $pos + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If processing headers add a LWSP-char to the front of new line
|
/* If processing headers add a LWSP-char to the front of new line
|
||||||
* rfc822 on long msg headers
|
* RFC822 section 3.1.1
|
||||||
*/
|
*/
|
||||||
if ($in_headers) {
|
if ($in_headers) {
|
||||||
$line = "\t" . $line;
|
$line = "\t" . $line;
|
||||||
@@ -546,13 +547,12 @@ class SMTP
|
|||||||
}
|
}
|
||||||
$lines_out[] = $line;
|
$lines_out[] = $line;
|
||||||
|
|
||||||
// send the lines to the server
|
// Send the lines to the server
|
||||||
while (list(, $line_out) = @each($lines_out)) {
|
foreach ($lines_out as $line_out) {
|
||||||
if (strlen($line_out) > 0) {
|
//RFC2821 section 4.5.2
|
||||||
if (substr($line_out, 0, 1) == '.') {
|
if (!empty($line_out) and $line_out[0] == '.') {
|
||||||
$line_out = '.' . $line_out;
|
$line_out = '.' . $line_out;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$this->client_send($line_out . self::CRLF);
|
$this->client_send($line_out . self::CRLF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -565,7 +565,7 @@ class SMTP
|
|||||||
* Send an SMTP HELO or EHLO command.
|
* Send an SMTP HELO or EHLO command.
|
||||||
* Used to identify the sending server to the receiving server.
|
* Used to identify the sending server to the receiving server.
|
||||||
* This makes sure that client and server are in a known state.
|
* This makes sure that client and server are in a known state.
|
||||||
* Implements from RFC 821: HELO <SP> <domain> <CRLF>
|
* Implements RFC 821: HELO <SP> <domain> <CRLF>
|
||||||
* and RFC 2821 EHLO.
|
* and RFC 2821 EHLO.
|
||||||
* @param string $host The host name or IP to connect to
|
* @param string $host The host name or IP to connect to
|
||||||
* @access public
|
* @access public
|
||||||
@@ -574,13 +574,7 @@ class SMTP
|
|||||||
public function hello($host = '')
|
public function hello($host = '')
|
||||||
{
|
{
|
||||||
// Try extended hello first (RFC 2821)
|
// Try extended hello first (RFC 2821)
|
||||||
if (!$this->sendHello('EHLO', $host)) {
|
return (bool)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
|
||||||
if (!$this->sendHello('HELO', $host)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -631,28 +625,28 @@ class SMTP
|
|||||||
public function quit($close_on_error = true)
|
public function quit($close_on_error = true)
|
||||||
{
|
{
|
||||||
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
|
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
|
||||||
$e = $this->error; //Save any error
|
$err = $this->error; //Save any error
|
||||||
if ($noerror or $close_on_error) {
|
if ($noerror or $close_on_error) {
|
||||||
$this->close();
|
$this->close();
|
||||||
$this->error = $e; //Restore any error from the quit command
|
$this->error = $err; //Restore any error from the quit command
|
||||||
}
|
}
|
||||||
return $noerror;
|
return $noerror;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP RCPT command.
|
* Send an SMTP RCPT command.
|
||||||
* Sets the TO argument to $to.
|
* Sets the TO argument to $toaddr.
|
||||||
* Returns true if the recipient was accepted false if it was rejected.
|
* Returns true if the recipient was accepted false if it was rejected.
|
||||||
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
|
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
|
||||||
* @param string $to The address the message is being sent to
|
* @param string $toaddr The address the message is being sent to
|
||||||
* @access public
|
* @access public
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function recipient($to)
|
public function recipient($toaddr)
|
||||||
{
|
{
|
||||||
return $this->sendCommand(
|
return $this->sendCommand(
|
||||||
'RCPT TO ',
|
'RCPT TO',
|
||||||
'RCPT TO:<' . $to . '>',
|
'RCPT TO:<' . $toaddr . '>',
|
||||||
array(250, 251)
|
array(250, 251)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -681,7 +675,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
if (!$this->connected()) {
|
if (!$this->connected()) {
|
||||||
$this->error = array(
|
$this->error = array(
|
||||||
"error" => "Called $command without being connected"
|
'error' => "Called $command without being connected"
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -691,19 +685,19 @@ class SMTP
|
|||||||
$code = substr($reply, 0, 3);
|
$code = substr($reply, 0, 3);
|
||||||
|
|
||||||
if ($this->do_debug >= 2) {
|
if ($this->do_debug >= 2) {
|
||||||
$this->edebug('SMTP -> FROM SERVER:' . $reply);
|
$this->edebug('SERVER -> CLIENT: ' . $reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($code, (array)$expect)) {
|
if (!in_array($code, (array)$expect)) {
|
||||||
$this->last_reply = null;
|
$this->last_reply = null;
|
||||||
$this->error = array(
|
$this->error = array(
|
||||||
"error" => "$command command failed",
|
'error' => "$command command failed",
|
||||||
"smtp_code" => $code,
|
'smtp_code' => $code,
|
||||||
"detail" => substr($reply, 4)
|
'detail' => substr($reply, 4)
|
||||||
);
|
);
|
||||||
if ($this->do_debug >= 1) {
|
if ($this->do_debug >= 1) {
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
'SMTP -> ERROR: ' . $this->error['error'] . ': ' . $reply
|
'SMTP ERROR: ' . $this->error['error'] . ': ' . $reply
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -729,7 +723,7 @@ class SMTP
|
|||||||
*/
|
*/
|
||||||
public function sendAndMail($from)
|
public function sendAndMail($from)
|
||||||
{
|
{
|
||||||
return $this->sendCommand("SAML", "SAML FROM:$from", 250);
|
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -740,7 +734,7 @@ class SMTP
|
|||||||
*/
|
*/
|
||||||
public function verify($name)
|
public function verify($name)
|
||||||
{
|
{
|
||||||
return $this->sendCommand("VRFY", "VRFY $name", array(250, 251));
|
return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -751,14 +745,14 @@ class SMTP
|
|||||||
*/
|
*/
|
||||||
public function noop()
|
public function noop()
|
||||||
{
|
{
|
||||||
return $this->sendCommand("NOOP", "NOOP", 250);
|
return $this->sendCommand('NOOP', 'NOOP', 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP TURN command.
|
* Send an SMTP TURN command.
|
||||||
* This is an optional command for SMTP that this class does not support.
|
* This is an optional command for SMTP that this class does not support.
|
||||||
* This method is here to make the RFC821 Definition
|
* This method is here to make the RFC821 Definition complete for this class
|
||||||
* complete for this class and __may__ be implemented in future
|
* and _may_ be implemented in future
|
||||||
* Implements from rfc 821: TURN <CRLF>
|
* Implements from rfc 821: TURN <CRLF>
|
||||||
* @access public
|
* @access public
|
||||||
* @return bool
|
* @return bool
|
||||||
@@ -769,7 +763,7 @@ class SMTP
|
|||||||
'error' => 'The SMTP TURN command is not implemented'
|
'error' => 'The SMTP TURN command is not implemented'
|
||||||
);
|
);
|
||||||
if ($this->do_debug >= 1) {
|
if ($this->do_debug >= 1) {
|
||||||
$this->edebug('SMTP -> NOTICE: ' . $this->error['error']);
|
$this->edebug('SMTP NOTICE: ' . $this->error['error']);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -778,12 +772,12 @@ class SMTP
|
|||||||
* Send raw data to the server.
|
* Send raw data to the server.
|
||||||
* @param string $data The data to send
|
* @param string $data The data to send
|
||||||
* @access public
|
* @access public
|
||||||
* @return int|bool The number of bytes sent to the server or FALSE on error
|
* @return int|bool The number of bytes sent to the server or false on error
|
||||||
*/
|
*/
|
||||||
public function client_send($data)
|
public function client_send($data)
|
||||||
{
|
{
|
||||||
if ($this->do_debug >= 1) {
|
if ($this->do_debug >= 1) {
|
||||||
$this->edebug("CLIENT -> SMTP: $data");
|
$this->edebug("CLIENT -> SERVER: $data");
|
||||||
}
|
}
|
||||||
return fwrite($this->smtp_conn, $data);
|
return fwrite($this->smtp_conn, $data);
|
||||||
}
|
}
|
||||||
@@ -819,12 +813,12 @@ class SMTP
|
|||||||
*/
|
*/
|
||||||
protected function get_lines()
|
protected function get_lines()
|
||||||
{
|
{
|
||||||
|
// If the connection is bad, give up straight away
|
||||||
|
if (!is_resource($this->smtp_conn)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
$data = '';
|
$data = '';
|
||||||
$endtime = 0;
|
$endtime = 0;
|
||||||
// If the connection is bad, give up now
|
|
||||||
if (!is_resource($this->smtp_conn)) {
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
stream_set_timeout($this->smtp_conn, $this->Timeout);
|
stream_set_timeout($this->smtp_conn, $this->Timeout);
|
||||||
if ($this->Timelimit > 0) {
|
if ($this->Timelimit > 0) {
|
||||||
$endtime = time() + $this->Timelimit;
|
$endtime = time() + $this->Timelimit;
|
||||||
@@ -839,8 +833,8 @@ class SMTP
|
|||||||
if ($this->do_debug >= 4) {
|
if ($this->do_debug >= 4) {
|
||||||
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"");
|
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"");
|
||||||
}
|
}
|
||||||
// if 4th character is a space, we are done reading, break the loop
|
// If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
|
||||||
if (substr($str, 3, 1) == ' ') {
|
if ((isset($str[3]) and $str[3] == ' ')) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Timed-out? Log and break
|
// Timed-out? Log and break
|
||||||
@@ -854,18 +848,16 @@ class SMTP
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Now check if reads took too long
|
// Now check if reads took too long
|
||||||
if ($endtime) {
|
if ($endtime and time() > $endtime) {
|
||||||
if (time() > $endtime) {
|
|
||||||
if ($this->do_debug >= 4) {
|
if ($this->do_debug >= 4) {
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
'SMTP -> get_lines(): timelimit reached ('
|
'SMTP -> get_lines(): timelimit reached ('.
|
||||||
. $this->Timelimit . ' sec)'
|
$this->Timelimit . ' sec)'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if ($vmail_group === false) {
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'ubuntu_lucid' => array(
|
'ubuntu_lucid' => array(
|
||||||
'label' => 'Ubuntu 10.04 (Lucid)',
|
'label' => 'Ubuntu 10.04 (Lucid) [deprecated]',
|
||||||
'services' => array(
|
'services' => array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if ($vmail_group === false) {
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'sle_10' => array(
|
'sle_10' => array(
|
||||||
'label' => 'SUSE Linux Enterprise 10',
|
'label' => 'SUSE Linux Enterprise 10 (deprecated)',
|
||||||
'services' => array(
|
'services' => array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ if ($vmail_group === false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'opensuse_11_x' => array(
|
'sle_11' => array(
|
||||||
'label' => 'openSUSE 11.x',
|
'label' => 'SUSE Linux Enterprise 11',
|
||||||
'services' => array(
|
'services' => array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
@@ -36,7 +36,7 @@ if ($vmail_group === false) {
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'debian_squeeze' => array(
|
'debian_squeeze' => array(
|
||||||
'label' => 'Debian 6.0 (Squeeze)',
|
'label' => 'Debian 6.0 (Squeeze) [deprecated]',
|
||||||
'services' => array(
|
'services' => array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
|
|||||||
@@ -441,6 +441,9 @@ return array(
|
|||||||
(Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'useradd -s /bin/false -g '.Settings::Get('phpfpm.vhost_httpgroup').' '.Settings::Get('phpfpm.vhost_httpuser') : null,
|
(Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'useradd -s /bin/false -g '.Settings::Get('phpfpm.vhost_httpgroup').' '.Settings::Get('phpfpm.vhost_httpuser') : null,
|
||||||
(Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'chown -R '.Settings::Get('phpfpm.vhost_httpuser').':'.Settings::Get('phpfpm.vhost_httpgroup').' '.FROXLOR_INSTALL_DIR : null,
|
(Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'chown -R '.Settings::Get('phpfpm.vhost_httpuser').':'.Settings::Get('phpfpm.vhost_httpgroup').' '.FROXLOR_INSTALL_DIR : null,
|
||||||
(Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'a2dismod php5' : null
|
(Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'a2dismod php5' : null
|
||||||
|
),
|
||||||
|
'restart' => array(
|
||||||
|
'/etc/init.d/apache2 restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ $configfiles = array_merge(
|
|||||||
include $cfgPath . 'precise.inc.php',
|
include $cfgPath . 'precise.inc.php',
|
||||||
include $cfgPath . 'lucid.inc.php',
|
include $cfgPath . 'lucid.inc.php',
|
||||||
include $cfgPath . 'gentoo.inc.php',
|
include $cfgPath . 'gentoo.inc.php',
|
||||||
include $cfgPath . 'suse11.inc.php',
|
include $cfgPath . 'sle11.inc.php',
|
||||||
include $cfgPath . 'sle10.inc.php',
|
include $cfgPath . 'sle10.inc.php',
|
||||||
include $cfgPath . 'freebsd.inc.php'
|
include $cfgPath . 'freebsd.inc.php'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1250,7 +1250,7 @@ $lng['extras']['htpasswdauthname'] = 'Grund der Authentifizierung (AuthName)';
|
|||||||
$lng['extras']['directoryprotection_edit'] = 'Verzeichnisschutz bearbeiten';
|
$lng['extras']['directoryprotection_edit'] = 'Verzeichnisschutz bearbeiten';
|
||||||
$lng['admin']['templates']['forgotpwd'] = 'Benachrichtigungs-Mails bei Zurücksetzen des Passworts';
|
$lng['admin']['templates']['forgotpwd'] = 'Benachrichtigungs-Mails bei Zurücksetzen des Passworts';
|
||||||
$lng['admin']['templates']['password_reset'] = 'Kunden-Benachrichtigung nach Zurücksetzen des Passworts';
|
$lng['admin']['templates']['password_reset'] = 'Kunden-Benachrichtigung nach Zurücksetzen des Passworts';
|
||||||
$lng['admin']['store_defaultindex'] = 'Standard-Index-Datei im Kundenordner erstellen?';
|
$lng['admin']['store_defaultindex'] = 'Standard-Index-Datei im Kundenordner erstellen';
|
||||||
|
|
||||||
// ADDED IN FROXLOR 0.9.14
|
// ADDED IN FROXLOR 0.9.14
|
||||||
$lng['serversettings']['mod_fcgid']['defaultini_ownvhost'] = 'Voreingestellte PHP-Konfiguration für den Froxlor-Vhost';
|
$lng['serversettings']['mod_fcgid']['defaultini_ownvhost'] = 'Voreingestellte PHP-Konfiguration für den Froxlor-Vhost';
|
||||||
|
|||||||
Reference in New Issue
Block a user