Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable3.7] fix(imap): persist vanished messages immediately on EXAMINE commands #10214

Merged
merged 1 commit into from
Oct 7, 2024
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
12 changes: 7 additions & 5 deletions lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
use Horde_Imap_Client_Socket;
use JsonSerializable;
use OC;
use OCA\Mail\Cache\Cache;
use OCA\Mail\Cache\HordeCacheFactory;
use OCA\Mail\Db\Alias;
use OCA\Mail\Db\MailAccount;
use OCA\Mail\Exception\ServiceException;
Expand All @@ -48,6 +48,7 @@
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\Security\ICrypto;
use OCP\Server;
use ReturnTypeWillChange;

class Account implements JsonSerializable {
Expand All @@ -69,6 +70,8 @@ class Account implements JsonSerializable {
/** @var Alias */
private $alias;

private HordeCacheFactory $hordeCacheFactory;

/**
* @param MailAccount $account
*/
Expand All @@ -77,6 +80,7 @@ public function __construct(MailAccount $account) {
$this->crypto = OC::$server->getCrypto();
$this->config = OC::$server->getConfig();
$this->memcacheFactory = OC::$server->getMemcacheFactory();
$this->hordeCacheFactory = Server::get(HordeCacheFactory::class);
}

public function __destruct() {
Expand Down Expand Up @@ -153,10 +157,8 @@ public function getImapConnection() {
if ($this->config->getSystemValue('app.mail.server-side-cache.enabled', true)) {
if ($this->memcacheFactory->isAvailable()) {
$params['cache'] = [
'backend' => new Cache([
'cacheob' => $this->memcacheFactory
->createDistributed(md5($this->getId() . $this->getEMailAddress()))
])];
'backend' => $this->hordeCacheFactory->newCache($this),
];
}
}
$this->client = new \Horde_Imap_Client_Socket($params);
Expand Down
Loading
Loading