On Sat, 28 Mar 2009 08:20:53 +0800 (SGT)
[email protected] wrote:
> Basically i need to deny incoming connections from non-local clients
> based on whether they have authenticated or not. So if an external
> sending server doesn't authenticate with us, he can't even send to
> local recipient.
>
> with my previous qmail installation i just needed to define
> "REQUIRE_AUTH" in my tcprules file. just how do it do it with
> qpsmtpd?
Load the "check_relay" plugin and a plugin like this (before any other
rcpt checking plugin)
sub hook_rcpt {
my ($self, $qp, $recipient, @args) = @_;
# relay_client is true if a client has authed or set as
# relay client by the "check_relay" plugin.
return (DENY, "Sending host is not local or authed")
unless $self->qp->connection->relay_client;
return DECLINED;
}
Hanno