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";