diff options
Diffstat (limited to 't/tests/sietima/role/nospoof.t')
-rw-r--r-- | t/tests/sietima/role/nospoof.t | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/t/tests/sietima/role/nospoof.t b/t/tests/sietima/role/nospoof.t new file mode 100644 index 0000000..b0ec622 --- /dev/null +++ b/t/tests/sietima/role/nospoof.t @@ -0,0 +1,41 @@ +#!perl +use lib 't/lib'; +use Test::Sietima; + +my $s = make_sietima( + with_traits => ['NoSpoof'], + subscribers => [ + 'one@users.example.com', + 'two@users.example.com', + ], +); + +my $return_path = $s->return_path; +my $return_path_address = $return_path->address; +my $return_path_host = $return_path->host; + +test_sending( + sietima => $s, + mail => { + from => 'a user <one@users.example.com>', + }, + mails => [ + object { + call [ header_str => 'from' ] => qq{"a user" <$return_path_address>}; + }, + ], +); + +test_sending( + sietima => $s, + mail => { + from => qq{a user <one\@$return_path_host>}, + }, + mails => [ + object { + call [ header_str => 'from' ] => qq{"a user" <one\@$return_path_host>}; + }, + ], +); + +done_testing; |