]> Sergey Matveev's repositories - public-inbox.git/commitdiff
PublicInbox::Inbox.pm: Default unset address to a one element array
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 15 May 2020 21:11:47 +0000 (16:11 -0500)
committerEric Wong <e@yhbt.net>
Fri, 15 May 2020 23:30:12 +0000 (23:30 +0000)
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" <ebiederm@xmission.com>
lib/PublicInbox/Inbox.pm

index 617b692b14ca10688c57ce84c9148a56a1340940..002b980f40574e266dfc68b065e8bd733016eb4d 100644 (file)
@@ -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};