Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .horde.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies:
required:
php: ^8.1
composer:
horde/eventdispatcher: ^1
horde/exception: ^3
horde/mail: ^3
horde/mime: ^3
Expand All @@ -51,6 +52,8 @@ dependencies:
horde/pack: ^2
horde/stringprep: ^2
horde/support: ^3
psr/event-dispatcher: ^1
psr/simple-cache: ^3
optional:
composer:
horde/cache: ^3
Expand Down
70 changes: 36 additions & 34 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,53 @@
"time": "2026-04-12",
"repositories": [],
"require": {
"horde/horde-installer-plugin": "dev-FRAMEWORK_6_0 || ^3 || ^2",
"horde/horde-installer-plugin": "^3 || ^2",
"php": "^8.1",
"horde/exception": "^3 || dev-FRAMEWORK_6_0",
"horde/mail": "^3 || dev-FRAMEWORK_6_0",
"horde/mime": "^3 || dev-FRAMEWORK_6_0",
"horde/socket_client": "^3 || dev-FRAMEWORK_6_0",
"horde/stream": "^2 || dev-FRAMEWORK_6_0",
"horde/secret": "^3 || dev-FRAMEWORK_6_0",
"horde/stream_filter": "^3 || dev-FRAMEWORK_6_0",
"horde/translation": "^3 || dev-FRAMEWORK_6_0",
"horde/util": "^3 || dev-FRAMEWORK_6_0",
"horde/eventdispatcher": "^1",
"horde/exception": "^3",
"horde/mail": "^3",
"horde/mime": "^3",
"horde/socket_client": "^3",
"horde/stream": "^2",
"horde/secret": "^3",
"horde/stream_filter": "^3",
"horde/translation": "^3",
"horde/util": "^3",
"ext-hash": "*",
"ext-json": "*"
},
"require-dev": {
"horde/cache": "^3 || dev-FRAMEWORK_6_0",
"horde/compress_fast": "^2 || dev-FRAMEWORK_6_0",
"horde/crypt_blowfish": "^2 || dev-FRAMEWORK_6_0",
"horde/db": "^3 || dev-FRAMEWORK_6_0",
"horde/hashtable": "^2 || dev-FRAMEWORK_6_0",
"horde/mongo": "^2 || dev-FRAMEWORK_6_0",
"horde/pack": "^2 || dev-FRAMEWORK_6_0",
"horde/stringprep": "^2 || dev-FRAMEWORK_6_0",
"horde/support": "^3 || dev-FRAMEWORK_6_0"
"horde/cache": "^3",
"horde/compress_fast": "^2",
"horde/crypt_blowfish": "^2",
"horde/db": "^3",
"horde/hashtable": "^2",
"horde/mongo": "^2",
"horde/pack": "^2",
"horde/stringprep": "^2",
"horde/support": "^3",
"psr/event-dispatcher": "^1",
"psr/simple-cache": "^3"
},
"suggest": {
"horde/cache": "^3 || dev-FRAMEWORK_6_0",
"horde/compress_fast": "^2 || dev-FRAMEWORK_6_0",
"horde/crypt_blowfish": "^2 || dev-FRAMEWORK_6_0",
"horde/db": "^3 || dev-FRAMEWORK_6_0",
"horde/hashtable": "^2 || dev-FRAMEWORK_6_0",
"horde/mongo": "^2 || dev-FRAMEWORK_6_0",
"horde/pack": "^2 || dev-FRAMEWORK_6_0",
"horde/stringprep": "^2 || dev-FRAMEWORK_6_0",
"horde/support": "^3 || dev-FRAMEWORK_6_0",
"horde/cache": "^3",
"horde/compress_fast": "^2",
"horde/crypt_blowfish": "^2",
"horde/db": "^3",
"horde/hashtable": "^2",
"horde/mongo": "^2",
"horde/pack": "^2",
"horde/stringprep": "^2",
"horde/support": "^3",
"ext-intl": "*",
"ext-mbstring": "*"
},
"autoload": {
"psr-0": {
"Horde_Imap_Client": "lib/"
},
"psr-4": {
"Horde\\Imap\\Client\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -71,9 +77,5 @@
"horde/horde-installer-plugin": true
}
},
"extra": {
"branch-alias": {
"dev-FRAMEWORK_6_0": "3.x-dev"
}
}
}
"minimum-stability": "dev"
}
5 changes: 5 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@
</testsuite>
<testsuite name="integration">
<directory>test/Integration</directory>
<exclude>test/Integration/Connection</exclude>
</testsuite>
<testsuite name="connection">
<directory>test/Integration/Connection</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>lib</directory>
<directory>src</directory>
</include>
</source>
</phpunit>
39 changes: 39 additions & 0 deletions src/AclRight.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

