Fix SMTPUTF8 test to actually test non-ASCII email addresses#40
Open
Fix SMTPUTF8 test to actually test non-ASCII email addresses#40
Conversation
The previous test claimed to test SMTPUTF8 (RFC 6531) support but only used ASCII email addresses and UTF-8 in the message body. This doesn't test what SMTPUTF8 is designed for: supporting non-ASCII characters in email addresses themselves. Changes: - Use non-ASCII email addresses: expéditeur@société.fr and destinataire@例え.jp - Switch from manual message construction to EmailMessage with modern policy - Use send_message() which automatically enables SMTPUTF8 when needed - Verify UTF-8 addresses are preserved in X-MailFrom and X-RcptTo headers - Add proper MIME header decoding for verification This addresses the valid concern raised in issue #5 about properly testing SMTPUTF8 functionality.
3bf5c74 to
24c633d
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
test_smtputf8_supporttest to actually test SMTPUTF8 (RFC 6531) functionality by using non-ASCII characters in email addresses, not just in message bodies.Background
As pointed out in issue #5, the previous test claimed to test SMTPUTF8 support but only used ASCII email addresses (
user@example.com,recipient@example.com) and UTF-8 characters in the message body. This doesn't test what SMTPUTF8 is designed for.SMTPUTF8 (RFC 6531) allows non-ASCII characters in email addresses themselves, such as:
prénom@société.fr(French accented characters)usuario@例え.jp(Japanese characters)Changes
expéditeur@société.franddestinataire@例え.jpEmailMessagewhich uses modern email policy and properly handles SMTPUTF8send_message()which automatically enables SMTPUTF8 when non-ASCII addresses are detectedX-MailFromandX-RcptToheaders added by dsmtpd, which contain the actual SMTP envelope addressesTest Results
All tests pass:
The test now properly verifies that:
Related
Addresses feedback on issue #5