Very old version of qpsmtpd, but this should still be more-or-less the same.

I'm trying to substitute a recipient address very early on in processing so that every subsequent plugin sees the new value.

I'm trying this as the very first plugin listed in the config file:

use Qpsmtpd::Address;

sub hook_rcpt {
    my ($self, $transaction, $recipient) = @_;
    my $address = lc($recipient->user) . '@' .
                  lc($recipient->host);
    if ($address eq 'hostmas...@nortelnetworks.com') {
        $self->log(LOGDEBUG, "Attempting to redirect: $address");
        my $newaddr = Qpsmtpd::Address->new('<cle...@nortel.com>');
        $transaction->recipients($newaddr);
    }
    return DECLINED;
}

It triggers, but nothing changes.

Reply via email to