qpsmtpd/t/plugin_tests/sender_permitted_from

33 lines
672 B
Plaintext
Raw Normal View History

#!perl -w
use strict;
use warnings;
use Qpsmtpd::Constants;
my $r;
sub register_tests {
my $self = shift;
eval 'use Mail::SPF';
return if $@;
$self->register_test('test_is_special_recipient', 5);
}
sub test_is_special_recipient {
my $self = shift;
my $transaction = $self->qp->transaction;
my $address = Qpsmtpd::Address->new('user@example.com');
2012-06-23 06:53:46 +02:00
ok( ! $self->is_special_recipient( $address ), "not special");
foreach my $user ( qw/ postmaster abuse mailer-daemon root / ) {
$address = Qpsmtpd::Address->new("$user\@example.com");
2012-06-23 06:53:46 +02:00
ok( $self->is_special_recipient( $address ), "special: $user");
};
};