Skip to content

[Mailer][Mime] In some areas header is not treated in a case-insensitive manner #39953

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

Closed
piku235 opened this issue Jan 23, 2021 · 1 comment
Closed

Comments

@piku235
Copy link
Contributor

piku235 commented Jan 23, 2021

Symfony version(s) affected: 5.2

Description
Recently, I've had a problem with a capitalized header when I tried to define a global sender in the framework config. The issue happens in the Headers::addHeader() when trying to resolve a header class from the header class map.

Also, Headers::isUniqueHeader() is affected and header rules in the MessageListener::addHeaderRule().

The feature pull request for reference.

How to reproduce
The following config leads to an exception in Headers::addHeader()

framework:
    mailer:
        headers:
            From: foo@localhost
TypeError(code: 0): Argument 2 passed to Symfony\\Component\\Mime\\Header\\Headers::addTextHeader() must be of the type string, array given

Possible Solution
The fix is simple, we need to ensure that strtolower() is used when doing something specific on a user-supplied header name.

@plandolt
Copy link
Contributor

Unfortunately I can't :(

@fabpot fabpot closed this as completed Feb 2, 2021
fabpot added a commit that referenced this issue Feb 2, 2021
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Fix case-sensitive handling of header names

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39953
| License       | MIT
| Doc PR        | -

Fixes case-sensitive handling of header names in "Mailer" component, more in the [ticket](#39953) and the [root PR](#39954).

Commits
-------

b2d7454 [Mime] Fix case-sensitive handling in Headers::isUniqueHeader()
fabpot added a commit that referenced this issue Feb 2, 2021
… (piku235)

This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[Mailer][Mime] Fix case-sensitive handling of header names

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39953
| License       | MIT
| Doc PR        | -

Fixes case-sensitive handling of header names in "Mime" and "Mailer" component, more in the [ticket](#39953).

Commits
-------

d563c84 [Mailer][Mime] Fix case-sensitive handling of header names
symfony-splitter pushed a commit to symfony/mime that referenced this issue Feb 2, 2021
… (piku235)

This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[Mailer][Mime] Fix case-sensitive handling of header names

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39953
| License       | MIT
| Doc PR        | -

Fixes case-sensitive handling of header names in "Mime" and "Mailer" component, more in the [ticket](symfony/symfony#39953).

Commits
-------

d563c846f6 [Mailer][Mime] Fix case-sensitive handling of header names
symfony-splitter pushed a commit to symfony/mailer that referenced this issue Feb 2, 2021
… (piku235)

This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[Mailer][Mime] Fix case-sensitive handling of header names

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39953
| License       | MIT
| Doc PR        | -

Fixes case-sensitive handling of header names in "Mime" and "Mailer" component, more in the [ticket](symfony/symfony#39953).

Commits
-------

d563c846f6 [Mailer][Mime] Fix case-sensitive handling of header names
symfony-splitter pushed a commit to symfony/mailer that referenced this issue Sep 28, 2021
… (piku235)

This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[Mailer][Mime] Fix case-sensitive handling of header names

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39953
| License       | MIT
| Doc PR        | -

Fixes case-sensitive handling of header names in "Mime" and "Mailer" component, more in the [ticket](symfony/symfony#39953).

Commits
-------

d563c846f6 [Mailer][Mime] Fix case-sensitive handling of header names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants