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

CiviMail: Fix reply forwarding for mailers with From: and Return-path: limitations #11952

Closed
wants to merge 1 commit into from

Conversation

mfb
Copy link
Contributor

@mfb mfb commented Apr 6, 2018

Overview

Depending on the email delivery provider in use, a forwarded reply could fail to send.

Before

Currently when CiviCRM forwards a reply to a mailing, it preserves the contact's email address in the From: and Return-path: headers. However, to minimize abuse, large commercial email delivery providers typically only allow From: and Return-path: headers that use a verified address or domain. This means the forwarded reply cannot be sent.

After

This PR instead uses 'do-not-reply@' . CRM_Core_BAO_MailSettings::defaultDomain() as the email address in the From: and Return-path: headers so the forwarded reply can be sent. The name is preserved in the From: header so the recipient can see who actually sent it, and the email address is preserved in the Reply-to: header so it can be replied to.

Technical Details

The error message that can be seen currently if the SMTP server does not accept the sender email address is:

Ignoring exception thrown by nullHandler: 10006, Failed to send data [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP). (code: 554, response: Message rejected: Email address is not verified...

@mfb
Copy link
Contributor Author

mfb commented Apr 20, 2018

Jenkins test this please

@mfb
Copy link
Contributor Author

mfb commented Jun 8, 2018

We've been running this in production for some time and it's working great, on 3 different mail servers, including AWS SES.

@eileenmcnaughton
Copy link
Contributor

@mfb I think there is a bigger picture on this one - in that do-not-reply is already under discussion / consolidation - see #12270

I think we should get that merged first & then use that function for getting do-not-reply. Potentially the 'do-not-reply' would then be editable per site at some point.

Also just mulling how we can start to add testing

@eileenmcnaughton
Copy link
Contributor

@mfb - this is stale - I'm gonna close it so you can re-open when re-based

@mfb
Copy link
Contributor Author

mfb commented Aug 9, 2018

@eileenmcnaughton I've rebased, can you re-open this or should I create a new PR?

@mfb
Copy link
Contributor Author

mfb commented Aug 9, 2018

IIRC there was actually a bug in GitHub where you cannot reopen a PR after it has been rebased.
You actually have to put it back to how it was, then reopen it, then you can rebase it.
Not sure if they ever fixed this...

@eileenmcnaughton
Copy link
Contributor

hmm - I often can re-open - but not now. Re-opening a new one puts it on the front page though....

@mfb
Copy link
Contributor Author

mfb commented Aug 10, 2018

Yeah I think I'd have to revert the rebase. New PR open @ #12641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants