On Thu, 18 Dec 2008 17:01:21 -0800 (PST) Michael Papet <mpa...@yahoo.com> wrote: > I'm attempting an LDAP whitelist. I cannot seem to get the sender's full > address. The code that follows should have $from_whitelist = > (uid=t...@yahoo.com) after $fromhost_whitelist is declared. [...] > my ($self, $transaction, $sender) = @_; > my $fromhost = lc($sender->host); > my $from_whitelist = "(uid=".lc($sender->user) . '@' . $fromhost . ")"; > > $self->log(LOGINFO, "whitelist_ldap search string $from_whitelist"); > > When run, the following appears in the qpsmtpd.log. It should have > uid=t...@yahoo.com inside the parens. > > Thu Dec 18 16:39:07 2008 sip[11898]: whitelist_ldap search string > (uid=t...@friendwich.net) > > What did I do wrong? Maybe it's not called in the right hook: if called from hook_rcpt, this will print the recipient's address, not sender's address. To get the sender address in a hook_rcpt use my ($self, $transaction, $rcpt) = @_; my $sender = $transaction->sender; ... # continue as above
Hanno