/**
* Copyright 2008-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client;

/**
* IMAP ACL rights (RFC 4314 section 2.1).
*
* Deprecated RFC 2086 rights 'c' and 'd' are deliberately omitted.
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
enum AclRight: string
{
case Lookup = 'l';
case Read = 'r';
case Seen = 's';
case Write = 'w';
case Insert = 'i';
case Post = 'p';
case CreateMbox = 'k';
case DeleteMbox = 'x';
case DeleteMsgs = 't';
case Expunge = 'e';
case Administer = 'a';
}
40 changes: 40 additions & 0 deletions src/CapabilityInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

/**
* Copyright 2014-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2014-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client;

/**
* Protocol capability query interface.
*
* Shared shape for IMAP and POP3 capabilities. Implementations are
* completely independent (ImapCapability is rich, Pop3Capability is simple).
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2014-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
interface CapabilityInterface
{
/**
* Query whether a capability (and optional parameter) is supported.
*/
public function query(string $capability, ?string $parameter = null): bool;

/**
* Get the parameters for a capability.
*
* @return string[]
*/
public function getParams(string $capability): array;
}
46 changes: 46 additions & 0 deletions src/ConnectionConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/**
* Copyright 2008-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client;

/**
* Immutable connection configuration DTO.
*
* Replaces the associative array previously passed to
* Horde_Imap_Client_Base::__construct(). All values are stored; the
* TCP connection is deferred until the first real protocol call.
*
* When $port is null the implementation picks the conventional default
* (993 for SSL, 143 for plain/TLS IMAP; 995/110 for POP3).
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
final class ConnectionConfig
{
public function __construct(
public readonly string $username,
public readonly string|PasswordInterface $password,
public readonly string $hostspec = 'localhost',
public readonly ?int $port = null,
public readonly SecureMode $secure = SecureMode::None,
public readonly int $timeout = 30,
public readonly int $readTimeout = 120,
public readonly ?array $context = null,
public readonly array $capabilityIgnore = [],
public readonly ?array $id = null,
public readonly array $lang = [],
) {}
}
24 changes: 24 additions & 0 deletions src/Event/AlertReceived.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/**
* Copyright 2008-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client\Event;

/**
* Dispatched when the server sends an RFC 3501 section 7.1 ALERT response.
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
class AlertReceived extends ImapEvent {}
24 changes: 24 additions & 0 deletions src/Event/AuthenticationFailed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/**
* Copyright 2008-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client\Event;

/**
* Dispatched after login failure.
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
class AuthenticationFailed extends ImapEvent {}
24 changes: 24 additions & 0 deletions src/Event/AuthenticationSucceeded.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/**
* Copyright 2008-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client\Event;

/**
* Dispatched after successful login.
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
class AuthenticationSucceeded extends ImapEvent {}
24 changes: 24 additions & 0 deletions src/Event/CacheDeleted.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/**
* Copyright 2008-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client\Event;

/**
* Dispatched after cache entries are purged.
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
class CacheDeleted extends DiagnosticEvent {}
24 changes: 24 additions & 0 deletions src/Event/CacheRetrieved.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/**
* Copyright 2008-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/

namespace Horde\Imap\Client\Event;

/**
* Dispatched after data is read from cache.
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2008-2026 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
class CacheRetrieved extends DiagnosticEvent {}
Loading
Loading