From 0f1d7c1c387a18c1b928269f8c1158f8872b51ec Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Tue, 21 May 2024 16:23:21 +0200 Subject: [PATCH] extra: neomutt-export-patches: print reason for skipping a mail Signed-off-by: Christoph Heiss --- extra/bin/neomutt-export-patches.pl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/extra/bin/neomutt-export-patches.pl b/extra/bin/neomutt-export-patches.pl index be0f533..6541c14 100644 --- a/extra/bin/neomutt-export-patches.pl +++ b/extra/bin/neomutt-export-patches.pl @@ -99,7 +99,21 @@ sub dump_emails_recursive { foreach (@$mail) { if (ref($_) eq 'HASH') { my $subj = parse_subject($_->{headers}->{Subject}); - next if !$subj || $subj->{is_coverletter} || $subj->{is_reply}; + + if (!$subj) { + print "skipping $_->{id} due to malformed or missing subject: '$_->{headers}->{Subject}'\n"; + next; + } + + if ($subj->{is_coverletter}) { + print "skipping $_->{id} due to being coverletter\n"; + next; + } + + if ($subj->{is_reply}) { + print "skipping $_->{id} due to being a reply\n"; + next; + } print "dumping '$subj->{canonical}' ..\n";