mirror of
https://git.hexahost.dev/smueller/HexaHost-Frontend.git
synced 2026-06-02 06:58:43 +00:00
Merge branch 'main' of https://git.hexahost.dev/smueller/HexaHost-Frontend
This commit is contained in:
@@ -31,21 +31,34 @@ define('ADDITIONAL_HEADERS', [
|
||||
]);
|
||||
|
||||
|
||||
|
||||
define('ALLOWED_EMAIL_DOMAINS', [
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
]);
|
||||
|
||||
|
||||
|
||||
define('BLACKLISTED_EMAILS', [
|
||||
|
||||
|
||||
|
||||
|
||||
]);
|
||||
|
||||
|
||||
if (!defined('SMTP_HOST') || !defined('SMTP_USERNAME') || !defined('SMTP_PASSWORD')) {
|
||||
die('SMTP-Konfiguration ist unvollständig. Bitte überprüfen Sie die mail-config.php');
|
||||
}
|
||||
|
||||
if (!filter_var(SMTP_FROM_EMAIL, FILTER_VALIDATE_EMAIL)) {
|
||||
die('Ungültige SMTP_FROM_EMAIL Adresse');
|
||||
}
|
||||
@@ -72,17 +85,20 @@ function logEmail($type, $data) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
function isValidEmail($email) {
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (in_array($email, BLACKLISTED_EMAILS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!empty(ALLOWED_EMAIL_DOMAINS)) {
|
||||
$domain = substr(strrchr($email, "@"), 1);
|
||||
if (!in_array($domain, ALLOWED_EMAIL_DOMAINS)) {
|
||||
@@ -94,6 +110,7 @@ function isValidEmail($email) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getHexaHostConfig($key = null) {
|
||||
$config = [
|
||||
|
||||
@@ -103,6 +120,7 @@ function getHexaHostConfig($key = null) {
|
||||
'to_name' => 'HexaHost Support',
|
||||
|
||||
|
||||
|
||||
'max_requests_per_hour' => MAX_REQUESTS_PER_HOUR,
|
||||
'honeypot_field' => 'website',
|
||||
'enable_csrf' => ENABLE_CSRF_PROTECTION,
|
||||
@@ -110,6 +128,7 @@ function getHexaHostConfig($key = null) {
|
||||
'max_message_length' => MAX_MESSAGE_LENGTH,
|
||||
|
||||
|
||||
|
||||
'debug_mode' => DEBUG_MODE,
|
||||
'log_errors' => LOG_EMAILS,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user