Closed alexlehm closed 3 months ago
use SMTP settings to send emails using valid smtp authentication If you want to use webmaster@mydomain - set the admin-email to that and not user@gmail.com
Also
lib/Froxlor/Cron/Traffic/ReportsCron.php uses the recipient address of a report as From address which makes the mail
is simply not true, see From: https://github.com/froxlor/Froxlor/blob/v2.1/lib/Froxlor/Cron/Traffic/ReportsCron.php#L131 and recipient: https://github.com/froxlor/Froxlor/blob/v2.1/lib/Froxlor/Cron/Traffic/ReportsCron.php#L135
First one is the customer's admin and the second one the customer itself.
If you talk about the mail to the admin itself (which indeed sets the From to the same value as the recipient) - then yes this is intended as for now. A solution might be to set the global system sender-email (and possible smtp setting) as "From" there ...I'll check
You may want to test the following patch:
diff --git a/lib/Froxlor/Cron/Traffic/ReportsCron.php b/lib/Froxlor/Cron/Traffic/ReportsCron.php
index 01828c1d..cd8babaf 100644
--- a/lib/Froxlor/Cron/Traffic/ReportsCron.php
+++ b/lib/Froxlor/Cron/Traffic/ReportsCron.php
@@ -211,7 +211,7 @@ class ReportsCron extends FroxlorCron
$_mailerror = false;
$mailerr_msg = "";
try {
- $mail->SetFrom($row['email'], $row['name']);
+ $mail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(nl2br($mail_body));
@@ -297,7 +297,7 @@ class ReportsCron extends FroxlorCron
$_mailerror = false;
$mailerr_msg = "";
try {
- $mail->SetFrom($row['email'], $row['name']);
+ $mail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
$mail->Subject = $mail_subject;
$mail->Body = $mail_body;
$mail->MsgHTML(nl2br($mail_body));
@@ -472,7 +472,7 @@ class ReportsCron extends FroxlorCron
$_mailerror = false;
$mailerr_msg = "";
try {
- $mail->SetFrom($row['email'], $row['name']);
+ $mail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(nl2br($mail_body));
Thank you, I have patched that in my server
As a rule of thumb: before reporting an issue
Describe the bug lib/Froxlor/Cron/Traffic/ReportsCron.php uses the recipient address of a report as From address which makes the mail undeliverable for strict DMARC domains
E.g. I use username@gmail.com as admin address and that means that the mail will be rejected by gmail since it is not DKIM signed
System information
To Reproduce
Expected behavior The mail should use a local email address as From, e.g. webmaster@mydomain.de