1 |
diff -Nur -x '*.orig' -x '*.rej' qpsmtpd-0.40/plugins/check_badrcptto mezzanine_patched_qpsmtpd-0.40/plugins/check_badrcptto |
2 |
--- qpsmtpd-0.40/plugins/check_badrcptto 2008-01-07 02:55:53.000000000 -0700 |
3 |
+++ mezzanine_patched_qpsmtpd-0.40/plugins/check_badrcptto 2008-01-07 02:53:20.000000000 -0700 |
4 |
@@ -1,20 +1,22 @@ |
5 |
-# this plugin checks the badrcptto config (like badmailfrom for rcpt address) |
6 |
+# this plugin checks the badrcptto config (like badmailfrom for sender) |
7 |
use Qpsmtpd::DSN; |
8 |
|
9 |
sub hook_rcpt { |
10 |
my ($self, $transaction, $recipient, %param) = @_; |
11 |
+ return Qpsmtpd::DSN->no_such_user("recipient address must include local part") |
12 |
+ unless $recipient->user; |
13 |
return (DECLINED) if $self->qp->connection->relay_client; |
14 |
my @badrcptto = $self->qp->config("badrcptto") or return (DECLINED); |
15 |
return (DECLINED) unless $recipient->host && $recipient->user; |
16 |
my $host = lc $recipient->host; |
17 |
- my $from = lc($recipient->user) . '@' . $host; |
18 |
+ my $to = lc($recipient->user) . '@' . $host; |
19 |
for my $bad (@badrcptto) { |
20 |
$bad = lc $bad; |
21 |
$bad =~ s/^\s*(\S+)/$1/; |
22 |
return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here") |
23 |
- if $bad eq $from; |
24 |
+ if $bad eq $to; |
25 |
return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here") |
26 |
- if substr($bad,0,1) eq '@' && $bad eq "\@$host"; |
27 |
+ if $bad eq "\@$host"; |
28 |
} |
29 |
return (DECLINED); |
30 |
} |