Changeset:
f17aa5051c22
https://sourceforge.net/p/mrbs/hg-code/ci/f17aa5051c22e85d5c93693edc06bc6d07d8d089
Author:
Campbell Morrison <[email protected]>
Date:
Wed Sep 23 11:52:48 2015 +0100
Log message:
Merge with phpmailer.
MRBS now uses PHPMailer as its mail sending engine, removing problems running
under PHP7.
Qmail added to backend options.
Debug output improved, with an option to output to the browser (default) or
error_log
diffstat:
web/Mail/RFC822.php | 951 ----
web/Mail/mail.php | 168 -
web/Mail/mime.php | 3121 ++++++++-------
web/Mail/mimePart.php | 2510 ++++++------
web/Mail/null.php | 84 -
web/Mail/sendmail.php | 171 -
web/Mail/smtp.php | 444 --
web/functions_mail.inc | 204 +-
web/lib/PHPMailer/LICENSE | 504 ++
web/lib/PHPMailer/PHPMailerAutoload.php | 49 +
web/lib/PHPMailer/VERSION | 1 +
web/lib/PHPMailer/class.phpmailer.php | 3722 +++++++++++++++++++
web/lib/PHPMailer/class.phpmaileroauth.php | 197 +
web/lib/PHPMailer/class.phpmaileroauthgoogle.php | 70 +
web/lib/PHPMailer/class.pop3.php | 397 ++
web/lib/PHPMailer/class.smtp.php | 1176 ++++++
web/lib/PHPMailer/get_oauth_token.php | 64 +
web/lib/PHPMailer/language/phpmailer.lang-am.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-ar.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-az.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-be.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-bg.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-br.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-ca.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-ch.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-cz.php | 25 +
web/lib/PHPMailer/language/phpmailer.lang-de.php | 25 +
web/lib/PHPMailer/language/phpmailer.lang-dk.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-el.php | 25 +
web/lib/PHPMailer/language/phpmailer.lang-eo.php | 25 +
web/lib/PHPMailer/language/phpmailer.lang-es.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-et.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-fa.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-fi.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-fo.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-fr.php | 29 +
web/lib/PHPMailer/language/phpmailer.lang-gl.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-he.php | 25 +
web/lib/PHPMailer/language/phpmailer.lang-hr.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-hu.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-id.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-it.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-ja.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-ka.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-ko.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-lt.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-lv.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-ms.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-nl.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-no.php | 25 +
web/lib/PHPMailer/language/phpmailer.lang-pl.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-pt.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-ro.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-ru.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-se.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-sk.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-sl.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-sr.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-tr.php | 29 +
web/lib/PHPMailer/language/phpmailer.lang-uk.php | 27 +
web/lib/PHPMailer/language/phpmailer.lang-vi.php | 26 +
web/lib/PHPMailer/language/phpmailer.lang-zh.php | 28 +
web/lib/PHPMailer/language/phpmailer.lang-zh_cn.php | 27 +
web/systemdefaults.inc.php | 15 +-
64 files changed, 10402 insertions(+), 4654 deletions(-)
diffs (truncated from 15415 to 300 lines):
diff -r 2b29bee9844d -r f17aa5051c22 web/Mail/RFC822.php
--- a/web/Mail/RFC822.php Fri Sep 18 20:25:34 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,951 +0,0 @@
-<?php
-/**
- * RFC 822 Email address list validation Utility
- *
- * PHP versions 4 and 5
- *
- * LICENSE:
- *
- * Copyright (c) 2001-2010, Richard Heyes
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * o Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * o Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * o The names of the authors may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * @category Mail
- * @package Mail
- * @author Richard Heyes <[email protected]>
- * @author Chuck Hagenbuch <[email protected]
- * @copyright 2001-2010 Richard Heyes
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Mail/
- */
-
-/**
- * RFC 822 Email address list validation Utility
- *
- * What is it?
- *
- * This class will take an address string, and parse it into it's consituent
- * parts, be that either addresses, groups, or combinations. Nested groups
- * are not supported. The structure it returns is pretty straight forward,
- * and is similar to that provided by the imap_rfc822_parse_adrlist(). Use
- * print_r() to view the structure.
- *
- * How do I use it?
- *
- * $address_string = 'My Group: "Richard" <richard@localhost> (A comment),
[email protected] (Ted Bloggs), Barney;';
- * $structure = Mail_RFC822::parseAddressList($address_string, 'example.com',
true)
- * print_r($structure);
- *
- * @author Richard Heyes <[email protected]>
- * @author Chuck Hagenbuch <[email protected]>
- * @version $Revision$
- * @license BSD
- * @package Mail
- */
-class Mail_RFC822 {
-
- /**
- * The address being parsed by the RFC822 object.
- * @var string $address
- */
- var $address = '';
-
- /**
- * The default domain to use for unqualified addresses.
- * @var string $default_domain
- */
- var $default_domain = 'localhost';
-
- /**
- * Should we return a nested array showing groups, or flatten everything?
- * @var boolean $nestGroups
- */
- var $nestGroups = true;
-
- /**
- * Whether or not to validate atoms for non-ascii characters.
- * @var boolean $validate
- */
- var $validate = true;
-
- /**
- * The array of raw addresses built up as we parse.
- * @var array $addresses
- */
- var $addresses = array();
-
- /**
- * The final array of parsed address information that we build up.
- * @var array $structure
- */
- var $structure = array();
-
- /**
- * The current error message, if any.
- * @var string $error
- */
- var $error = null;
-
- /**
- * An internal counter/pointer.
- * @var integer $index
- */
- var $index = null;
-
- /**
- * The number of groups that have been found in the address list.
- * @var integer $num_groups
- * @access public
- */
- var $num_groups = 0;
-
- /**
- * A variable so that we can tell whether or not we're inside a
- * Mail_RFC822 object.
- * @var boolean $mailRFC822
- */
- var $mailRFC822 = true;
-
- /**
- * A limit after which processing stops
- * @var int $limit
- */
- var $limit = null;
-
- /**
- * Sets up the object. The address must either be set here or when
- * calling parseAddressList(). One or the other.
- *
- * @access public
- * @param string $address The address(es) to validate.
- * @param string $default_domain Default domain/host etc. If not
supplied, will be set to localhost.
- * @param boolean $nest_groups Whether to return the structure with
groups nested for easier viewing.
- * @param boolean $validate Whether to validate atoms. Turn this
off if you need to run addresses through before encoding the personal names,
for instance.
- *
- * @return object Mail_RFC822 A new Mail_RFC822 object.
- */
- function Mail_RFC822($address = null, $default_domain = null, $nest_groups
= null, $validate = null, $limit = null)
- {
- if (isset($address)) $this->address = $address;
- if (isset($default_domain)) $this->default_domain = $default_domain;
- if (isset($nest_groups)) $this->nestGroups = $nest_groups;
- if (isset($validate)) $this->validate = $validate;
- if (isset($limit)) $this->limit = $limit;
- }
-
- /**
- * Starts the whole process. The address must either be set here
- * or when creating the object. One or the other.
- *
- * @access public
- * @param string $address The address(es) to validate.
- * @param string $default_domain Default domain/host etc.
- * @param boolean $nest_groups Whether to return the structure with
groups nested for easier viewing.
- * @param boolean $validate Whether to validate atoms. Turn this
off if you need to run addresses through before encoding the personal names,
for instance.
- *
- * @return array A structured array of addresses.
- */
- function parseAddressList($address = null, $default_domain = null,
$nest_groups = null, $validate = null, $limit = null)
- {
- if (!isset($this) || !isset($this->mailRFC822)) {
- $obj = new Mail_RFC822($address, $default_domain, $nest_groups,
$validate, $limit);
- return $obj->parseAddressList();
- }
-
- if (isset($address)) $this->address = $address;
- if (isset($default_domain)) $this->default_domain = $default_domain;
- if (isset($nest_groups)) $this->nestGroups = $nest_groups;
- if (isset($validate)) $this->validate = $validate;
- if (isset($limit)) $this->limit = $limit;
-
- $this->structure = array();
- $this->addresses = array();
- $this->error = null;
- $this->index = null;
-
- // Unfold any long lines in $this->address.
- $this->address = preg_replace('/\r?\n/', "\r\n", $this->address);
- $this->address = preg_replace('/\r\n(\t| )+/', ' ', $this->address);
-
- while ($this->address = $this->_splitAddresses($this->address));
-
- if ($this->address === false || isset($this->error)) {
- require_once 'PEAR.php';
- return PEAR::raiseError($this->error);
- }
-
- // Validate each address individually. If we encounter an invalid
- // address, stop iterating and return an error immediately.
- foreach ($this->addresses as $address) {
- $valid = $this->_validateAddress($address);
-
- if ($valid === false || isset($this->error)) {
- require_once 'PEAR.php';
- return PEAR::raiseError($this->error);
- }
-
- if (!$this->nestGroups) {
- $this->structure = array_merge($this->structure, $valid);
- } else {
- $this->structure[] = $valid;
- }
- }
-
- return $this->structure;
- }
-
- /**
- * Splits an address into separate addresses.
- *
- * @access private
- * @param string $address The addresses to split.
- * @return boolean Success or failure.
- */
- function _splitAddresses($address)
- {
- if (!empty($this->limit) && count($this->addresses) == $this->limit) {
- return '';
- }
-
- if ($this->_isGroup($address) && !isset($this->error)) {
- $split_char = ';';
- $is_group = true;
- } elseif (!isset($this->error)) {
- $split_char = ',';
- $is_group = false;
- } elseif (isset($this->error)) {
- return false;
- }
-
- // Split the string based on the above ten or so lines.
- $parts = explode($split_char, $address);
- $string = $this->_splitCheck($parts, $split_char);
-
- // If a group...
- if ($is_group) {
- // If $string does not contain a colon outside of
- // brackets/quotes etc then something's fubar.
-
- // First check there's a colon at all:
- if (strpos($string, ':') === false) {
- $this->error = 'Invalid address: ' . $string;
- return false;
- }
-
- // Now check it's outside of brackets/quotes:
- if (!$this->_splitCheck(explode(':', $string), ':')) {
- return false;
- }
-
- // We must have a group at this point, so increase the counter:
- $this->num_groups++;
- }
-
- // $string now contains the first full address/group.
- // Add to the addresses array.
- $this->addresses[] = array(
- 'address' => trim($string),
- 'group' => $is_group
- );
-
- // Remove the now stored address from the initial line, the +1
- // is to account for the explode character.
- $address = trim(substr($address, strlen($string) + 1));
-
- // If the next char is a comma and this was a group, then
- // there are more addresses, otherwise, if there are any more
- // chars, then there is another address.
- if ($is_group && substr($address, 0, 1) == ','){
- $address = trim(substr($address, 1));
- return $address;
-
- } elseif (strlen($address) > 0) {
- return $address;
-
- } else {
- return '';
- }
-
- // If you got here then something's off
- return false;
- }
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits