Show spam aliases #
This commit is contained in:
10
data/web/rc/vendor/roundcube/net_sieve/.travis.yml
vendored
Normal file
10
data/web/rc/vendor/roundcube/net_sieve/.travis.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
language: php
|
||||
install:
|
||||
- pear install Net_Socket PEAR Auth_SASL
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
script: cd tests && pear run-tests .
|
1334
data/web/rc/vendor/roundcube/net_sieve/Sieve.php
vendored
Normal file
1334
data/web/rc/vendor/roundcube/net_sieve/Sieve.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
56
data/web/rc/vendor/roundcube/net_sieve/composer.json
vendored
Normal file
56
data/web/rc/vendor/roundcube/net_sieve/composer.json
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"email": "jan@horde.org",
|
||||
"name": "Jan Schneider",
|
||||
"role": "Lead"
|
||||
},
|
||||
{
|
||||
"email": "richard@php.net",
|
||||
"name": "Richard Heyes",
|
||||
"role": "Lead"
|
||||
},
|
||||
{
|
||||
"email": "damlists@cnba.uba.ar",
|
||||
"name": "Damian Fernandez Sosa",
|
||||
"role": "Lead"
|
||||
},
|
||||
{
|
||||
"email": "amistry@am-productions.biz",
|
||||
"name": "Anish Mistry",
|
||||
"role": "Lead"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"./"
|
||||
]
|
||||
},
|
||||
"description": "This is a fork of http://pear.php.net/package/Net_Sieve",
|
||||
"license": "BSD",
|
||||
"name": "roundcube/net_sieve",
|
||||
"support": {
|
||||
"issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Net_Sieve",
|
||||
"source": "https://github.com/roundcube/Net_Sieve"
|
||||
},
|
||||
"type": "library",
|
||||
"repositories": [
|
||||
{
|
||||
"type": "pear",
|
||||
"url": "https://pear.php.net/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"pear/pear-core-minimal": "*",
|
||||
"pear-pear.php.net/net_socket": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"pear/auth_sasl": "Install optionally via your project's composer.json"
|
||||
},
|
||||
"config": {
|
||||
"secure-http": false
|
||||
}
|
||||
}
|
460
data/web/rc/vendor/roundcube/net_sieve/package.xml
vendored
Normal file
460
data/web/rc/vendor/roundcube/net_sieve/package.xml
vendored
Normal file
@@ -0,0 +1,460 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<package packagerversion="1.4.6" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
|
||||
http://pear.php.net/dtd/tasks-1.0.xsd
|
||||
http://pear.php.net/dtd/package-2.0
|
||||
http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<name>Net_Sieve</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<summary>Handles talking to a sieve server.</summary>
|
||||
<description>This package provides an API to talk to servers implementing the managesieve protocol. It can be used to install and remove sieve scripts, mark them active etc.</description>
|
||||
<lead>
|
||||
<name>Jan Schneider</name>
|
||||
<user>yunosh</user>
|
||||
<email>jan@horde.org</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<lead>
|
||||
<name>Richard Heyes</name>
|
||||
<user>richard</user>
|
||||
<email>richard@php.net</email>
|
||||
<active>no</active>
|
||||
</lead>
|
||||
<lead>
|
||||
<name>Damian Fernandez Sosa</name>
|
||||
<user>damian</user>
|
||||
<email>damlists@cnba.uba.ar</email>
|
||||
<active>no</active>
|
||||
</lead>
|
||||
<lead>
|
||||
<name>Anish Mistry</name>
|
||||
<user>amistry</user>
|
||||
<email>amistry@am-productions.biz</email>
|
||||
<active>no</active>
|
||||
</lead>
|
||||
<date>2015-08-02</date>
|
||||
<version>
|
||||
<release>1.5.0</release>
|
||||
<api>1.5.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Dropped PHP4 support, fixed PHP7 warnings
|
||||
</notes>
|
||||
<contents>
|
||||
<dir name="/" baseinstalldir="Net">
|
||||
<dir name="tests">
|
||||
<file name="largescript.siv" role="test" />
|
||||
<file name="config.php.dist" role="test" />
|
||||
<file name="SieveTest.php" role="test" />
|
||||
</dir> <!-- /tests -->
|
||||
<file name="Sieve.php" role="php">
|
||||
<tasks:replace from="@package_version@" to="version" type="package-info" />
|
||||
</file>
|
||||
</dir> <!-- / -->
|
||||
</contents>
|
||||
<dependencies>
|
||||
<required>
|
||||
<php>
|
||||
<min>5.0.0</min>
|
||||
</php>
|
||||
<pearinstaller>
|
||||
<min>1.4.0b1</min>
|
||||
</pearinstaller>
|
||||
<package>
|
||||
<name>Net_Socket</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<min>1.0</min>
|
||||
</package>
|
||||
<package>
|
||||
<name>PEAR</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<min>1.0</min>
|
||||
</package>
|
||||
</required>
|
||||
<optional>
|
||||
<package>
|
||||
<name>Auth_SASL</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<min>1.0</min>
|
||||
</package>
|
||||
</optional>
|
||||
</dependencies>
|
||||
<phprelease />
|
||||
<changelog>
|
||||
<release>
|
||||
<date>2015-01-20</date>
|
||||
<version>
|
||||
<release>1.3.4</release>
|
||||
<api>1.3.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Remove erroneous and unnecessary active script caching (Bug #20472).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2014-09-24</date>
|
||||
<version>
|
||||
<release>1.3.3</release>
|
||||
<api>1.3.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fix notices from non-static calling of PEAR methods.
|
||||
* Fix reading OK responses with string literal messages.
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2011-08-06</date>
|
||||
<version>
|
||||
<release>1.3.2</release>
|
||||
<api>1.3.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fix referrals if host data or user credentials are passed to connect() and login() instead of the constructor (Aleksander Machniak, Bug #17107).
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2011-08-05</date>
|
||||
<version>
|
||||
<release>1.3.1</release>
|
||||
<api>1.3.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Query capabilities again after successful authentication (Jesse Crawford, Request #18382).
|
||||
* Escape quotes and backslashes in script names, and use literal strings for script names with non-ASCII characters (Aleksander Machniak, Bug #16691).
|
||||
* Work around broken STARTTLS behavior in Cyrus versions before 2.3.10 (Aleksander Machniak, Bug #18241).
|
||||
* Improve string literal parsing (Aleksander Machniak, Bug #18228).</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2010-07-01</date>
|
||||
<version>
|
||||
<release>1.3.0</release>
|
||||
<api>1.3.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Add debug handler parameter to constructor.
|
||||
* Fix LOGIN authentication (Agustín Eijo, Aleksander Machniak, Bug #17527).</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2010-06-13</date>
|
||||
<version>
|
||||
<release>1.2.2</release>
|
||||
<api>1.2.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fix SASL authentication without Auth_SASL (Bug #17489).</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2010-04-19</date>
|
||||
<version>
|
||||
<release>1.2.1</release>
|
||||
<api>1.2.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fix DIGEST-MD5 authentication with Dovecot (Stef Simoens, Bug #17320).</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2010-04-01</date>
|
||||
<version>
|
||||
<release>1.2.0</release>
|
||||
<api>1.2.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>Changes since version 1.2.0b1:
|
||||
* Fix DIGEST-MD5 authentication (Aleksander Machniak, Bug #17285).
|
||||
* Don't try to call dl() if mbstring extension isn't loaded (Bug #17038).
|
||||
Changes since version 1.1.7:
|
||||
* Added support for adding a custom debug handler (Aleksander Machniak, Request #16681).
|
||||
* Fix breakage with certain locales, especially Turkish.
|
||||
* Fix reading authentication responses without literals (Bug #16647).
|
||||
* Code cleanup.</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2009-10-07</date>
|
||||
<version>
|
||||
<release>1.2.0b1</release>
|
||||
<api>1.2.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Added support for adding a custom debug handler (Aleksander Machniak, Request #16681).
|
||||
* Fix breakage with certain locales, especially Turkish.
|
||||
* Fix reading authentication responses without literals (Bug #16647).
|
||||
* Code cleanup.</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2009-07-24</date>
|
||||
<version>
|
||||
<release>1.1.7</release>
|
||||
<api>1.1.6</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fixed STARTTLS support (Bug #14205).
|
||||
* Added connect options and EXTERNAL authentication.</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2008-03-22</date>
|
||||
<version>
|
||||
<release>1.1.6</release>
|
||||
<api>1.1.6</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>
|
||||
* Fixed Bug #9273
|
||||
* Fixed copy/paste error in CRAM and DIGEST authentication error case.
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2006-10-24</date>
|
||||
<version>
|
||||
<release>1.1.5</release>
|
||||
<api>1.1.5</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>
|
||||
* Fixed Bug connect() bug
|
||||
* Fixed Request #8071
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2006-09-09</date>
|
||||
<version>
|
||||
<release>1.1.4</release>
|
||||
<api>1.1.4</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>
|
||||
* Fixed Bug #8452 Unterminated read loop
|
||||
* Fixed Bug #7845 Add mbstring support
|
||||
* Added Request #8071 Enable the ability to toggle TLS support if available.
|
||||
* Added Request #8453 Clean up PHPDoc and comments
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2006-05-21</date>
|
||||
<version>
|
||||
<release>1.1.3</release>
|
||||
<api>1.1.3</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>
|
||||
* Correctly Fixed Bug #3519 Net_Sieve w/ externally established sockets
|
||||
* Fixed Bug #7197 getScript() truncates long scripts
|
||||
* Added PHPUnit2 regression test script
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2006-02-09</date>
|
||||
<version>
|
||||
<release>1.1.2</release>
|
||||
<api>1.1.2</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fixed Request #4053 Added STARTTLS support for PHP 5.1 and above
|
||||
* Fixed Bug #3519 Net_Sieve w/ externally established sockets
|
||||
* Fixed Bug #4794 drops protocol prefix, e.g. "ssl://" in referrals
|
||||
* Fixed STARTTLS detection
|
||||
* Allow $options[] to be passed to Net_Socket
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.1.1</release>
|
||||
<api>1.1.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2005-02-02</date>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fixed Bug #3242 cyrus murder referrals not followed
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.1.0</release>
|
||||
<api>1.1.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2004-12-18</date>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fixed Bug #2728 Linebreaks not being read using getScript()
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.0.1</release>
|
||||
<api>1.0.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2004-03-13</date>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fixed BUG #1006
|
||||
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.0.0</release>
|
||||
<api>1.0.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2004-03-10</date>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Fixed DIGEST-MD5 sasl version handling (sasl v1.xx responses are diferent than v2.xx)
|
||||
* Fixed LOGIN Method
|
||||
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>0.9.1</release>
|
||||
<api>0.9.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2004-02-29</date>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* There is an issue whith the DIGEST-MD5 method. in one installation it does not work but in my server it works perfect! please send me debug info to solve the problem if
|
||||
it affects you or disable DIGEST-MD5
|
||||
* some optimizations to the code
|
||||
* added haveSpace() to check if the server has space to store the script. Use with care HAVESPACE seems to be broken in cyrus 2.0.16
|
||||
* added hasExtension()
|
||||
* added getExtensions()
|
||||
* added referral support and automatic following of them. (it also handles the following of multireferrals).
|
||||
* removed _getResponse replaced by _doCmd. (thanks to Etienne Goyer for this)
|
||||
* added supportsAuthMech()
|
||||
* if installed automatically uses Auth_SASL
|
||||
* added CRAM-MD5 auth Method
|
||||
* added DIGEST-MD5 auth Method
|
||||
* added getAuthMechs() returns an array containing all the auth methods the server supports
|
||||
* added hasAuthMech() to check if the server has a particular auth method
|
||||
* _connect --> connect: now is a public method (without breaking BC)
|
||||
* _login --> login: now is a public method (without breaking BC)
|
||||
* fix typo cmdAuthenticate() ---> _cmdAuthenticate()
|
||||
* _doCmd() now parses string responses also.
|
||||
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>0.9.0</release>
|
||||
<api>0.9.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2004-01-31</date>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>* Added setDebug() method and debugging capabilities
|
||||
* added disconnect() method
|
||||
* added sample file test_sieve.php
|
||||
* fixed bug #591
|
||||
* automagically selects the best auth method
|
||||
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>0.8.1</release>
|
||||
<api>0.8.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2002-07-27</date>
|
||||
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||
<notes>Initial release
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>0.8</release>
|
||||
<api>0.8</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2002-05-10</date>
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>Initial release
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
271
data/web/rc/vendor/roundcube/net_sieve/tests/SieveTest.php
vendored
Normal file
271
data/web/rc/vendor/roundcube/net_sieve/tests/SieveTest.php
vendored
Normal file
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
/**
|
||||
* This file contains the PHPUnit test case for Net_Sieve.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* +-----------------------------------------------------------------------+
|
||||
* | 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.|
|
||||
* | |
|
||||
* | 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 Networking
|
||||
* @package Net_Sieve
|
||||
* @author Anish Mistry <amistry@am-productions.biz>
|
||||
* @copyright 2006 Anish Mistry
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php BSD
|
||||
* @version SVN: $Id$
|
||||
* @link http://pear.php.net/package/Net_Sieve
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../Sieve.php';
|
||||
|
||||
/**
|
||||
* PHPUnit test case for Net_Sieve.
|
||||
*
|
||||
* @category Networking
|
||||
* @package Net_Sieve
|
||||
* @author Anish Mistry <amistry@am-productions.biz>
|
||||
* @copyright 2006 Anish Mistry
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php BSD
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/package/Net_Sieve
|
||||
*/
|
||||
class SieveTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
// contains the object handle of the string class
|
||||
protected $fixture;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__) . '/config.php')) {
|
||||
$this->markTestSkipped('Test configuration incomplete. Copy config.php.dist to config.php.');
|
||||
}
|
||||
require_once dirname(__FILE__) . '/config.php';
|
||||
|
||||
// Create a new instance of Net_Sieve.
|
||||
$this->_pear = new PEAR();
|
||||
$this->fixture = new Net_Sieve();
|
||||
$this->scripts = array(
|
||||
'test script1' => "require \"fileinto\";\n\rif header :contains \"From\" \"@cnba.uba.ar\" \n\r{fileinto \"INBOX.Test1\";}\r\nelse \r\n{fileinto \"INBOX\";}",
|
||||
'test script2' => "require \"fileinto\";\n\rif header :contains \"From\" \"@cnba.uba.ar\" \n\r{fileinto \"INBOX.Test\";}\r\nelse \r\n{fileinto \"INBOX\";}",
|
||||
'test"scriptäöü3' => "require \"vacation\";\nvacation\n:days 7\n:addresses [\"matthew@de-construct.com\"]\n:subject \"This is a test\"\n\"I'm on my holiday!\nsadfafs\";",
|
||||
'test script4' => file_get_contents(dirname(__FILE__) . '/largescript.siv'));
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
// Delete the instance.
|
||||
unset($this->fixture);
|
||||
}
|
||||
|
||||
protected function login()
|
||||
{
|
||||
$result = $this->fixture->connect(HOST, PORT);
|
||||
$this->assertTrue($this->check($result), 'Can not connect');
|
||||
$result = $this->fixture->login(USERNAME, PASSWORD, null, '', false);
|
||||
$this->assertTrue($this->check($result), 'Can not login');
|
||||
}
|
||||
|
||||
protected function logout()
|
||||
{
|
||||
$result = $this->fixture->disconnect();
|
||||
$this->assertFalse($this->_pear->isError($result), 'Error on disconnect');
|
||||
}
|
||||
|
||||
protected function clear()
|
||||
{
|
||||
// Clear all the scripts in the account.
|
||||
$this->login();
|
||||
$active = $this->fixture->getActive();
|
||||
if (isset($this->scripts[$active])) {
|
||||
$this->fixture->setActive(null);
|
||||
}
|
||||
foreach (array_keys($this->scripts) as $script) {
|
||||
$this->fixture->removeScript($script);
|
||||
}
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
protected function check($result)
|
||||
{
|
||||
if ($this->_pear->isError($result)) {
|
||||
throw new Exception($result->getMessage());
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
{
|
||||
$result = $this->fixture->connect(HOST, PORT);
|
||||
$this->assertTrue($this->check($result), 'Cannot connect');
|
||||
}
|
||||
|
||||
public function testLogin()
|
||||
{
|
||||
$result = $this->fixture->connect(HOST, PORT);
|
||||
$this->assertTrue($this->check($result), 'Cannot connect');
|
||||
$result = $this->fixture->login(USERNAME, PASSWORD, null, '', false);
|
||||
$this->assertTrue($this->check($result), 'Cannot login');
|
||||
}
|
||||
|
||||
public function testDisconnect()
|
||||
{
|
||||
$result = $this->fixture->connect(HOST, PORT);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Cannot connect');
|
||||
$result = $this->fixture->login(USERNAME, PASSWORD, null, '', false);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Cannot login');
|
||||
$result = $this->fixture->disconnect();
|
||||
$this->assertFalse($this->_pear->isError($result), 'Error on disconnect');
|
||||
}
|
||||
|
||||
public function testListScripts()
|
||||
{
|
||||
$this->login();
|
||||
$scripts = $this->fixture->listScripts();
|
||||
$this->logout();
|
||||
$this->assertFalse($this->_pear->isError($scripts), 'Can not list scripts');
|
||||
}
|
||||
|
||||
public function testInstallScript()
|
||||
{
|
||||
$this->clear();
|
||||
$this->login();
|
||||
|
||||
// First script.
|
||||
$scriptname = 'test script1';
|
||||
$before_scripts = $this->fixture->listScripts();
|
||||
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Can not install script ' . $scriptname);
|
||||
$after_scripts = $this->fixture->listScripts();
|
||||
$diff_scripts = array_values(array_diff($after_scripts, $before_scripts));
|
||||
$this->assertTrue(count($diff_scripts) > 0, 'Script not installed');
|
||||
$this->assertEquals($scriptname, $diff_scripts[0], 'Added script has a different name');
|
||||
|
||||
// Second script (install and activate)
|
||||
$scriptname = 'test script2';
|
||||
$before_scripts = $this->fixture->listScripts();
|
||||
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname], true);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Can not install script ' . $scriptname);
|
||||
$after_scripts = $this->fixture->listScripts();
|
||||
$diff_scripts = array_values(array_diff($after_scripts, $before_scripts));
|
||||
$this->assertTrue(count($diff_scripts) > 0, 'Script not installed');
|
||||
$this->assertEquals($scriptname, $diff_scripts[0], 'Added script has a different name');
|
||||
$active_script = $this->fixture->getActive();
|
||||
$this->assertEquals($scriptname, $active_script, 'Added script has a different name');
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
/**
|
||||
* There is a good chance that this test will fail since most servers have
|
||||
* a 32KB limit on uploaded scripts.
|
||||
*/
|
||||
public function testInstallScriptLarge()
|
||||
{
|
||||
$this->clear();
|
||||
$this->login();
|
||||
$scriptname = 'test script4';
|
||||
$before_scripts = $this->fixture->listScripts();
|
||||
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Unable to upload large script (expected behavior for most servers)');
|
||||
$after_scripts = $this->fixture->listScripts();
|
||||
$diff_scripts = array_diff($after_scripts, $before_scripts);
|
||||
$this->assertEquals($scriptname, reset($diff_scripts), 'Added script has a different name');
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
/**
|
||||
* See bug #16691.
|
||||
*/
|
||||
public function testInstallNonAsciiScript()
|
||||
{
|
||||
$this->clear();
|
||||
$this->login();
|
||||
|
||||
$scriptname = 'test"scriptäöü3';
|
||||
$before_scripts = $this->fixture->listScripts();
|
||||
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Can not install script ' . $scriptname);
|
||||
$after_scripts = $this->fixture->listScripts();
|
||||
$diff_scripts = array_values(array_diff($after_scripts, $before_scripts));
|
||||
$this->assertTrue(count($diff_scripts) > 0, 'Script not installed');
|
||||
$this->assertEquals($scriptname, $diff_scripts[0], 'Added script has a different name');
|
||||
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
public function testGetScript()
|
||||
{
|
||||
$this->clear();
|
||||
$this->login();
|
||||
$scriptname = 'test script1';
|
||||
$before_scripts = $this->fixture->listScripts();
|
||||
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Can not install script ' . $scriptname);
|
||||
$after_scripts = $this->fixture->listScripts();
|
||||
$diff_scripts = array_values(array_diff($after_scripts, $before_scripts));
|
||||
$this->assertTrue(count($diff_scripts) > 0);
|
||||
$this->assertEquals($scriptname, $diff_scripts[0], 'Added script has a different name');
|
||||
$script = $this->fixture->getScript($scriptname);
|
||||
$this->assertEquals(trim($this->scripts[$scriptname]), trim($script), 'Script installed it not the same script retrieved');
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
public function testGetActive()
|
||||
{
|
||||
$this->clear();
|
||||
$this->login();
|
||||
$active_script = $this->fixture->getActive();
|
||||
$this->assertFalse($this->_pear->isError($active_script), 'Error getting the active script');
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
public function testSetActive()
|
||||
{
|
||||
$this->clear();
|
||||
$scriptname = 'test script1';
|
||||
$this->login();
|
||||
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
|
||||
$result = $this->fixture->setActive($scriptname);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Can not set active script');
|
||||
$active_script = $this->fixture->getActive();
|
||||
$this->assertEquals($scriptname, $active_script, 'Active script does not match');
|
||||
|
||||
// Test for non-existant script.
|
||||
$result = $this->fixture->setActive('non existant script');
|
||||
$this->assertTrue($this->_pear->isError($result));
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
public function testRemoveScript()
|
||||
{
|
||||
$this->clear();
|
||||
$scriptname = 'test script1';
|
||||
$this->login();
|
||||
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
|
||||
$result = $this->fixture->removeScript($scriptname);
|
||||
$this->assertFalse($this->_pear->isError($result), 'Error removing active script');
|
||||
$this->logout();
|
||||
}
|
||||
}
|
5
data/web/rc/vendor/roundcube/net_sieve/tests/config.php.dist
vendored
Normal file
5
data/web/rc/vendor/roundcube/net_sieve/tests/config.php.dist
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
define('HOST', 'localhost');
|
||||
define('PORT', 4190);
|
||||
define('USERNAME', 'user');
|
||||
define('PASSWORD', 'pass');
|
6689
data/web/rc/vendor/roundcube/net_sieve/tests/largescript.siv
vendored
Normal file
6689
data/web/rc/vendor/roundcube/net_sieve/tests/largescript.siv
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user