don't worry about trailing whitespace in reason
This commit is contained in:
parent
c8b8e724bc
commit
d6154ab945
@ -24,6 +24,8 @@ stage, so store it until later.
|
||||
|
||||
=cut
|
||||
|
||||
# TODO: add the ability to provide a custom default rejection reason
|
||||
|
||||
sub hook_mail {
|
||||
my ($self, $transaction, $sender, %param) = @_;
|
||||
|
||||
@ -37,7 +39,7 @@ sub hook_mail {
|
||||
my $from = lc($sender->user) . '@' . $host;
|
||||
|
||||
for my $config (@badmailfrom) {
|
||||
my ($bad, $reason) = $config =~ /^\s*(\S+)(?:\s*(.*)\s*)?$/;
|
||||
my ($bad, $reason) = $config =~ /^\s*(\S+)(?:\s*(.*))?$/;
|
||||
$reason = "sorry, your envelope sender is in my badmailfrom list" unless $reason;
|
||||
next unless $bad;
|
||||
$bad = lc $bad;
|
||||
|
Loading…
Reference in New Issue
Block a user