in2code-de / powermail

This is the official repository of the TYPO3 extension powermail! Powermail is a well-known, editor-friendly, powerful and easy mailform extension for TYPO3
https://in2code.de
88 stars 174 forks source link

Better use reply-to instead of from by powermail sending mails #288

Closed kaystrobach closed 6 years ago

kaystrobach commented 6 years ago

given you use a correctly configured mail server it will decline to send mails for other mailservers, to avoid that the powermail plugin should use the default from of TYPO3 and additionally set the reply-to header, so that we can send this kind of email from any mailserver correctly.

Cause of the issue:

https://github.com/einpraegsam/powermail/blob/43ad2a6a172618962919a9057a25eb418d8777b2/Classes/Domain/Service/SendMailService.php#L172

Reply-To Documentation:

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Mail/MailMessage.php#L155

kaystrobach commented 6 years ago

example exception from office 365:

Tue, 12 Jun 2018 12:07:32 +0200 [ALERT] request="b84fcee4d0e9e" component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler": Oops, an error occurred! Code: 20180612120721d0a66142 - {"exception":"exception 'Swift_TransportException' with message 'Expected response code 250 but got code \"550\", with message \"550 5.7.60 SMTP; Client does not have permissions to send as this sender 

via @kfinke

einpraegsam commented 6 years ago

First of all: What kind of powermail version do you use? Reminder: powermail 2.x is not supported any more.

kaystrobach commented 6 years ago

It was a 2.x version ... so lets close it for now

superscotty19 commented 6 years ago

This is still a valid issue! I just upgraded to 6.1.0 on T3 8.7 and when I send from a yahoo account, my yahoo inbox gets slammed with:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

x@y.ca host aspmx.l.google.com [172.217.197.26] SMTP error from remote mail server after end of data: 550-5.7.1 Unauthenticated email from yahoo.com is not accepted due to domain's 550-5.7.1 DMARC policy. Please contact the administrator of yahoo.com domain if 550-5.7.1 this was a legitimate mail. Please visit 550-5.7.1 https://support.google.com/mail/answer/2451690 to learn about the 550 5.7.1 DMARC initiative. 28-v6si11837112qvu.77 - gsmtp

... which means yahoo is confused (shocking!), so we need to use a different "from" and then put my yahoo email in the "reply-to" ...... unless I'm missing something and that option is already available?

An extension is available here: https://docs.typo3.org/typo3cms/extensions/powermail_from_override/Index.html ... but it would be really nice if this was built into the base.

superscotty19 commented 6 years ago

Solution for those who see this (replace name@domain.org with a valid email to send from, ideally not your own if you're the receiver to prevent spoofing): TYPO3 Template -> Constants (also visible in Constants Editor): plugin.tx_powermail.settings.receiver.overwrite.senderEmail = name@domain.org

glucka commented 5 years ago

@einpraegsam is the solution from @superscotty19 is the right one?

rolf-thomas commented 1 year ago

plugin.tx_powermail.settings.receiver.overwrite.senderEmail = name@domain.org

Nope, in my testing the correct typoscript path is:

plugin.tx_powermail.settings.setup.receiver.overwrite.senderName.value = Name
plugin.tx_powermail.settings.setup.receiver.overwrite.senderEmail.value = name@domain.tld