my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
next if defined $msg_id and exists $seen_msg_ids{$msg_id};
$seen_msg_ids{$msg_id} = 1 if defined $msg_id;
my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
next if defined $msg_id and exists $seen_msg_ids{$msg_id};
$seen_msg_ids{$msg_id} = 1 if defined $msg_id;