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

Laminas\Mail\Storage\Message fails with non utf8 characters #234

Open
arunvarghe opened this issue Apr 28, 2023 · 0 comments
Open

Laminas\Mail\Storage\Message fails with non utf8 characters #234

arunvarghe opened this issue Apr 28, 2023 · 0 comments
Labels
Bug Something isn't working

Comments

@arunvarghe
Copy link

Bug Report

When I try to run the below code
new Laminas\Mail\Storage\Message(['file' => DIR . '/../fixtures/emails/email_with_non_utf8_subject.eml'])

The file has subject with non-utf8 characters
For example:
Subject: This is AUTOABUSE. PLEASE STOP 178.162.214.194 spam defiling your email system or hosting. THANKU for compliance: ������� �������������� - �� 750 ���.

It gives the following exception back!!
Laminas\Mail\Header\Exception\InvalidArgumentException: Invalid header value detected

Summary

Current behavior

The file has subject with non-utf8 characters
For example:
Subject: This is AUTOABUSE. PLEASE STOP 178.162.214.194 spam defiling your mail system or hosting. THANKU for compliance: ������� �������������� - �� 750 ���.

It gives the following exception back!!
Laminas\Mail\Header\Exception\InvalidArgumentException: Invalid header value detected

How to reproduce

Try this
new Laminas\Mail\Storage\Message(['file' => DIR . '/../fixtures/emails/email_with_non_utf8_subject.eml'])''

and File should have the following content
Subject: This is AUTOABUSE. PLEASE STOP 178.162.214.194 spam defiling your mail system or hosting. THANKU for compliance: ������� �������������� - �� 750 ���.

Expected behavior

It fails with the latest version. I was able to create a message object earlier. I get InvalidArgumentException now. I should be able to create a message object with non-utf8 characters without any error.

@arunvarghe arunvarghe added the Bug Something isn't working label Apr 28, 2023
@arunvarghe arunvarghe changed the title Laminas\Mail\Storage\Message fails with non utf8 charactes Laminas\Mail\Storage\Message fails with non utf8 characters Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant