Skip to content

Fix incorrect handling for some c= flag cases and sort out issues with simple algorithm due to content modification#21

Open
DerDreschner wants to merge 3 commits intoPHPMailer:mainfrom
DerDreschner:fix/fix-incorrect-canonical-handling
Open

Fix incorrect handling for some c= flag cases and sort out issues with simple algorithm due to content modification#21
DerDreschner wants to merge 3 commits intoPHPMailer:mainfrom
DerDreschner:fix/fix-incorrect-canonical-handling

Conversation

@DerDreschner
Copy link
Copy Markdown

@DerDreschner DerDreschner commented Jan 13, 2026

The current implementation for the c= processing doesn't follow the RFC for the following reasons:

  • c= is required for correct processing. This is different than in the RFC, where it is marked as optional. In this case, the default c=simple/simple must be used.
  • c= must contain an explicit rule for both header and body. This doesn't match the allowed values described in the RFC, where it is possible to only set the header rule. In this case, the body is automatically being canonized with the simple algorithm.
  • Messages using c=simple{/*} are marked as invalid, although they are correct. The reason is a bug in the code where the header content is being modified unintentionally, which results in a hash mismatch.

To cover the different use-cases with the c= flag, I've added some unit tests here as well as a development container as it makes my life a lot easier here.

Fixes #10
Fixes #11
Fixes #14
Fixes #15
Closes #17

...as well as some issues on our repository (e.g., nextcloud/mail#12206).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant