Mail::A...KillDups(3)
π Mail::Audit::KillDups β the manual, but make it make sense π
okay bestie, gather round, because this is the Mail::Audit plugin for duplicate suppression and it is lowkey iconic. it's a Perl thing (iykyk), it lives in the Mail::Audit ecosystem, and its whole personality is: "bestie we have already SEEN this email." β¨
β¨ NAME β¨
Mail::Audit::KillDups β a Mail::Audit plugin that does duplicate suppression. that's it, that's the job, and it does it beautifully. π
πΈ VERSION πΈ
this is version 2.228. periodt.
π¦ SYNOPSIS π¦
here's the vibe, copy-paste ready:
use Mail::Audit qw(KillDups);
$Mail::Audit::KillDups::dupfile = "/home/simon/.msgid-cache";
my $mail = Mail::Audit->new;
$mail->killdups;
like. look at her. so clean. π
π DESCRIPTION π
so this is a Mail::Audit plugin, and what it gives you is a method for checking and suppressing duplicate messages β meaning mails with message-ids that have been previously seen. if we've met this message-id before? it's giving dΓ©jΓ vu, and it's getting ignored. no cap. π
π§ METHODS π§
killdups
this is the main character method. here's the tea:
- it checks the incoming message against a file of previously seen message ids ποΈ
- if it's already been seen, it ignores it π
- if it hasn't been seen, it adds it π
and where does that file live? that's $Mail::Audit::KillDups::dupfile β that variable holds the name of the file used. if you don't set it, it defaults to .msgid-cache in the current directory. (which is, probably, your home directory.) π
now here's the part where it gets spicy. the data in $Mail::Audit::KillDups::dupfile is treated as a ring buffer β the end of that buffer is delimited by two newline characters. when the file size goes over $Mail::Audit::KillDups::cache_bytes bytes, the message id gets written at the beginning of the file, and the old message ids in the file get overwritten. gone. evicted. rip to them. π«‘
the default cache size is 10000 bytes, which is enough space for about 200 message-ids. so it's cozy, but it's enough. π
ngl, the semantics here are described as tortured. that's the original's word, not mine. the return values are as follows, and you will want to read them twice:
false - not a duplicate
+1 - an error occured during dupcheck
-1 - message is a duplicate
so yeah. false means not a dup, +1 means something went wrong during the dupcheck, and -1 means it IS a duplicate. honestly? iconic behavior. β
π AUTHORS π
- Simon Cozens π«Ά
- Meng Weng Wong π«Ά
- Ricardo SIGNES π«Ά
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2000 by Simon Cozens. π
it's free software β you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. πΈ
and that's the whole page, bestie!! π¦β¨ this was Mail::A...KillDups(3) from perl v5.42.0, dated 2025-07-25, brought to you by the User Contributed Perl Documentation. mwah, love u, go suppress some duplicates responsibly π
ππ
π¦ where this page comes from
- fedora 43: perl-Mail-Audit 2.228-6.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms