diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php
index 3e6ee2a463f3f571b7c7677c3c518357361719af..39692e036ba07f042f3976f9dd37534d7a0ba66b 100644
--- a/core/Command/Maintenance/Install.php
+++ b/core/Command/Maintenance/Install.php
@@ -171,6 +171,10 @@ class Install extends Command {
 			$adminPassword = $helper->ask($input, $output, $question);
 		}
 
+		if ($adminEmail !== null && !filter_var($adminEmail, FILTER_VALIDATE_EMAIL)) {
+			throw new InvalidArgumentException('Invalid e-mail-address <' . $adminEmail . '> for <' . $adminLogin . '>.');
+		}
+
 		$options = [
 			'dbtype' => $db,
 			'dbuser' => $dbUser,
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index 9346edd83635849679a6118ba43abbc2401fcb6d..e9719705fcddd279f2d2ef2a41f763e8e59eebfb 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -416,12 +416,7 @@ class Setup {
 
 			// Set email for admin
 			if (!empty($options['adminemail'])) {
-				$adminEmail = htmlspecialchars_decode($options['adminemail']);
-				if (filter_var($adminEmail, FILTER_VALIDATE_EMAIL)) {
-					$config->setUserValue($user->getUID(), 'settings', 'email', $adminEmail);
-				} else {
-					$error[] = "Invalid e-mail-address <$adminEmail> for <$username>.";
-				}
+				$config->setUserValue($user->getUID(), 'settings', 'email', $options['adminemail']);
 			}
 		}