plan skip_all => "$mod missing for nntpd.t" if $@;
}
use_ok 'PublicInbox::V2Writable';
+umask 007;
my $mainrepo = tempdir('pi-v2writable-XXXXXX', TMPDIR => 1, CLEANUP => 1);
my $ibx = {
mainrepo => $mainrepo,
};
is($im->{partitions}, 1, 'one partition when forced');
ok($im->add($mime), 'ordinary message added');
+foreach my $f ("$mainrepo/msgmap.sqlite3",
+ glob("$mainrepo/xap*/*"),
+ glob("$mainrepo/xap*/*/*")) {
+ my @st = stat($f);
+ my ($bn) = (split(m!/!, $f))[-1];
+ is($st[2] & 07777, -f _ ? 0660 : 0770,
+ "default sharedRepository respected for $bn");
+}
+
my $git0;
if ('ensure git configs are correct') {
[ $sec->header_obj->header_raw('Message-Id') ],
'no new Message-Id added');
- my $sane_mid = qr/\A<[\w\-]+\@localhost>\z/;
+ my $sane_mid = qr/\A<[\w\-\.]+\@\w+>\z/;
@warn = ();
$mime->header_set('Message-Id', '<a-mid@b>');
$mime->body_set('different');
@warn = ();
$mime->header_set('Message-Id', '<a-mid@b>');
$mime->body_set('this one needs a random mid');
- my $gen = PublicInbox::Import::digest2mid(content_digest($mime));
+ my $hdr = $mime->header_obj;
+ my $gen = PublicInbox::Import::digest2mid(content_digest($mime), $hdr);
unlike($gen, qr![\+/=]!, 'no URL-unfriendly chars in Message-Id');
my $fake = PublicInbox::MIME->new($mime->as_string);
$fake->header_set('Message-Id', "<$gen>");