On Fri, 20 Feb 2009 15:24:42 -0600
David Nicol <davidni...@gmail.com> wrote:

> Okay then.  Anyone for collaborating on setting one up, with a unified
> accessor syntax similar to what we have for "notes" ?
Some (longer) time ago I tried something like Apache::DBI for Qpsmtpd.
I never really tried how it works in a real server:

http://ankh-morp.org/~vetinari/tmp/Qpsmtpd-DBI.pm 

docs missings ;-) ... so:
use Qpsmtpd::DBI;
sub init {
   my $self = shift;
   my $qp = shift;
   # DB settings are read from the "dbi" config file (
   # see the my %args = map {}... on how it looks ;-))
   # any key not /^(user|password|driver|database)$/ is passed to the
   # underlying DBD::*. Note: "database" value must me something like
   # "dbname=NAME" or "database=NAME;host=foo", see DBD::mysql vs.
   # DBD::SQLite/DBD::Pg
   my $dbi = Qpsmtpd::DBI->new($qp); 
   $dbi or die Qpsmtpd::DBI::errstr;
   $self->{_dbi} = $dbi;
   my $dbh = $dbi->connect() or die Qpsmtpd::DBI::errstr;
   # do something with the $dbh
}

sub hook_something {
   my $self = shift;
   # need to call this in any hook, at least for hooks where some
   # forking may have happened before. E.g. a plugin hooking
   # "init/register", "connect", "mail", "rcpt" and "data_post" at
   # least has to call this in "init/register", "connect" and "mail"
   my $dbh = $self->{_dbi}->connect or die Qpsmtpd::DBI::errstr;
}

> http://advenge.com/2009/products/downloads/qpsmtpd/plugins/verp
> 
> is a working plugin that uses DirDB persistence library to rewrite the
> envelope return addresses of all traffic except traffic that is exempt
> due to relaying-okay or the verp_no note getting set.
> 
> a persistent notes -- maybe "pnotes" like notes, but persistent --
> would be more general and could be replaced with a backend as needed.
> As for lasting between two and three weeks, well, what all is needed?

Reply via email to