Switch to connection object for relaying info

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@322 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2004-09-20 17:31:26 +00:00
parent c341ff0d0f
commit 4b8b4793b6

View File

@ -110,7 +110,8 @@ sub register {
sub do_verp { sub do_verp {
my ($self, $transaction) = @_; my ($self, $transaction) = @_;
if ($transaction->relaying) { if ($self->qp->connection->relaying) {
$self->log(LOGINFO, "doing outbound verp");
return $self->do_outbound_verp($transaction); return $self->do_outbound_verp($transaction);
} }
@ -120,10 +121,11 @@ sub do_verp {
sub check_verp { sub check_verp {
my ($self, $transaction) = @_; my ($self, $transaction) = @_;
if ($transaction->relaying) { if ($self->qp->connection->relaying) {
return DECLINED; return DECLINED;
} }
$self->log(LOGINFO, "checking inbound verp");
return $self->do_inbound_verp($transaction); return $self->do_inbound_verp($transaction);
} }
@ -160,6 +162,7 @@ sub do_outbound_verp {
my $new_address = join('=', $hash, $timestamp, $sender); my $new_address = join('=', $hash, $timestamp, $sender);
$self->log(LOGDEBUG, "setting sender to $new_address");
$transaction->sender(Qpsmtpd::Address->new($new_address)); $transaction->sender(Qpsmtpd::Address->new($new_address));
return DECLINED; return DECLINED;
@ -176,6 +179,7 @@ sub do_inbound_verp {
return DECLINED unless $self->is_bounce($transaction); return DECLINED unless $self->is_bounce($transaction);
$self->log(LOGDEBUG, "validating bounce recipient: $recip");
#return DENY, "Multiple recipients of bounces not allowed" if $not_allowed; #return DENY, "Multiple recipients of bounces not allowed" if $not_allowed;
my $srs = $self->get_srs(); my $srs = $self->get_srs();
@ -192,6 +196,7 @@ sub do_inbound_verp {
} }
# now set RCPTs to proper address. # now set RCPTs to proper address.
$self->log(LOGDEBUG, "fixing inbound recipient to be $address");
$transaction->recipients(Qpsmtpd::Address->new($address)); $transaction->recipients(Qpsmtpd::Address->new($address));
return DECLINED; return DECLINED;