Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c2425ea authored by AVINASH GUSAIN's avatar AVINASH GUSAIN
Browse files

Merge branch 'dev/fix-spam-check' into 'main'

added check for block

See merge request !132
parents 0a64ff6b 1cf2c964
Loading
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -273,10 +273,15 @@ class RecoveryEmailService {
					throw new BlacklistedEmailException($l->t('The email address is disposable. Please provide another recovery address.'));
				}

				// Only block if deliverable_email is false AND block is true (or not false)
				// If deliverable_email is false but block is false, let it pass
				if (isset($data['deliverable_email']) && $data['deliverable_email'] === false) {
					$isBlock = $data['block'] ?? true;
					if ($isBlock !== false) {
						$this->logger->info("User ID $username's requested recovery email address is not deliverable.");
						throw new BlacklistedEmailException($l->t('The email address is not deliverable. Please provide another recovery address.'));
					}
				}
			} catch (Exception $e) {
				// Optionally handle specific exceptions if needed here (e.g., timeouts, network errors)
				$this->logger->error("Error while validating email for user $username: " . $e->getMessage());