mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Bugtracker #4082 - upgrade PHPMailer to V2.0.0
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,66 +1,115 @@
|
||||
<?php
|
||||
/*
|
||||
POP Before SMTP Authentication Class
|
||||
Version 1.0
|
||||
/*~ class.pop3.php
|
||||
.---------------------------------------------------------------------------.
|
||||
| Software: PHPMailer - PHP email class |
|
||||
| Version: 2.0.0 rc2 |
|
||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
||||
| Info: http://phpmailer.sourceforge.net |
|
||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| Author: Andy Prevost (project admininistrator) |
|
||||
| Author: Brent R. Matzelle (original founder) |
|
||||
| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
|
||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| License: Distributed under the Lesser General Public License (LGPL) |
|
||||
| http://www.gnu.org/copyleft/lesser.html |
|
||||
| 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. |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| We offer a number of paid services (www.codeworxtech.com): |
|
||||
| - Web Hosting on highly optimized fast and secure servers |
|
||||
| - Technology Consulting |
|
||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
||||
'---------------------------------------------------------------------------'
|
||||
|
||||
Author: Richard Davey (rich@corephp.co.uk)
|
||||
License: LGPL, see PHPMailer License
|
||||
|
||||
Specifically for PHPMailer to allow POP before SMTP authentication.
|
||||
Does not yet work with APOP - if you have an APOP account, contact me
|
||||
and we can test changes to this script.
|
||||
|
||||
This class is based on the structure of the SMTP class by Chris Ryan
|
||||
|
||||
This class is rfc 1939 compliant and implements all the commands
|
||||
required for POP3 connection, authentication and disconnection.
|
||||
|
||||
@package PHPMailer
|
||||
@author Richard Davey
|
||||
*/
|
||||
/**
|
||||
* POP Before SMTP Authentication Class
|
||||
* Version 1.0
|
||||
*
|
||||
* Author: Richard Davey (rich@corephp.co.uk)
|
||||
* License: LGPL, see PHPMailer License
|
||||
*
|
||||
* Specifically for PHPMailer to allow POP before SMTP authentication.
|
||||
* Does not yet work with APOP - if you have an APOP account, contact me
|
||||
* and we can test changes to this script.
|
||||
*
|
||||
* This class is based on the structure of the SMTP class by Chris Ryan
|
||||
*
|
||||
* This class is rfc 1939 compliant and implements all the commands
|
||||
* required for POP3 connection, authentication and disconnection.
|
||||
*
|
||||
* @package PHPMailer
|
||||
* @author Richard Davey
|
||||
*/
|
||||
|
||||
class POP3
|
||||
{
|
||||
// Default POP3 port
|
||||
/**
|
||||
* Default POP3 port
|
||||
* @var int
|
||||
*/
|
||||
var $POP3_PORT = 110;
|
||||
|
||||
// Default Timeout
|
||||
/**
|
||||
* Default Timeout
|
||||
* @var int
|
||||
*/
|
||||
var $POP3_TIMEOUT = 30;
|
||||
|
||||
// Carriage Return + Line Feed
|
||||
/**
|
||||
* POP3 Carriage Return + Line Feed
|
||||
* @var string
|
||||
*/
|
||||
var $CRLF = "\r\n";
|
||||
|
||||
// Displaying Debug warnings? (0 = now, 1+ = yes)
|
||||
/**
|
||||
* Displaying Debug warnings? (0 = now, 1+ = yes)
|
||||
* @var int
|
||||
*/
|
||||
var $do_debug = 2;
|
||||
|
||||
// Socket connection resource handle
|
||||
var $pop_conn;
|
||||
|
||||
// Boolean state of connection
|
||||
var $connected;
|
||||
|
||||
// Error log array
|
||||
var $error;
|
||||
|
||||
// POP3 Server Connection Required values
|
||||
|
||||
// Mail Server
|
||||
/**
|
||||
* POP3 Mail Server
|
||||
* @var string
|
||||
*/
|
||||
var $host;
|
||||
|
||||
// Port
|
||||
/**
|
||||
* POP3 Port
|
||||
* @var int
|
||||
*/
|
||||
var $port;
|
||||
|
||||
// Timeout Value
|
||||
/**
|
||||
* POP3 Timeout Value
|
||||
* @var int
|
||||
*/
|
||||
var $tval;
|
||||
|
||||
// POP3 Username
|
||||
/**
|
||||
* POP3 Username
|
||||
* @var string
|
||||
*/
|
||||
var $username;
|
||||
|
||||
// POP3 Password
|
||||
/**
|
||||
* POP3 Password
|
||||
* @var string
|
||||
*/
|
||||
var $password;
|
||||
|
||||
/**#@+
|
||||
* @access private
|
||||
*/
|
||||
var $pop_conn;
|
||||
var $connected;
|
||||
var $error; // Error log array
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Our constructor, sets the initial values
|
||||
* Constructor, sets the initial values
|
||||
*
|
||||
* @return POP3
|
||||
*/
|
||||
@@ -278,7 +327,6 @@ class POP3
|
||||
|
||||
/**
|
||||
* Disconnect from the POP3 server
|
||||
*
|
||||
*/
|
||||
function Disconnect ()
|
||||
{
|
||||
@@ -384,6 +432,6 @@ class POP3
|
||||
);
|
||||
}
|
||||
|
||||
// End of class
|
||||
// End of class
|
||||
}
|
||||
?>
|
@@ -1,17 +1,28 @@
|
||||
<?php
|
||||
////////////////////////////////////////////////////
|
||||
// SMTP - PHP SMTP class
|
||||
//
|
||||
// Version 1.02
|
||||
//
|
||||
// Define an SMTP class that can be used to connect
|
||||
// and communicate with any SMTP server. It implements
|
||||
// all the SMTP functions defined in RFC821 except TURN.
|
||||
//
|
||||
// Author: Chris Ryan
|
||||
//
|
||||
// License: LGPL, see LICENSE
|
||||
////////////////////////////////////////////////////
|
||||
/*~ class.smtp.php
|
||||
.---------------------------------------------------------------------------.
|
||||
| Software: PHPMailer - PHP email class |
|
||||
| Version: 2.0.0 rc1 |
|
||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
||||
| Info: http://phpmailer.sourceforge.net |
|
||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| Author: Andy Prevost (project admininistrator) |
|
||||
| Author: Brent R. Matzelle (original founder) |
|
||||
| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
|
||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| License: Distributed under the Lesser General Public License (LGPL) |
|
||||
| http://www.gnu.org/copyleft/lesser.html |
|
||||
| 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. |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| We offer a number of paid services (www.codeworxtech.com): |
|
||||
| - Web Hosting on highly optimized fast and secure servers |
|
||||
| - Technology Consulting |
|
||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
||||
'---------------------------------------------------------------------------'
|
||||
|
||||
/**
|
||||
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
|
||||
@@ -21,6 +32,7 @@
|
||||
* @package PHPMailer
|
||||
* @author Chris Ryan
|
||||
*/
|
||||
|
||||
class SMTP
|
||||
{
|
||||
/**
|
||||
@@ -41,6 +53,12 @@ class SMTP
|
||||
*/
|
||||
var $do_debug; # the level of debug to perform
|
||||
|
||||
/**
|
||||
* Sets VERP use on/off (default is off)
|
||||
* @var bool
|
||||
*/
|
||||
var $do_verp = false;
|
||||
|
||||
/**#@+
|
||||
* @access private
|
||||
*/
|
||||
@@ -88,8 +106,7 @@ class SMTP
|
||||
# ok we are connected! what should we do?
|
||||
# for now we will just give an error saying we
|
||||
# are already connected
|
||||
$this->error =
|
||||
array("error" => "Already connected to a server");
|
||||
$this->error = array("error" => "Already connected to a server");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -209,7 +226,7 @@ class SMTP
|
||||
$sock_status = socket_get_status($this->smtp_conn);
|
||||
if($sock_status["eof"]) {
|
||||
# hmm this is an odd situation... the socket is
|
||||
# valid but we aren't connected anymore
|
||||
# valid but we are not connected anymore
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> NOTICE:" . $this->CRLF .
|
||||
"EOF caught while checking if connected";
|
||||
@@ -239,7 +256,6 @@ class SMTP
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************
|
||||
* SMTP COMMANDS *
|
||||
*************************************************************/
|
||||
@@ -249,7 +265,7 @@ class SMTP
|
||||
* finializing the mail transaction. $msg_data is the message
|
||||
* that is to be send with the headers. Each header needs to be
|
||||
* on a single line followed by a <CRLF> with the message headers
|
||||
* and the message body being separated by and additional <CRLF>.
|
||||
* and the message body being seperated by and additional <CRLF>.
|
||||
*
|
||||
* Implements rfc 821: DATA <CRLF>
|
||||
*
|
||||
@@ -310,7 +326,7 @@ class SMTP
|
||||
|
||||
# we need to find a good way to determine is headers are
|
||||
# in the msg_data or if it is a straight msg body
|
||||
# currently I'm assuming rfc 822 definitions of msg headers
|
||||
# currently I am assuming rfc 822 definitions of msg headers
|
||||
# and if the first field of the first line (':' sperated)
|
||||
# does not contain a space then it _should_ be a header
|
||||
# and we can process all lines before a blank "" line as
|
||||
@@ -462,7 +478,7 @@ class SMTP
|
||||
return false;
|
||||
}
|
||||
|
||||
# if a hostname for the HELO wasn't specified determine
|
||||
# if a hostname for the HELO was not specified determine
|
||||
# a suitable one to send
|
||||
if(empty($host)) {
|
||||
# we need to determine some sort of appopiate default
|
||||
@@ -588,7 +604,8 @@ class SMTP
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF);
|
||||
$useVerp = ($this->do_verp ? "XVERP" : "");
|
||||
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
@@ -1021,7 +1038,7 @@ class SMTP
|
||||
*/
|
||||
function get_lines() {
|
||||
$data = "";
|
||||
while($str = fgets($this->smtp_conn,515)) {
|
||||
while($str = @fgets($this->smtp_conn,515)) {
|
||||
if($this->do_debug >= 4) {
|
||||
echo "SMTP -> get_lines(): \$data was \"$data\"" .
|
||||
$this->CRLF;
|
||||
|
Reference in New Issue
Block a user