From ad10192d9e0119f7ba8f3a7e69c7560edb6ea08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Mon, 20 Jan 2003 11:03:15 +0000 Subject: [PATCH] allow relaying to config('me') receive mail to and (both by Rasjid Wilcox) git-svn-id: https://svn.perl.org/qpsmtpd/trunk@112 958fd67b-6ff1-0310-b445-bb7760255be9 --- plugins/check_relay | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/check_relay b/plugins/check_relay index 6474ea3..e5136d9 100644 --- a/plugins/check_relay +++ b/plugins/check_relay @@ -12,7 +12,16 @@ sub register { sub check_relay { my ($self, $transaction, $recipient) = @_; my $host = lc $recipient->host; - my @rcpt_hosts = $self->qp->config("rcpthosts"); + + my @rcpt_hosts = ($self->qp->config("me"), $self->qp->config("rcpthosts")); + + # Allow 'no @' addresses for 'postmaster' and 'abuse' + # qmail-smtpd will do this for all users without a domain, but we'll + # be a bit more picky. Maybe that's a bad idea. + my $user = $recipient->user; + $host = $self->qp->config("me") + if ($host eq "" && (lc $user eq "postmaster" || lc $user eq "abuse")); + return (OK) if exists $ENV{RELAYCLIENT}; for my $allowed (@rcpt_hosts) { $allowed =~ s/^\s*(\S+)/$1/;