unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/6] lei_input: reject --mail-sync if using HTTP(S) for now
Date: Sun,  2 May 2021 06:05:39 +0000	[thread overview]
Message-ID: <20210502060542.11598-4-e@80x24.org> (raw)
In-Reply-To: <20210502060542.11598-1-e@80x24.org>

I'm not sure how we'll distinguish JMAP vs read-only HTTPS,
yet; but we'll focus on currently-supported stuff, first.
---
 lib/PublicInbox/LeiInput.pm | 2 ++
 t/lei-import-http.t         | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/lib/PublicInbox/LeiInput.pm b/lib/PublicInbox/LeiInput.pm
index 917f682b..85caac35 100644
--- a/lib/PublicInbox/LeiInput.pm
+++ b/lib/PublicInbox/LeiInput.pm
@@ -229,6 +229,8 @@ sub prepare_inputs { # returns undef on error
 				}
 			}
 		} elsif ($input_path =~ m!\Ahttps?://!i) {
+			# TODO: how would we detect r/w JMAP?
+			push @{$sync->{no}}, $input if $sync;
 			prepare_http_input($self, $lei, $input_path) or return;
 		} elsif ($input_path =~ s/\A([a-z0-9]+)://is) {
 			my $ifmt = lc $1;
diff --git a/t/lei-import-http.t b/t/lei-import-http.t
index 35cbf369..6cb8a753 100644
--- a/t/lei-import-http.t
+++ b/t/lei-import-http.t
@@ -39,5 +39,10 @@ test_lei({ tmpdir => $tmpdir }, sub {
 	$res = json_utf8->decode($lei_out);
 	is($res->[0]->{'m'}, '20180720072141.GA15957@example',
 			'imported search result') or diag explain($res);
+
+	ok(!lei(qw(import --mail-sync), "$url/x\@example.com/raw"),
+		'--mail-sync fails on HTTP');
+	diag $lei_err;
+
 });
 done_testing;

  parent reply	other threads:[~2021-05-02  6:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02  6:05 [PATCH 0/6] lei: more steps towards kw sync Eric Wong
2021-05-02  6:05 ` [PATCH 1/6] lei <q|up>: combine written/results into one line Eric Wong
2021-05-02  6:05 ` [PATCH 2/6] lei_input: common net_merge_all_done for lei <import|tag> Eric Wong
2021-05-02  6:05 ` Eric Wong [this message]
2021-05-02  6:05 ` [PATCH 4/6] lei: simplify workers_start API Eric Wong
2021-05-02  6:05 ` [PATCH 5/6] net_writer: use "FLAGS.SILENT" to set keywords Eric Wong
2021-05-02  6:05 ` [PATCH 6/6] lei <q|up>: writes to Maildirs and IMAP use mail-sync Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210502060542.11598-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).