Commit 4ae7b7ea authored by Steve Holme's avatar Steve Holme
Browse files

ftpserver.pl: Added SELECT check to IMAP SEARCH command

parent 13a2e325
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -1034,9 +1034,13 @@ sub STATUS_imap {

sub SEARCH_imap {
    my ($what) = @_;
    my $testno = $selected;
    fix_imap_params($what);

    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    else {
        my $testno = $selected;

        logmsg "SEARCH_imap got test $testno\n";

        $testno =~ s/^([^0-9]*)//;
@@ -1055,6 +1059,7 @@ sub SEARCH_imap {
        }

        sendcontrol "$cmdid OK SEARCH completed\r\n";
    }

    return 0;
}