{"record":{"id":"57271c2e85469759","repo":"passbolt/passbolt_api","slug":"password-expiry-email-notifications-are-disabled","errorCode":null,"errorMessage":"Password expiry email notifications are disabled.","messagePattern":"Password expiry email notifications are disabled\\.","errorType":"console","errorClass":"StopException","httpStatus":null,"severity":"warning","filePath":"plugins/PassboltEe/PasswordExpiryPolicies/src/Service/Resources/PasswordExpiryPoliciesGetOwnersOfResourcesAboutToExpireService.php","lineNumber":148,"sourceCode":"        $tomorrow = DateTime::tomorrow();\n        $aboutToExpireCondition = [\n            'expired >=' => $today->addDays($expiresInDays ?? 0),\n            'expired <' => $tomorrow->addDays($expiresInDays ?? 0),\n        ];\n        $expiredCondition = [\n            'expired >=' => $today,\n            'expired <' => $tomorrow,\n        ];\n        if ($expiresInDays && $notifyIfExpiresToday) {\n            $condition = [\n                'OR' => [$aboutToExpireCondition, $expiredCondition],\n            ];\n        } elseif ($expiresInDays) {\n            $condition = $aboutToExpireCondition;\n        } elseif ($notifyIfExpiresToday) {\n            $condition = $expiredCondition;\n        } else {\n            throw new StopException(__('Password expiry email notifications are disabled.'));\n        }\n\n        return $expiredResources->where($condition);\n    }\n}\n","sourceCodeStart":130,"sourceCodeEnd":154,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/PasswordExpiryPolicies/src/Service/Resources/PasswordExpiryPoliciesGetOwnersOfResourcesAboutToExpireService.php#L130-L154","documentation":"Passbolt's PasswordExpiryPolicies plugin throws this StopException from findResourcesExpiringTodayOrInNDays when the notification conditions are contradictory: no 'expires in N days' window was requested and 'notify if expires today' is disabled, so there is no valid condition to query expiring resources with. It signals that expiry email notifications are effectively turned off in the settings, making the lookup impossible.","triggerScenarios":"Calling getUsersToNotify when the password expiry settings have no expiresInDays interval and notifyIfExpiresToday is false (e.g. empty/0 $expiresInDays with $notifyIfExpiresToday falsy), typically via the expiry report email command.","commonSituations":"Organizational settings where the 'notify about passwords expiring today' option is disabled while a scheduled cron job still runs the expiry notification lookup; a settings migration that wiped the expiry policy configuration leaving both flags off.","solutions":["Enable the password expiry notification settings (set notifyIfExpiresToday true or configure an expiresInDays interval) via passbolt settings or the PasswordExpiryPolicies settings API","Skip running the expiry notification lookup when notifications are disabled — check the settings before calling getUsersToNotify","Verify the organization-settings entity for PasswordExpiryPolicies is populated (passbolt org settings table) and re-save the policy form"],"exampleFix":"// before\n$service->findResourcesExpiringTodayOrInNDays($uac, [], false); // throws\n\n// after\n$settings = $this->getSettings();\nif ($settings->isNotificationEnabled()) {\n    $service->findResourcesExpiringTodayOrInNDays($uac, [], true);\n}","handlingStrategy":"validation","validationCode":"$settings = $this->getPasswordExpirySettings();\nif (!$settings['notifyIfExpiresToday'] && empty($settings['expiresInDays'])) {\n    return; // skip lookup: notifications disabled\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check notification settings before scheduling/running the expiry email job","Keep expiry policy settings under version-controlled config review","Add an integration test covering the disabled-notifications path"],"tags":["passbolt","password-expiry","notifications","config"],"backgroundTag":"feature-not-enabled","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}