diff options
| author | Steve Holme <steve_holme@hotmail.com> | 2013-12-24 16:32:48 +0000 | 
|---|---|---|
| committer | Steve Holme <steve_holme@hotmail.com> | 2013-12-24 16:34:55 +0000 | 
| commit | 6f2d5f0562f64a95407869a1fe365e652b0a5a8d (patch) | |
| tree | 0c2a97c2d9472011d9c20939804e00a99c9ec136 /tests | |
| parent | 82bf8edff3fd81fef06f77591e39db3049a969f4 (diff) | |
pop3: Fixed APOP being determined by CAPA response rather than by timestamp
This commit replaces that of 9f260b5d6610f3 because according to RFC-2449,
section 6, there is no APOP capability "...even though APOP is an
optional command in [POP3].  Clients discover server support of APOP by
the presence in the greeting banner of an initial challenge enclosed in
angle brackets."
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/ftpserver.pl | 41 | 
1 files changed, 24 insertions, 17 deletions
| diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 97b8366ef..3ade82fc3 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -1707,32 +1707,39 @@ my $username;  sub CAPA_pop3 {      my ($testno) = @_; +    my @list = (); +    my $mechs; -    if((!@capabilities) && (!@auth_mechs)) { +    # Calculate the capability list based on the specified capabilities +    # (except APOP) and any authentication mechanisms +    for my $c (@capabilities) { +        push @list, "$c\r\n" unless $c eq "APOP"; +    } + +    for my $am (@auth_mechs) { +        if(!$mechs) { +            $mechs = "$am"; +        } +        else { +            $mechs .= " $am"; +        } +    } + +    if($mechs) { +        push @list, "SASL $mechs\r\n"; +    } + +    if(!@list) {          sendcontrol "-ERR Unrecognized command\r\n";      }      else {          my @data = (); -        my $mechs;          # Calculate the CAPA response          push @data, "+OK List of capabilities follows\r\n"; -        for my $c (@capabilities) { -            push @data, "$c\r\n"; -        } - -        for my $am (@auth_mechs) { -            if(!$mechs) { -                $mechs = "$am"; -            } -            else { -                $mechs .= " $am"; -            } -        } - -        if($mechs) { -            push @data, "SASL $mechs\r\n"; +        for my $l (@list) { +            push @data, "$l\r\n";          }          push @data, "IMPLEMENTATION POP3 pingpong test server\r\n"; | 
