From dac8126900c132593993fb01d3a5db1b74c53867 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Tue, 8 Oct 2024 09:51:34 -0700 Subject: [PATCH] Minor fixes for recent mail to email feature. --- .../rslight/scripts/interBBS_mail.php | 2 +- Rocksolid_Light/spoolnews/mail.php | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Rocksolid_Light/rslight/scripts/interBBS_mail.php b/Rocksolid_Light/rslight/scripts/interBBS_mail.php index c33fb0a..10181c6 100644 --- a/Rocksolid_Light/rslight/scripts/interBBS_mail.php +++ b/Rocksolid_Light/rslight/scripts/interBBS_mail.php @@ -181,7 +181,7 @@ if ($do_mail_update == true) { function import_user_message($from, $rcpt, $date, $subject, $message) { - global $config_dir, $spooldir, $OVERRIDES; + global $CONFIG, $config_dir, $spooldir, $OVERRIDES; if (($to = get_config_value('aliases.conf', strtolower($rcpt))) == false) { $to = strtolower($rcpt); diff --git a/Rocksolid_Light/spoolnews/mail.php b/Rocksolid_Light/spoolnews/mail.php index ebfd4b1..724bcd8 100644 --- a/Rocksolid_Light/spoolnews/mail.php +++ b/Rocksolid_Light/spoolnews/mail.php @@ -254,15 +254,17 @@ if (isset($_POST['sendMessage'])) { } // Send internet email notification here - $user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . $to . '.config')); - if ($user_config['send_mail_to_email'] == 'true') { - $email_subject = "New Mail in your Inbox from " . $from . " on " . ltrim($CONFIG['server_path'], "@"); - if (get_user_config($to, 'email_verified') == 'true') { - if ($email_address = get_user_config($to, 'email')) { - $message = "\nYou have received mail from " . $from . " on " . ltrim($CONFIG['server_path'], "@") . "\n\n-----\n" . $message; - $message = rtrim($message); - $message .= "\n-----\n\nTo Reply, log into site and view Mail"; - send_internet_email($email_subject, $message, $email_address); + if (strpos('@', $to) === false) { + $user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . $to . '.config')); + if ($user_config['send_mail_to_email'] == 'true') { + $email_subject = "New Mail in your Inbox from " . $from . " on " . ltrim($CONFIG['server_path'], "@"); + if (get_user_config($to, 'email_verified') == 'true') { + if ($email_address = get_user_config($to, 'email')) { + $message = "\nYou have received mail from " . $from . " on " . ltrim($CONFIG['server_path'], "@") . "\n\n-----\n" . $message; + $message = rtrim($message); + $message .= "\n-----\n\nTo Reply, log into site and view Mail"; + send_internet_email($email_subject, $message, $email_address); + } } } }