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.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm
index e726307a..0452d6df 100644
--- a/lib/PublicInbox/IMAP.pm
+++ b/lib/PublicInbox/IMAP.pm
@@ -862,14 +862,17 @@ sub process_line ($$) {
                         cmd_done($self, $tag);
                 } else { # this is weird
                         auth_challenge_ok($self) //
-                                "$tag BAD Error in IMAP command $req: ".
-                                "Unknown command\r\n";
+                                        ($tag // '*') .
+                                        ' BAD Error in IMAP command '.
+                                        ($req // '(???)').
+                                        ": Unknown command\r\n";
                 }
         };
         my $err = $@;
         if ($err && $self->{sock}) {
                 $l =~ s/\r?\n//s;
                 err($self, 'error from: %s (%s)', $l, $err);
+                $tag //= '*';
                 $res = "$tag BAD program fault - command not performed\r\n";
         }
         return 0 unless defined $res;