New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix mail from must equal authorized user when sending email reports #14137
Conversation
<div piwik-field uicontrol="text" name="mailFromAddress" | ||
ng-model="mailSettings.mailFromAddress" | ||
title="{{ 'General_SmtpFromAddress'|translate|e('html_attr') }}" | ||
value="{{ mail.noreply_email_address }}" inline-help="{{ 'General_UsuallyYourEmailAddress'|translate|e('html_attr') }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure but it may need to be {{ mail.noreply_email_address|e('html_attr') }}
to escape it re security
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same probably for the other fields above that were already defined
<div piwik-field uicontrol="text" name="mailFromName" | ||
ng-model="mailSettings.mailFromName" | ||
title="{{ 'General_SmtpFromName'|translate|e('html_attr') }}" | ||
value="{{ mail.noreply_email_name }}" inline-help="{{ 'General_NameShownInTheSenderColumn'|translate|e('html_attr') }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure but it may need to be {{ mail.noreply_email_name |e('html_attr') }}
to escape it re security
$fromEmailName = Config::getInstance()->General['noreply_email_name']; | ||
$fromEmailName = Config::getInstance()->mail['noreply_email_name']; | ||
if(empty($fromEmailName)){ | ||
$fromEmailName = Config::getInstance()->General['noreply_email_name']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon it might be better to create an update script using the command ./console generate:update --component=core
to migrate both config settings from General
to mail
within the doUpdate()
method. This way it will be easier to change the value for users in the future (by directly seeing the default value noreply@{DOMAIN}
) and it won't be defined in 2 places (less confusion).
You can see an example here: https://github.com/matomo-org/matomo/blob/3.x-dev/core/Updates/2.15.0-b12.php#L25-L41
This means you can set the default value of noreply@{DOMAIN}
for [mail]noreply...
Thanks for this @nyanim 👍 very appreciated. Left a comment in the PR |
@@ -869,6 +869,8 @@ | |||
username = ; SMTP username | |||
password = ; SMTP password | |||
encryption = ; SMTP transport-layer encryption, either 'ssl', 'tls', or empty (i.e., none). | |||
noreply_email_address = ; standard email address displayed when sending emails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will also need to remove these settings from the General
section
@@ -292,6 +292,8 @@ | |||
"OneVisit": "1 次访问", | |||
"OnlyEnterIfRequired": "在您的 SMTP 服务器需要用户名时才需要输入", | |||
"OnlyEnterIfRequiredPassword": "在您的 SMTP 服务器需要密码时才需要输入", | |||
"UsuallyYourEmailAddress": "通常是您的Email地址", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we can only include english default translations. Other languages will need to be translated through our translation tool see https://matomo.org/translations
Duplicate of #14975 |
fix #12426
Hi there,
For some email providers (eg. qq.com, exmail.qq.com), sending emails via smtp without providing "from address" will get the "mail from must equal authorized user" error.
Though PR #8454 added "noreply_email_address" and "noreply_email_name" field to the config file, it placed these fields to the "General" section, instead of "mail" section, which is misleading. And it cannot be set from the General Settings page.
I moved the two options to the "mail" section of the config file, and added "SMTP from address" and "SMTP from name" to the General Settings page to enable users to configure these two fields from the Settings page.
Regards.