Skip Menu |
 

This queue is for tickets about the Net-IMAP-Simple CPAN distribution.

Report information
The Basics
Id: 34941
Status: resolved
Priority: 0/
Queue: Net-IMAP-Simple

People
Owner: jettero [...] cpan.org
Requestors: jik [...] kamens.brookline.ma.us
Cc:
AdminCc:

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

Attachments


Subject: Should support "deleted" method
Download (untitled) / with headers
text/plain 159b
Net::IMAP::Simple should support a "deleted" method, like the "seen" method, so that deleted messages can be ignored. Attached patch adds this functionality.
Subject: Net-IMAP-Simple-1.17-deleted.patch
--- lib/Net/IMAP/Simple.pm~ 2008-04-13 10:14:32.000000000 -0400 +++ lib/Net/IMAP/Simple.pm 2008-04-13 10:15:43.000000000 -0400 @@ -360,7 +360,8 @@ A message number is the only required parameter for this method. The message's C<\Seen> flag will be examined and if the message has been seen a true -value is returned. All other failures return a false value and the errstr() error handler is set with the error message. +value is returned. All other failures return a false value and the errstr() +error handler is set with the error message. =cut @@ -375,6 +376,28 @@ ); } +=item deleted + + print "Deleted!" if $imap->deleted( $message_number ); + +A message number is the only required parameter for this method. The message's +C<\Deleted> flag will be examined and if the message has been deleted a true +value is returned. All other failures return a false value and the errstr() +error handler is set with the error message. + +=cut + +sub deleted { + my ( $self, $number ) = @_; + + my $lines = ''; + $self->_process_cmd( + cmd => [FETCH=> qq[$number (FLAGS)]], + final => sub { $lines =~ /\\Deleted/i }, + process => sub { $lines .= $_[0] }, + ); +} + =pod =item list
Download (untitled) / with headers
text/plain 162b
I added your patch, thanks. -- If riding in an airplane is flying, then riding in a boat is swimming. 107 jumps, 43.5 minutes of freefall, 83.4 freefall miles.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.