Skip to content
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

Change to SMTP mail composition to comply with standards #257

Closed
nmalcolm opened this issue Mar 3, 2014 · 9 comments · Fixed by #2877
Closed

Change to SMTP mail composition to comply with standards #257

nmalcolm opened this issue Mar 3, 2014 · 9 comments · Fixed by #2877
Labels
b:1.8 Branch: 1.8.x p:medium Priority: Medium. Issues to be resolved with normal preference s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Milestone

Comments

@nmalcolm
Copy link
Contributor

nmalcolm commented Mar 3, 2014

Problem:

When a user writes an Email (PM) to another user, the mail header is constructed in this manner now (only the important lines):

Return-Path:
To:
From:

Reply-To:

This (often) results in the mail server sending an error : "The mail server does not understand the RCPT TO command. Reason: 553 5.7.1. Sender address rejected: not owned by user XXXXXX."
As it seems, the attempt to send an email from user@xxx.com from the mailserver yyy.com is seen as a potential abuse and is rejected.

The mail should therefor be constructed (correctly) in this manner:

Return-Path: <Mybb_name> <Mybb_returnmail/adminmail>
To:
From: <Mybb_name <Mybb_adminmail>

Reply-To:

This scheme should be mandatory for ALL emails sent by the system.
The names in front of the email adresses are required to avoid confusion for mail programs (e.g. mail programs like to use the "from name" when replying to a message when the "reply-to name" is empty (despite of the email).

Original report: http://dev.mybb.com/issues/1720
Reporter: Yuri Taillandier
Status: New

@nmalcolm nmalcolm added this to the 1.6.14 milestone Mar 20, 2014
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.6.15, 1.6.14 Jun 19, 2014
@DiogoParrinha DiogoParrinha added 1.8 and removed 1.6 labels Aug 2, 2014
@DiogoParrinha DiogoParrinha modified the milestones: 1.6.15, 1.8.1 Aug 2, 2014
@DiogoParrinha DiogoParrinha modified the milestones: 1.8.1, 1.8.2 Oct 4, 2014
@DiogoParrinha DiogoParrinha modified the milestones: 1.8.3, 1.8.4 Nov 18, 2014
@Sama34
Copy link
Contributor

Sama34 commented Dec 26, 2014

I suppose there is text of images missing because it seems to lack information.

@Destroy666x
Copy link
Contributor

Another report for this here: http://community.mybb.com/thread-161693.html

@Sama34
Copy link
Contributor

Sama34 commented Feb 22, 2015

I suppose we can check if the server is respecting the SPF policy before sending a e-mail. Or add a new setting if that is not possible.

@Destroy666x Destroy666x added the p:medium Priority: Medium. Issues to be resolved with normal preference label Feb 22, 2015
@JN-Jones JN-Jones modified the milestones: 1.8.5, 1.8.6 Apr 30, 2015
@NotoriousPyro
Copy link
Contributor

image

Example test email sent by myself to myself using the board. The from field is now filled correctly and the reply-to is also filled with the user's email.

Not sure if this breaks anything though, so be warned.

@Evenprime
Copy link
Contributor

Additional comment to pull request:

I don't think it should be necessary to check if the domain that is used in the "from"-field uses SPF/is protected by DMARC. It is the responsibility of the administrator to use a forum reply-to adress that he/she has control over and therefore can set the correct SPF entries for that domain.

The only situation that I can think of where the from adress is not the forum adress, is the sending of mails from users to users (the initial reason for this issue report). This case should be fixed by passing the correct parameters to the mailing method. The from field should end up being the same adress that is used for all types of forum notifications, the "reply-to" adress should be that of the user that is sending the mail.

Anything beyond that (proper spf records for that "from" adress etc.) should not be the problem or focus of the forum software itself.

@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.8, 1.8.7 Mar 2, 2016
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.8, 1.8.9 Aug 31, 2016
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.9, 1.8.10 Dec 15, 2016
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.10, 1.8.11 Jan 8, 2017
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.11, 1.8.12 Apr 1, 2017
@andrewjs18
Copy link
Contributor

andrewjs18 commented Apr 14, 2017

I had some mail setting issues when switching from php mail to smtp mail. I'm using zoho for email now.

when I set up all of the SMTP settings in the admin cp, I was using the zoho super user username & password. once I tested email generated from my forum, I was seeing this in the system mail logs: The mail server does not understand the MAIL FROM command. Reason: N/A

I'm not sure why I thought of this, but I changed the SMTP username & password so the username was the same as the admin email set up in the site details. in other words, the admin email in site details was me@me.com and the username in the smtp mail settings was me@me.com. only after then did emails start flowing properly.

another problem I ran into is emails from contact.php were not being sent out. there was no error being logged. I made the following patch, at the direction of @devilshakerz, to the contact.php file.

I changed this:
my_mail($contactemail, $subject, $message, $mybb->input['email']);

to this:
my_mail($contactemail, $subject, $message, $mybb->settings['adminemail']);

@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.12, 1.8.13 May 22, 2017
@dvz dvz closed this as completed in #2877 Oct 25, 2017
dvz pushed a commit that referenced this issue Oct 25, 2017
…2877)

* Use the return_email parameter to set sender email

* Fix `my_mail` usage in member.php
@dvz dvz added s:resolved Status: Resolved. Solution implemented or scheduled and removed s:confirmed Status: Confirmed. Retested and found the issue exists labels Oct 25, 2017
Eldenroot pushed a commit to Eldenroot/mybb that referenced this issue May 8, 2018
…ds (mybb#2877)

* Use the return_email parameter to set sender email

* Fix `my_mail` usage in member.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x p:medium Priority: Medium. Issues to be resolved with normal preference s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Projects
None yet