diff options
-rw-r--r-- | lib/PublicInbox/IMAP.pm | 6 | ||||
-rw-r--r-- | t/imapd.t | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm index 54c616ee..0852ffab 100644 --- a/lib/PublicInbox/IMAP.pm +++ b/lib/PublicInbox/IMAP.pm @@ -121,6 +121,12 @@ sub cmd_login ($$$$) { login_success($self, $tag); } +sub cmd_close ($$) { + my ($self, $tag) = @_; + delete $self->{ibx} ? "$tag OK Close done\r\n" + : "$tag BAD No mailbox\r\n"; +} + sub cmd_logout ($$) { my ($self, $tag) = @_; delete $self->{logged_in}; @@ -327,7 +327,8 @@ $r2 = $mic->fetch_hash(2, 'BODY.PEEK[HEADER.FIELDS (message-id)]') is($r2->{2}->{'BODY[HEADER.FIELDS (MESSAGE-ID)]'}, 'Message-ID: <20200418222508.GA13918@dcvr>'."\r\n\r\n", 'BODY.PEEK[HEADER.FIELDS ...] drops .PEEK'); - +ok($mic->close, 'CLOSE works'); +ok(!$mic->close, 'CLOSE not idempotent'); ok($mic->logout, 'logged out'); $td->kill; |