Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Controller/AutoConfigController.php')
-rw-r--r--lib/Controller/AutoConfigController.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Controller/AutoConfigController.php b/lib/Controller/AutoConfigController.php
index 796f7a42a..1c2517753 100644
--- a/lib/Controller/AutoConfigController.php
+++ b/lib/Controller/AutoConfigController.php
@@ -62,20 +62,22 @@ class AutoConfigController extends Controller {
public function queryIspdb(string $email): JsonResponse {
$rfc822Address = new Horde_Mail_Rfc822_Address($email);
if (!$rfc822Address->valid) {
- return JsonResponse::fail('Invalid email address', Http::STATUS_UNPROCESSABLE_ENTITY);
+ return JsonResponse::fail('Invalid email address', Http::STATUS_UNPROCESSABLE_ENTITY)
+ ->cacheFor(60 * 60, false, true);
}
$config = $this->ispDb->query($rfc822Address->host, $rfc822Address);
- return JsonResponse::success($config);
+ return JsonResponse::success($config)->cacheFor(5 * 60, false, true);
}
public function queryMx(string $email): JsonResponse {
$rfc822Address = new Horde_Mail_Rfc822_Address($email);
if (!$rfc822Address->valid) {
- return JsonResponse::fail('Invalid email address', Http::STATUS_UNPROCESSABLE_ENTITY);
+ return JsonResponse::fail('Invalid email address', Http::STATUS_UNPROCESSABLE_ENTITY)
+ ->cacheFor(60 * 60, false, true);
}
return JsonResponse::success(
$this->mxRecord->query($rfc822Address->host),
- );
+ )->cacheFor(5 * 60, false, true);
}
public function testConnectivity(string $host, int $port): JsonResponse {