#!/usr/bin/perl -w
# Copyright (C) 2013-2015 all contributors <meta@public-inbox.org>
# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+#
+# Mail delivery agent for public-inbox, run from your MTA upon mail delivery
use strict;
use warnings;
my $usage = 'public-inbox-mda < rfc2822_message';
PublicInbox::MDA->author_info($msg);
END {
- search_index_sync($main_repo) if ($? == 0);
+ index_sync($main_repo) if ($? == 0);
};
local $ENV{GIT_AUTHOR_NAME} = $name;
return ($@ || $? || !defined($$out) || $$out eq '') ? 0 : 1;
}
-sub search_index_sync {
+sub index_sync {
my ($git_dir) = @_;
+
+ # potentially user-visible, ignore errors:
+ system('git', "--git-dir=$git_dir", 'update-server-info');
+
eval {
require PublicInbox::SearchIdx;
PublicInbox::SearchIdx->new($git_dir, 2)->index_sync;