diff --git a/Changes b/Changes index a9a3659..f4aadff 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + Add remove_recipient method to the transaction object (Jared Johnson) + 0.80 - February 27, 2009 moved development to git repository! diff --git a/lib/Qpsmtpd/Transaction.pm b/lib/Qpsmtpd/Transaction.pm index c8ed194..840e0e4 100644 --- a/lib/Qpsmtpd/Transaction.pm +++ b/lib/Qpsmtpd/Transaction.pm @@ -27,6 +27,12 @@ sub add_recipient { @_ and push @{$self->{_recipients}}, shift; } +sub remove_recipient { + my ($self,$rcpt) = @_; + $self->{_recipients} = [grep {$_->address ne $rcpt->address} + @{$self->{_recipients} || []}] if $rcpt; +} + sub recipients { my $self = shift; @_ and $self->{_recipients} = [@_]; @@ -273,6 +279,13 @@ This adds a new recipient (as in RCPT TO) to the envelope of the mail. The C<$recipient> is a C object. See L for more details. +=head2 remove_recipient($recipient) + +This removes a recipient (as in RCPT TO) from the envelope of the mail. + +The C<$recipient> is a C object. See L +for more details. + =head2 recipients( ) This returns a list of the current recipients in the envelope.