John Peacock wrote:
I'm going to check in a patch which will cause this to work, instead:

    my $auth_user = $self->auth_user();

as soon as I decide the best way to do that.

OK, I've done this now (to branches/0.31) so that the following does what one might expect (note this is all that is required to implement what Anil was asking for):

#!/usr/bin/perl -w

sub hook_mail {
  my ($self, $transaction, $sender, $header) = @_;

  my $auth_user = $self->auth_user();
  my $auth_mechanism = $self->auth_mechanism();

  if ( $auth_user && $sender ne $auth_user ) {
      return (DENY,
          "DENY : From: $sender :: Auth : $auth_user/$auth_mechanism");
  }
  else {
      return DECLINED;
  }
}

John

p.s. yes, that means that Qpsmtpd::Address objects now overload the comparison operators

Reply via email to