From 2f720902ed702b64d918165ba21a96dabbeeca26 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 19 May 2021 08:54:13 +0000 Subject: lei: relax rules for "new" in Maildir mbsync and offlineimap both use ":2," suffixes for filenames in "new/", however my interpretation of the Maildir spec at is that ":2," is only for files in "cur/". My interpretation also matches that of doveecot, but we'll allow what mbsync and offlineimap do given their popularity. --- t/lei-index.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/lei-index.t b/t/lei-index.t index 3382d42b..b7dafb71 100644 --- a/t/lei-index.t +++ b/t/lei-index.t @@ -27,6 +27,11 @@ my $expect = do { local $/; <$fh>; }; + +# mbsync and offlineimap both put ":2," in "new/" files: +symlink(File::Spec->rel2abs('t/utf8.eml'), "$tmpdir/md/new/u:2,") or + xbail "symlink $!"; + test_lei({ tmpdir => $tmpdir }, sub { my $store_path = "$ENV{HOME}/.local/share/lei/store/"; @@ -40,13 +45,16 @@ test_lei({ tmpdir => $tmpdir }, sub { lei_ok(qw(q mid:qp@example.com -f text)); like($lei_out, qr/^hi = bye/sm, 'lei2mail fallback'); + lei_ok(qw(q mid:testmessage@example.com -f text)); + lei_ok(qw(-C / blob --mail 9bf1002c49eb075df47247b74d69bcd555e23422)); + my $all_obj = ['git', "--git-dir=$store_path/ALL.git", qw(cat-file --batch-check --batch-all-objects)]; is_deeply([xqx($all_obj)], [], 'no git objects'); lei_ok('import', 't/plack-qp.eml'); ok(grep(/\A$blob blob /, my @objs = xqx($all_obj)), 'imported blob'); - lei_ok(qw(q z:0.. --dedupe=none)); + lei_ok(qw(q m:qp@example.com --dedupe=none)); my $res_b = json_utf8->decode($lei_out); is_deeply($res_b, $res_a, 'no extra DB entries'); -- cgit v1.2.3-24-ge0c7