aboutsummaryrefslogtreecommitdiff
path: root/t/tests/sietima/role/nospoof.t
blob: b0ec622dd7bde9cb9b917177a978a6a50e4b0cf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;