Hi all,

Thanks for the previous responses and the excellent documentation -- I've been really really happy with the way plugin writing works in QP thus far. I've written about 55 lines targeted to do all the somewhat complex database logging that our application needs to do -- our previous non-qp code uses at least a couple of hundred lines to do a third as much logging. I have run into a couple of hiccups though.

I've got a sub called from both hook_deny and hook_queue_post meant to write the results of a transaction to our db (via our DBIx::Class magic):

my ($self,$transaction,$prev_hook,$return,$return_text) = @_;
my $rs = DC::DB->new->resultset('Messages');
for my $recip ($transaction->recipients) {
   $rs->new({
       tid       => $self->qp->connection->notes('tid'),
       cid       => $self->qp->connection->notes('cid'),
       rtuser    => $recip->user,
       rtdomain  => $recip->host,
       resp_code => $return ? $return : 250,
       descr     => $return_text,
   })->insert;
}

tid and cid are the autoincremented id's of the previous couple of db entries in hook_mail and hook_data_post

This works great for queued mail but has one obvious problem: when a hook_rcpt plugin like check_badrecipients blocks a recipient, $transaction->recipients winds up having only the senders that were *not* denied in it. Is there some way for me to get ahold of the recipient that was denied, other than modifying check_rcptto etc. to pass this information in a note() or similar?

There is also a less obvious problem: $return turns out to be 901, even though the return code issued to the smtp client by qpsmtpd is 550, and that is the code we want to log. Is this the appropriate behavior?

Thanks again for this great product. The application I inherited that essentially does the same thing as qpsmtpd, is 3000+ lines long and horrible to work with. QP is an absolute delight.

-Jared Johnson
Software Developer and Support Engineer
Network Management Group, Inc.
620-664-6000 x118

--
Inbound and outbound email scanned for spam and viruses by the
DoubleCheck Email Manager: http://www.doublecheckemail.com/

Reply via email to