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

Sort the MIME Headers in outgoing emails #2234

Closed
bschmalhofer opened this issue Mar 17, 2023 · 2 comments
Closed

Sort the MIME Headers in outgoing emails #2234

bschmalhofer opened this issue Mar 17, 2023 · 2 comments
Labels
tidying Tidying of the code
Milestone

Comments

@bschmalhofer
Copy link
Contributor

When debugging a problem with mails sent by OTOBO I noticed that the headers that were generated by OTOBO itself are in a random order. This isn't an actual problem, but it would be easier for debugging when there were a fixed order.
But maybe this is by design, so that there are no effects that rely on a fixed order.

test_16:15.txt
test_17:15.txt

@bschmalhofer bschmalhofer added the tidying Tidying of the code label Mar 17, 2023
@bschmalhofer bschmalhofer added this to the OTOBO 11.0 milestone Mar 17, 2023
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Mar 17, 2023

This should not break anything. MIME::Entity::build() already has a preferred order of the standard headers. Only the X- headers, and maybe some other known headers, are sorted in the order they were passed in.

See

otobo/Kernel/System/Email.pm

Lines 1141 to 1145 in 748769d

# build MIME::Entity, Data should be bytes, not utf-8
# see http://bugs.otrs.org/show_bug.cgi?id=9832
$EncodeObject->EncodeOutput( \$Param{Body} );
my $Entity = MIME::Entity->build( %Header, Data => $Param{Body} );
.

bschmalhofer added a commit that referenced this issue Mar 18, 2023
Improve code comments.
Use 'unshift'.
bschmalhofer added a commit that referenced this issue Mar 18, 2023
when the header Encoding is determined.
bschmalhofer added a commit that referenced this issue Mar 18, 2023
bschmalhofer added a commit that referenced this issue Mar 18, 2023
@bschmalhofer
Copy link
Contributor Author

Inspected a couple of mails and the orders of headers was reproducible. Looks good. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidying Tidying of the code
Projects
None yet
Development

No branches or pull requests

1 participant