Change transaction->add_recipient to prevent adding undef/empty recipients

Improve Qpsmtpd::Transaction::add_recipient syntax

Update Qpsmtpd::Transaction::add_recipient to use slightly clearer
language, and add 'if $rcpt' to prevent undef recipients from
being added -- in this case, the '@_ and' syntax allowing this set
method to set undef is undesirable, since you shouldn't be adding undef as
a recipient.

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
This commit is contained in:
jaredj 2009-02-25 07:32:43 -06:00 committed by Ask Bjørn Hansen
parent fe4f40b560
commit 22a0da47d8
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,6 @@
Change transaction->add_recipient to skip adding "null" rcpt if passed
Add logging/apache plugin for logging to the apache error log Add logging/apache plugin for logging to the apache error log
Add connection_time plugin Add connection_time plugin

View File

@ -23,8 +23,8 @@ sub start {
} }
sub add_recipient { sub add_recipient {
my $self = shift; my ($self, $rcpt) = @_;
@_ and push @{$self->{_recipients}}, shift; push @{$self->{_recipients}}, $rcpt if $rcpt;
} }
sub remove_recipient { sub remove_recipient {