Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
}

Session manageSieveSession = ctx.channel().attr(NettyConstants.SESSION_ATTRIBUTE_KEY).get();
Session.State statePriorExecution = manageSieveSession.getState();
String responseString = manageSieveProcessor.handleRequest(manageSieveSession, request);
attachment.resetCumulation();
attachment.write(responseString);
Expand All @@ -98,12 +97,6 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
String capabilities = manageSieveProcessor.handleRequest(manageSieveSession, "CAPABILITY");
attachment.write(capabilities);
}
if (manageSieveSession.getState() == Session.State.AUTHENTICATED &&
statePriorExecution != Session.State.AUTHENTICATED) {
// RFC-5804 section 1.7 returning capabilities is mandated after AUTH
String capabilities = manageSieveProcessor.handleRequest(manageSieveSession, "CAPABILITY");
attachment.write(capabilities);
}
} catch (NotEnoughDataException ex) {
// Do nothing will keep the cumulation
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ void doubleAuthenticationShouldFail() throws IOException {
this.client.sendCommand(command);
ManageSieveClient.ServerResponse firstAuthenticationResponse = this.client.readResponse();
Assertions.assertThat(firstAuthenticationResponse.responseType()).isEqualTo(ManageSieveClient.ResponseType.OK);
this.client.readResponse(); // Read capabilities

this.client.sendCommand(command);
ManageSieveClient.ServerResponse secondAuthenticationResponse = this.client.readResponse();
Expand Down Expand Up @@ -235,6 +234,5 @@ void authenticatePlain() throws IOException {
this.client.sendCommand("AUTHENTICATE \"PLAIN\" \"" + Base64.getEncoder().encodeToString(initialClientResponse.getBytes(StandardCharsets.UTF_8)) + "\"");
ManageSieveClient.ServerResponse authenticationResponse = this.client.readResponse();
Assertions.assertThat(authenticationResponse.responseType()).isEqualTo(ManageSieveClient.ResponseType.OK);
this.client.readResponse(); // Read capabilities
}
}