From: Eric W. Biederman Date: Fri, 15 May 2020 21:11:47 +0000 (-0500) Subject: PublicInbox::Inbox.pm: Default unset address to a one element array X-Git-Tag: v1.6.0~503 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=0a556c99c0db5160f43931422a563c6094b64ea2;p=public-inbox.git PublicInbox::Inbox.pm: Default unset address to a one element array PublicInbox::Config.pm::_fill() assumes that address is an array. Therefore when handling an unset address use an array containing a single string, instead of a single string. Signed-off-by: "Eric W. Biederman" --- diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 617b692b..002b980f 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -102,7 +102,7 @@ sub _set_limiter ($$$) { sub new { my ($class, $opts) = @_; - my $v = $opts->{address} ||= 'public-inbox@example.com'; + my $v = $opts->{address} ||= [ 'public-inbox@example.com' ]; my $p = $opts->{-primary_address} = ref($v) eq 'ARRAY' ? $v->[0] : $v; $opts->{domain} = ($p =~ /\@(\S+)\z/) ? $1 : 'localhost'; my $pi_config = delete $opts->{-pi_config};