cvs commit: qpsmtpd README.plugins
[email protected] (Robert Spier)
| Newsgroups | perl.cvs.qpsmtpd |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 04/09/03 20:16:10
Modified: lib Qpsmtpd.pm
. README.plugins
Log:
new plugin output tracking
Revision Changes Path
1.39 +10 -0 qpsmtpd/lib/Qpsmtpd.pm
Index: Qpsmtpd.pm
===================================================================
RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -w -r1.38 -r1.39
--- Qpsmtpd.pm 4 Sep 2004 00:57:16 -0000 1.38
+++ Qpsmtpd.pm 4 Sep 2004 03:16:10 -0000 1.39
@@ -232,6 +232,16 @@
."running the $hook hook returned undef!")
and next;
+ if ($self->transaction) {
+ my $tnotes = $self->transaction->notes( $code->{name} );
+ $tnotes->{"hook_$hook"}->{'return'} = $r[0]
+ if (!defined $tnotes || ref $tnotes eq "HASH");
+ } else {
+ my $cnotes = $self->connection->notes( $code->{name} );
+ $cnotes->{"hook_$hook"}->{'return'} = $r[0]
+ if (!defined $cnotes || $cnotes eq "HASH");
+ }
+
# should we have a hook for "OK" too?
if ($r[0] == DENY or $r[0] == DENYSOFT) {
$r[1] = "" if not defined $r[1];
1.8 +11 -0 qpsmtpd/README.plugins
Index: README.plugins
===================================================================
RCS file: /cvs/public/qpsmtpd/README.plugins,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -r1.7 -r1.8
--- README.plugins 3 Dec 2003 08:12:28 -0000 1.7
+++ README.plugins 4 Sep 2004 03:16:10 -0000 1.8
@@ -159,3 +159,14 @@
Returning DONE or OK will stop the next deny hook from being run.
DECLINED will make qpsmtpd run the remaining configured deny hooks.
+=head1 Return Values and Notes
+
+Insert stuff here about how:
+
+ - if we're in a transaction, the results of a callback are stored
+in
+ $self->transaction->notes( $code->{name})->{"hook_$hook"}->{return}
+
+ - if we're in a connection, store things in the connection notes instead.
+
+