mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 10:54:52 +00:00
Included WebKlex PHP-IMAP Library in plugins folder to allow for future use when we convert IMAP to allow OAUTH2
This commit is contained in:
24
plugins/php-imap/Exceptions/AuthFailedException.php
Normal file
24
plugins/php-imap/Exceptions/AuthFailedException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: AuthFailedException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 19.01.17 22:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class AuthFailedException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class AuthFailedException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/ConnectionFailedException.php
Normal file
24
plugins/php-imap/Exceptions/ConnectionFailedException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: ConnectionFailedException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 19.01.17 22:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class ConnectionFailedException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class ConnectionFailedException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/EventNotFoundException.php
Normal file
24
plugins/php-imap/Exceptions/EventNotFoundException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: EventNotFoundException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class EventNotFoundException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class EventNotFoundException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/FolderFetchingException.php
Normal file
24
plugins/php-imap/Exceptions/FolderFetchingException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: FolderFetchingException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class FolderFetchingException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class FolderFetchingException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/GetMessagesFailedException.php
Normal file
24
plugins/php-imap/Exceptions/GetMessagesFailedException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: GetMessagesFailedException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 19.01.17 22:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class GetMessagesFailedException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class GetMessagesFailedException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/ImapBadRequestException.php
Normal file
24
plugins/php-imap/Exceptions/ImapBadRequestException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: ImapBadRequestException.php
|
||||
* Category: Exception
|
||||
* Author: S. Janaczek
|
||||
* Created: 08.09.22 08:39
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class GetMessagesFailedException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class ImapBadRequestException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/ImapServerErrorException.php
Normal file
24
plugins/php-imap/Exceptions/ImapServerErrorException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: ImapServerErrorException.php
|
||||
* Category: Exception
|
||||
* Author: S. Janaczek
|
||||
* Created: 08.09.22 08:39
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class GetMessagesFailedException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class ImapServerErrorException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/InvalidMessageDateException.php
Normal file
24
plugins/php-imap/Exceptions/InvalidMessageDateException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: InvalidMessageDateException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 10.03.19 04:31
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class InvalidMessageDateException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class InvalidMessageDateException extends Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: InvalidWhereQueryCriteriaException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 21.07.18 19:04
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class InvalidWhereQueryCriteriaException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class InvalidWhereQueryCriteriaException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/MaskNotFoundException.php
Normal file
24
plugins/php-imap/Exceptions/MaskNotFoundException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MaskNotFoundException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MaskNotFoundException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MaskNotFoundException extends Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MessageContentFetchingException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MessageContentFetchingException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MessageContentFetchingException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/MessageFlagException.php
Normal file
24
plugins/php-imap/Exceptions/MessageFlagException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MessageFlagException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 02.01.21 02:47
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MessageFlagException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MessageFlagException extends Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MessageHeaderFetchingException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MessageHeaderFetchingException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MessageHeaderFetchingException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/MessageNotFoundException.php
Normal file
24
plugins/php-imap/Exceptions/MessageNotFoundException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MessageNotFoundException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 25.01.21 18:19
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MessageNotFoundException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MessageNotFoundException extends Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MessageSearchValidationException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MessageSearchValidationException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MessageSearchValidationException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/MessageSizeFetchingException.php
Normal file
24
plugins/php-imap/Exceptions/MessageSizeFetchingException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MessageSizeFetchingException.php
|
||||
* Category: Exception
|
||||
* Author: D. Malli
|
||||
* Created: 24.02.23 17:55
|
||||
* Updated: -
|
||||
*
|
||||
* Description: Exception thrown if fetching size for a message failed.
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MessageSizeFetchingException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MessageSizeFetchingException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/MethodNotFoundException.php
Normal file
24
plugins/php-imap/Exceptions/MethodNotFoundException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MethodNotFoundException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MethodNotFoundException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MethodNotFoundException extends Exception {
|
||||
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/MethodNotSupportedException.php
Normal file
24
plugins/php-imap/Exceptions/MethodNotSupportedException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: MethodNotSupportedException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 05.03.18 23:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class MethodNotSupportedException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class MethodNotSupportedException extends Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: RuntimeException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 19.01.17 22:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class NotSupportedCapabilityException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class NotSupportedCapabilityException extends Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: ProtocolNotSupportedException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 19.01.17 22:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class ProtocolNotSupportedException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class ProtocolNotSupportedException extends Exception {
|
||||
|
||||
}
|
||||
91
plugins/php-imap/Exceptions/ResponseException.php
Normal file
91
plugins/php-imap/Exceptions/ResponseException.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/*
|
||||
* File: ResponseException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 19.01.17 22:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
use Webklex\PHPIMAP\Connection\Protocols\Response;
|
||||
|
||||
/**
|
||||
* Class ResponseException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class ResponseException extends Exception {
|
||||
|
||||
/**
|
||||
* Make a new ResponseException instance
|
||||
* @param Response $response
|
||||
* @param false|boolean $debug
|
||||
* @param Exception|null $exception
|
||||
*
|
||||
* @return ResponseException
|
||||
*/
|
||||
public static function make(Response $response, bool $debug = false, ?Exception $exception = null): ResponseException {
|
||||
$message = "Command failed to process:\n";
|
||||
$message .= "Causes:\n";
|
||||
|
||||
foreach($response->getErrors() as $error) {
|
||||
$message .= "\t- $error\n";
|
||||
}
|
||||
|
||||
if(!$response->data()) {
|
||||
$message .= "\t- Empty response\n";
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
$message .= self::debug_message($response);
|
||||
}
|
||||
|
||||
foreach($response->getStack() as $_response) {
|
||||
$exception = self::make($_response, $debug, $exception);
|
||||
}
|
||||
|
||||
return new self($message."Error occurred", 0, $exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a debug message containing all commands send and responses received
|
||||
* @param Response $response
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function debug_message(Response $response): string {
|
||||
$commands = $response->getCommands();
|
||||
$message = "Commands send:\n";
|
||||
if ($commands) {
|
||||
foreach($commands as $command) {
|
||||
$message .= "\t".str_replace("\r\n", "\\r\\n", $command)."\n";
|
||||
}
|
||||
}else{
|
||||
$message .= "\tNo command send!\n";
|
||||
}
|
||||
|
||||
$responses = $response->getResponse();
|
||||
$message .= "Responses received:\n";
|
||||
if ($responses) {
|
||||
foreach($responses as $_response) {
|
||||
if (is_array($_response)) {
|
||||
foreach($_response as $value) {
|
||||
$message .= "\t".str_replace("\r\n", "\\r\\n", "$value")."\n";
|
||||
}
|
||||
}else{
|
||||
$message .= "\t".str_replace("\r\n", "\\r\\n", "$_response")."\n";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$message .= "\tNo responses received!\n";
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
}
|
||||
24
plugins/php-imap/Exceptions/RuntimeException.php
Normal file
24
plugins/php-imap/Exceptions/RuntimeException.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* File: RuntimeException.php
|
||||
* Category: Exception
|
||||
* Author: M. Goldenbaum
|
||||
* Created: 19.01.17 22:21
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Webklex\PHPIMAP\Exceptions;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* Class RuntimeException
|
||||
*
|
||||
* @package Webklex\PHPIMAP\Exceptions
|
||||
*/
|
||||
class RuntimeException extends Exception {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user