Add Qpsmtpd::Address::notes() method

Qpsmtpd Connection and Transaction objects support notes() methods which
are conventionally used to pass data between plugins.  This adds the
same functionality to Address objects.  This should make it easier for
plugins to begin supporting message handling based on per-user
configuration directives.

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
This commit is contained in:
Jared Johnson 2009-02-20 07:45:03 -06:00 committed by Ask Bjørn Hansen
parent da0110837b
commit d9cf61175a
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,5 @@
Add notes method to Qpsmtpd::Address objects (Jared Johnson)
Add remove_recipient method to the transaction object (Jared Johnson)
0.80 - February 27, 2009

View File

@ -317,6 +317,21 @@ sub host {
return $self->{_host};
}
=head2 notes($key[,$value])
Get or set a note on the address. This is a piece of data that you wish
to attach to the address and read somewhere else. For example you can
use this to pass data between plugins.
=cut
sub notes {
my ($self,$key) = (shift,shift);
# Check for any additional arguments passed by the caller -- including undef
return $self->{_notes}->{$key} unless @_;
return $self->{_notes}->{$key} = shift;
}
sub _addr_cmp {
require UNIVERSAL;
my ($left, $right, $swap) = @_;