about summary refs log tree commit homepage
path: root/lib/PublicInbox/IMAP.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/IMAP.pm')
-rw-r--r--lib/PublicInbox/IMAP.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm
index 9ae7c60e..d4ef6efe 100644
--- a/lib/PublicInbox/IMAP.pm
+++ b/lib/PublicInbox/IMAP.pm
@@ -1462,6 +1462,10 @@ sub cmd_starttls ($$) {
 # for graceful shutdown in PublicInbox::Daemon:
 sub busy {
         my ($self, $now) = @_;
+        if (defined($self->{-idle_tag})) {
+                $self->write(\"* BYE server shutting down\r\n");
+                return; # not busy anymore
+        }
         ($self->{rbuf} || $self->{wbuf} || $self->not_idle_long($now));
 }