From c233269f47c175045b7cfc06828c0ac816f6dcf2 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Fri, 30 Oct 2026 16:54:31 +0100 Subject: [PATCH] Nextcloud only handle POST data when there' s a user --- .../snappymail/lib/Controller/FetchController.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/integrations/nextcloud/snappymail/lib/Controller/FetchController.php b/integrations/nextcloud/snappymail/lib/Controller/FetchController.php index 25bc0254b..385710e91 100644 --- a/integrations/nextcloud/snappymail/lib/Controller/FetchController.php +++ b/integrations/nextcloud/snappymail/lib/Controller/FetchController.php @@ -105,14 +105,15 @@ class FetchController extends Controller { $sEmail = ''; if (isset($_POST['appname'], $_POST['snappymail-password'], $_POST['snappymail-email']) && 'snappymail' === $_POST['appname']) { $sUser = SnappyMailHelper::getUID(); + if ($sUser) { + $sEmail = $_POST['snappymail-email']; + $this->config->setUserValue($sUser, 'snappymail', 'snappymail-email', $sEmail); - $sEmail = $_POST['snappymail-email']; - $this->config->setUserValue($sUser, 'snappymail', 'snappymail-email', $sEmail); - - $sPass = $_POST['snappymail-password']; - if ('******' !== $sPass) { - $this->config->setUserValue($sUser, 'snappymail', 'passphrase', - $sPass ? SnappyMailHelper::encodePassword($sPass, \md5($sEmail)) : ''); + $sPass = $_POST['snappymail-password']; + if ('******' !== $sPass) { + $this->config->setUserValue($sUser, 'snappymail', 'passphrase', + $sPass ? SnappyMailHelper::encodePassword($sPass, \md5($sEmail)) : ''); + } } } else { return new JSONResponse([