Changeset View
Changeset View
Standalone View
Standalone View
src/app/Backends/IMAP.php
Show All 25 Lines | public static function verifyAccount(string $username): bool | ||||
if (!is_array($folders)) { | if (!is_array($folders)) { | ||||
throw new \Exception("Failed to get IMAP folders"); | throw new \Exception("Failed to get IMAP folders"); | ||||
} | } | ||||
return count($folders) > 0; | return count($folders) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Check if we can connect to the imap server | |||||
* | |||||
* @return bool True on success | |||||
*/ | |||||
public static function healthcheck(): bool | |||||
{ | |||||
$config = self::getConfig(); | |||||
$imap = self::initIMAP($config); | |||||
$imap->closeConnection(); | |||||
return true; | |||||
} | |||||
/** | |||||
* Check if a shared folder is set up. | * Check if a shared folder is set up. | ||||
* | * | ||||
* @param string $folder Folder name, e.g. shared/Resources/Name@domain.tld | * @param string $folder Folder name, e.g. shared/Resources/Name@domain.tld | ||||
* | * | ||||
* @return bool True if a folder exists and is set up, False otherwise | * @return bool True if a folder exists and is set up, False otherwise | ||||
*/ | */ | ||||
public static function verifySharedFolder(string $folder): bool | public static function verifySharedFolder(string $folder): bool | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |