Commit 6a353049 authored by Steve Holme's avatar Steve Holme
Browse files

ftpserver.pl: Added SELECT check to IMAP FETCH and STORE handlers

parent 49e3d803
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -829,6 +829,9 @@ sub FETCH_imap {
        $data[0] = $response;
        logmsg "return proof we are we\n";
    }
    elsif ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    else {
        logmsg "retrieve a mail\n";

@@ -941,8 +944,13 @@ sub STORE_imap {

    logmsg "STORE_imap got $args\n";

    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    else {
        sendcontrol "* $uid FETCH (FLAGS (\\Seen \\Deleted))\r\n";
        sendcontrol "$cmdid OK STORE completed\r\n";
    }

    return 0;
}