Skip to content
Snippets Groups Projects
Commit ddab597c authored by Stephan Bosch's avatar Stephan Bosch
Browse files

tests: address test: Add tests for invalid addresses with UTF-8 in the localpart.

parent cdb1a656
No related branches found
No related tags found
No related merge requests found
...@@ -310,6 +310,7 @@ To: @example.org ...@@ -310,6 +310,7 @@ To: @example.org
Cc: nonsense Cc: nonsense
Resent-To: Resent-To:
Bcc: nico@frop.example.com, @example.org Bcc: nico@frop.example.com, @example.org
Resent-Cc:<jürgen@example.com>
Subject: Invalid addresses Subject: Invalid addresses
Test. Test.
...@@ -321,10 +322,18 @@ test "Invalid addresses" { ...@@ -321,10 +322,18 @@ test "Invalid addresses" {
test_fail ":localpart matched invalid address"; test_fail ":localpart matched invalid address";
} }
if address :localpart "resent-cc" "jürgen" {
test_fail ":localpart matched invalid UTF-8 address";
}
if address :domain "to" "example.org" { if address :domain "to" "example.org" {
test_fail ":domain matched invalid address"; test_fail ":domain matched invalid address";
} }
if address :domain "resent-cc" "example.com" {
test_fail ":domain matched invalid UTF-8 address";
}
if not address :is :all "resent-to" "" { if not address :is :all "resent-to" "" {
test_fail ":all failed to match empty address"; test_fail ":all failed to match empty address";
} }
...@@ -333,6 +342,10 @@ test "Invalid addresses" { ...@@ -333,6 +342,10 @@ test "Invalid addresses" {
test_fail ":all failed to match invalid address"; test_fail ":all failed to match invalid address";
} }
if not address :is :all "resent-cc" "<jürgen@example.com>" {
test_fail ":all failed to match invalid UTF-8 address";
}
if address :is :localpart "bcc" "" { if address :is :localpart "bcc" "" {
test_fail ":localpart matched invalid address"; test_fail ":localpart matched invalid address";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.