about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/Config.pm4
-rw-r--r--lib/PublicInbox/Inbox.pm3
-rw-r--r--t/feed.t1
-rw-r--r--t/html_index.t1
4 files changed, 4 insertions, 5 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 43ffba77..ea84da35 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -129,10 +129,8 @@ sub _fill {
         my $name = $pfx;
         $name =~ s/\Apublicinbox\.//;
         $rv->{name} = $name;
-        my $v = $rv->{address} ||= 'public-inbox@example.com';
-        my $p = $rv->{-primary_address} = ref($v) eq 'ARRAY' ? $v->[0] : $v;
-        $rv->{domain} = ($p =~ /\@(\S+)\z/) ? $1 : 'localhost';
         $rv = PublicInbox::Inbox->new($rv);
+        my $v = $rv->{address};
         if (ref($v) eq 'ARRAY') {
                 $self->{-by_addr}->{lc($_)} = $rv foreach @$v;
         } else {
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index faab03ce..3f1b7334 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -11,6 +11,9 @@ use PublicInbox::MID qw(mid2path);
 
 sub new {
         my ($class, $opts) = @_;
+        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';
         bless $opts, $class;
 }
 
diff --git a/t/feed.t b/t/feed.t
index 5dd869aa..19a9ba09 100644
--- a/t/feed.t
+++ b/t/feed.t
@@ -43,7 +43,6 @@ my $tmpdir = tempdir('pi-feed-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/gittest";
 my $ibx = PublicInbox::Inbox->new({
         address => 'test@example',
-        -primary_address => 'test@example',
         name => 'testbox',
         mainrepo => $git_dir,
         url => 'http://example.com/test',
diff --git a/t/html_index.t b/t/html_index.t
index 32d7b8de..100d21a8 100644
--- a/t/html_index.t
+++ b/t/html_index.t
@@ -13,7 +13,6 @@ my $tmpdir = tempdir('pi-http-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/gittest";
 my $ibx = PublicInbox::Inbox->new({
         address => 'test@example',
-        -primary_address => 'test@example',
         name => 'tester',
         mainrepo => $git_dir,
         url => 'http://example.com/test',