From 540c3f20afb9101a8b74936843f708bed98ef38e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 8 Sep 2015 00:59:39 +0200 Subject: Add an option --watch to keep the connections open and wait for changes. --- lib/Net/IMAP/InterIMAP.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib') diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm index 35d2075..97756f4 100644 --- a/lib/Net/IMAP/InterIMAP.pm +++ b/lib/Net/IMAP/InterIMAP.pm @@ -526,6 +526,25 @@ sub examine($$;$$) { } +# $self->unselect() +# Issue an UNSELECT command (cf. RFC 3691). Upon success, change the +# state to AUTH. +sub unselect($) { + my $self = shift; + + $self->_send('UNSELECT'); + + $self->{_STATE} = 'AUTH'; + delete $self->{_SELECTED}; + + # it is safe to wipe cached VANISHED responses or FLAG updates, + # because interesting stuff must have made the mailbox dirty so + # we'll get back to it + $self->{_VANISHED} = []; + $self->{_MODIFIED} = {}; +} + + # $self->logout() # Issue a LOGOUT command. Change the state to LOGOUT. sub logout($) { -- cgit v1.2.3