Skip to content

Fixes #19 Fixes #72 duplicate subject header on windows#103

Merged
weierophinney merged 3 commits into
laminas:2.12.xfrom
samsonasik:fix-19
Aug 6, 2020
Merged

Fixes #19 Fixes #72 duplicate subject header on windows#103
weierophinney merged 3 commits into
laminas:2.12.xfrom
samsonasik:fix-19

Conversation

@samsonasik

@samsonasik samsonasik commented Aug 5, 2020

Copy link
Copy Markdown
Member

Signed-off-by: Abdul Malik Ikhsan samsonasik@gmail.com

Q A
Bugfix yes

Description

Re-create zendframework/zend-mail#225 by @arueckauer Fixes #19 #72 . Original issue description reported by @matbech :

Summary

On Windows with PHP 7, when sending an mail message with the Sendmail transport, the subject header is duplicated.

Steps to reproduce

To reproduce the bug the sample from here can be used:
http://framework.zend.com/manual/current/en/modules/zend.mail.introduction.html

The resulting mail headers look something like this:

Subject: Test Subject
Date: Wed, 29 Jul 2015 17:33:17 +0000
From: =?UTF-8?Q?test?= test@test.com
To: test@test.com
Subject: Test Subject

Cause

In the Sendmail transport all headers (including the Subject) and the subject itself are passed to the php mail function:

$result = mail($to, $subject, $message, $headers);

The mail function then appends to the $subject to the $headers. I do not think the php mail function should handle this case because it doesn't know what subject the caller intended to use. However I believe php mail should at least issue a warning (TBD: file enhancement at https://bugs.php.net/).

Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
@samsonasik samsonasik linked an issue Aug 5, 2020 that may be closed by this pull request
Comment thread test/Transport/SendmailTest.php Outdated
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
Comment thread test/Transport/SendmailTest.php Outdated
Comment thread test/Transport/SendmailTest.php Outdated
Comment thread test/Transport/SendmailTest.php Outdated
Comment thread test/Transport/SendmailTest.php Outdated
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
@weierophinney weierophinney added this to the 2.12.2 milestone Aug 6, 2020
@weierophinney weierophinney merged commit 461d35a into laminas:2.12.x Aug 6, 2020
@samsonasik samsonasik deleted the fix-19 branch August 6, 2020 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet