Commit 5eea336d authored by Steve Holme's avatar Steve Holme
Browse files

ftpserver.pl: Corrected flawed logic in commit 1ca6ed7b

parent f3849a7b
Loading
Loading
Loading
Loading
+41 −38
Original line number Diff line number Diff line
@@ -816,12 +816,17 @@ sub SELECT_imap {
sub FETCH_imap {
    my ($args) = @_;
    my ($uid, $how) = split(/ /, $args, 2);
    my @data;
    my $size;
    fix_imap_params($uid, $how);

    logmsg "FETCH_imap got $args\n";

    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    else {
        my @data;
        my $size;

        if($selected eq "verifiedserver") {
            # this is the secret command that verifies that this actually is
            # the curl test server
@@ -832,9 +837,6 @@ 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";

@@ -864,6 +866,7 @@ sub FETCH_imap {

        sendcontrol ")\r\n";
        sendcontrol "$cmdid OK FETCH completed\r\n";
    }

    return 0;
}
@@ -973,7 +976,10 @@ sub LIST_imap {

    logmsg "LIST_imap got $args\n";

    if ($reference eq "verifiedserver") {
    if ($reference eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    elsif ($reference eq "verifiedserver") {
        # this is the secret command that verifies that this actually is
        # the curl test server
        sendcontrol "* LIST () \"/\" \"WE ROOLZ: $$\"\r\n";
@@ -985,9 +991,6 @@ sub LIST_imap {

        logmsg "return proof we are we\n";
    }
    elsif ($reference eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        my $testno = $reference;