Commit 2f5fc742 authored by Bart Vullings's avatar Bart Vullings

ZP-1276 Update Mail library. Released under the Affero GNU General Public License (AGPL) version 3.

parent 45ab1bbc
...@@ -2,31 +2,33 @@ ...@@ -2,31 +2,33 @@
/** /**
* internal PHP-mail() implementation of the PEAR Mail:: interface. * internal PHP-mail() implementation of the PEAR Mail:: interface.
* *
* PHP versions 4 and 5 * PHP version 5
* *
* LICENSE: * LICENSE:
* *
* Copyright (c) 2010 Chuck Hagenbuch * Copyright (c) 2010-2017, Chuck Hagenbuch
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* o Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * 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 * 2. Redistributions in binary form must reproduce the above copyright
* documentation and/or other materials provided with the distribution. * notice, this list of conditions and the following disclaimer in the
* o The names of the authors may not be used to endorse or promote * documentation and/or other materials provided with the distribution.
* products derived from this software without specific prior written *
* permission. * 3. Neither the name of the copyright holder nor the names of its
* contributors may 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 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
...@@ -37,27 +39,27 @@ ...@@ -37,27 +39,27 @@
* @category Mail * @category Mail
* @package Mail * @package Mail
* @author Chuck Hagenbuch <chuck@horde.org> * @author Chuck Hagenbuch <chuck@horde.org>
* @copyright 2010 Chuck Hagenbuch * @copyright 2010-2017 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/BSD-3-Clause New BSD License
* @version CVS: $Id: mail.php 294747 2010-02-08 08:18:33Z clockwerx $ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/ * @link http://pear.php.net/package/Mail/
*/ */
/** /**
* Z-Push changes * Z-Push changes
* *
* removed PEAR dependency by implementing own raiseError() * removed PEAR dependency by implementing own raiseError()
* *
* Reference implementation used: * Reference implementation used:
* http://download.pear.php.net/package/Mail-1.2.0.tgz * http://download.pear.php.net/package/Mail-1.4.1.tgz
* *
* *
*/ */
/** /**
* internal PHP-mail() implementation of the PEAR Mail:: interface. * internal PHP-mail() implementation of the PEAR Mail:: interface.
* @package Mail * @package Mail
* @version $Revision: 294747 $ * @version $Revision$
*/ */
class Mail_mail extends Mail { class Mail_mail extends Mail {
...@@ -75,7 +77,7 @@ class Mail_mail extends Mail { ...@@ -75,7 +77,7 @@ class Mail_mail extends Mail {
* *
* @param array $params Extra arguments for the mail() function. * @param array $params Extra arguments for the mail() function.
*/ */
function __construct($params = null) public function __construct($params = null)
{ {
// The other mail implementations accept parameters as arrays. // The other mail implementations accept parameters as arrays.
// In the interest of being consistent, explode an array into // In the interest of being consistent, explode an array into
...@@ -120,10 +122,8 @@ class Mail_mail extends Mail { ...@@ -120,10 +122,8 @@ class Mail_mail extends Mail {
* @return mixed Returns true on success, or a PEAR_Error * @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on * containing a descriptive error message on
* failure. * failure.
*
* @access public
*/ */
function send($recipients, $headers, $body) public function send($recipients, $headers, $body)
{ {
if (!is_array($headers)) { if (!is_array($headers)) {
return Mail_mail::raiseError('$headers must be an array'); return Mail_mail::raiseError('$headers must be an array');
......
...@@ -6,27 +6,29 @@ ...@@ -6,27 +6,29 @@
* *
* LICENSE: * LICENSE:
* *
* Copyright (c) 2010, Chuck Hagenbuch * Copyright (c) 2010-2017, Chuck Hagenbuch & Jon Parise
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* o Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * 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 * 2. Redistributions in binary form must reproduce the above copyright
* documentation and/or other materials provided with the distribution. * notice, this list of conditions and the following disclaimer in the
* o The names of the authors may not be used to endorse or promote * documentation and/or other materials provided with the distribution.
* products derived from this software without specific prior written *
* permission. * 3. Neither the name of the copyright holder nor the names of its
* contributors may 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 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
...@@ -38,19 +40,19 @@ ...@@ -38,19 +40,19 @@
* @package Mail * @package Mail
* @author Jon Parise <jon@php.net> * @author Jon Parise <jon@php.net>
* @author Chuck Hagenbuch <chuck@horde.org> * @author Chuck Hagenbuch <chuck@horde.org>
* @copyright 2010 Chuck Hagenbuch * @copyright 2010-2017 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/BSD-3-Clause New BSD License
* @version CVS: $Id$ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/ * @link http://pear.php.net/package/Mail/
*/ */
/** /**
* Z-Push changes * Z-Push changes
* *
* removed PEAR dependency by implementing own raiseError() * removed PEAR dependency by implementing own raiseError()
* *
* Reference implementation used: * Reference implementation used:
* http://download.pear.php.net/package/Mail-1.2.0.tgz * http://download.pear.php.net/package/Mail-1.4.1.tgz
* *
* *
*/ */
...@@ -59,7 +61,7 @@ ...@@ -59,7 +61,7 @@
* Sendmail implementation of the PEAR Mail:: interface. * Sendmail implementation of the PEAR Mail:: interface.
* @access public * @access public
* @package Mail * @package Mail
* @version $Revision: 294744 $ * @version $Revision$
*/ */
class Mail_sendmail extends Mail { class Mail_sendmail extends Mail {
...@@ -93,9 +95,8 @@ class Mail_sendmail extends Mail { ...@@ -93,9 +95,8 @@ class Mail_sendmail extends Mail {
* *
* @param array $params Hash containing any parameters different from the * @param array $params Hash containing any parameters different from the
* defaults. * defaults.
* @access public
*/ */
function __construct($params) public function __construct($params)
{ {
if (isset($params['sendmail_path'])) { if (isset($params['sendmail_path'])) {
$this->sendmail_path = $params['sendmail_path']; $this->sendmail_path = $params['sendmail_path'];
...@@ -139,9 +140,8 @@ class Mail_sendmail extends Mail { ...@@ -139,9 +140,8 @@ class Mail_sendmail extends Mail {
* @return mixed Returns true on success, or a PEAR_Error * @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on * containing a descriptive error message on
* failure. * failure.
* @access public
*/ */
function send($recipients, $headers, $body) public function send($recipients, $headers, $body)
{ {
if (!is_array($headers)) { if (!is_array($headers)) {
return Mail_sendmail::raiseError('$headers must be an array'); return Mail_sendmail::raiseError('$headers must be an array');
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment