diff --git a/VERSIONS_HOTLINE/184785 b/VERSIONS_HOTLINE/184785 new file mode 100644 index 0000000000000000000000000000000000000000..56edc3765283b54e94905c1d0c3a333a740edfc5 --- /dev/null +++ b/VERSIONS_HOTLINE/184785 @@ -0,0 +1 @@ + - correctif #184785 : Mails : Ajout de l'entête MIME-Version: 1.0 dans les courriels envoyés par Bokeh pour mieux passer les antispam \ No newline at end of file diff --git a/library/ZendAfi/Mail.php b/library/ZendAfi/Mail.php index 4de2308c9340ec890ac2d7fa445f6eef110674dd..e0d0064d3ad0a8b425b82521515dc14ce9246470 100644 --- a/library/ZendAfi/Mail.php +++ b/library/ZendAfi/Mail.php @@ -22,8 +22,12 @@ class ZendAfi_Mail extends Zend_Mail { use Trait_StormFileSystem; + const MIME_VERSION = 'MIME-Version'; + const MIME_VERSION_1_0 = '1.0'; + public function __construct($charset = 'utf-8') { parent::__construct($charset); + $this->_headers[static::MIME_VERSION]= static::MIME_VERSION_1_0; } diff --git a/tests/scenarios/Payfip/PayfipTemplatesAbonneTest.php b/tests/scenarios/Payfip/PayfipTemplatesAbonneTest.php index 6141e2813aee88695e466a80118624fed8d47939..9f4f802bff60b7e0f5453e6c41bf91ab1131153d 100644 --- a/tests/scenarios/Payfip/PayfipTemplatesAbonneTest.php +++ b/tests/scenarios/Payfip/PayfipTemplatesAbonneTest.php @@ -1311,6 +1311,7 @@ class PayfipTemplatesAbonneDebtsPayDispatchWithPayfipStartErrorTest $this->assertEquals( 'adminbib@annecy.com', $this->_mail_transport->getSentMails()[0] ->getRecipients()[0]); $this->assertContains( 'Payfip: transaction en erreur', str_replace('? =?utf-8?Q?','',quoted_printable_decode($this->_mail_transport->sent_mail->getSubject()))); + $this->assertEquals( '1.0', $this->_mail_transport->sent_mail->getHeaders()['MIME-Version']); $this->assertEquals( 'Une erreur est survenue lors d\'une tentative de paiement vers Payfip<br/>Code de l\'erreur : {"label":"Le format du param\u00e8tre REFDET n\'est pas conforme","code":"R3","severity":"2"}. <br/>Message d\'erreur: Transaction (ref: 20230109_090200, idop: ) restée non synchronisée ()', quoted_printable_decode($this->_mail_transport->getSentMails()[0]->getBodyHtml(true)) );