On Tuesday, Aug 26, 2003, at 08:32 America/Los_Angeles, Ashish Pawaskar wrote:


Can anyone give any pointers as to how i can have the check_relay
plugin check the mysql table? I can't figure out where I can find the
IP address of the sender.

Make a new plugin, not entirely unlike the following and put it in your configuration to run before check_relay.


sub register {
  my ($self) = shift;
  $self->register_hook("rcpt", "check_pop_table");
}

sub check_pop_table {
  my ($self) = shift;

my $dbh = DBI->connect(...);
my ($allowed) = $dbh->selectrow_array(q[select foo from table where ip = ?],
{}, $self->qp->connection->remote_ip);


return OK if $allowed;

  return DECLINE;
}


(I wrote this in Mail.app, so apologies if it doesn't indent or syntax check properly).



- ask


--
http://www.askbjoernhansen.com/



Reply via email to