Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mail-Audit CPAN distribution.

Report information
The Basics
Id: 4126
Status: resolved
Priority: 0/
Queue: Mail-Audit

People
Owner: rjbs [...] cpan.org
Requestors: perreal [...] lyon.cemagref.fr
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Ambiguous Mail::Audit::Killdups::killdups
(Operating environment: Mail-Audit-2.1 with stock Perl 5.8.0 on RHL8.) I experienced a strong behavior when the message-id ring file is not readable and with the following code : use Mail::Audit qw(KillDups); $Mail::Audit::KillDups::dupfile = "/some/unreadable/file"; my $mail = Mail::Audit->new(noexit => 1); if($mail->killdups) { # do some other logging exit 1; } Looking into Mail/Audit/Killdups.pm, I see that it should return 0 when the message IS NOT a duplicate, 1 when an error occured and it should call Mail::Audit->ignore is the mail is a duplicate. That's looks fine, but... 1) I didn't know it should returns 1 on error, 2) If noexit is set, Mail::Audit->ignore will return, and what happens when it does: killdups() returns 1, as an error: [from Mail/Audit/KillDups.pm:] if ($_ eq $mid) { _log(1, "Duplicate, ignoring"); $self->ignore; return 1; # Just in case. } So I beg for letting killdups() return 1 ONLY on duplicate and either die or returns 0 on error...
Show quoted text
> So I beg for letting killdups() return 1 ONLY on duplicate and either > die or returns 0 on error...
Yes, the current behavior certainly is silly. I'll fix it soon, asI work my way through Mail::Audit. -- rjbs
Semantics fixed and documented in Subversion. -- rjbs