New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mail] Fix imap protocol setup error #7435
Conversation
Signed-off-by: 9037568 <namraccr@gmail.com>
Travis tests have failedHey @9037568, |
Signed-off-by: 9037568 <namraccr@gmail.com>
Travis tests were successfulHey @9037568, |
@@ -23,4 +23,15 @@ | |||
@NonNullByDefault | |||
public class POP3IMAPConfig extends BaseConfig { | |||
public int refresh = 60; | |||
|
|||
public String debugPrint() { | |||
StringBuffer buffer = new StringBuffer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringBuffer buffer = new StringBuffer(); | |
StringBuilder buffer = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy enough, but please explain why you think this is needed.
@@ -94,6 +94,7 @@ public void initialize() { | |||
} | |||
} | |||
|
|||
logger.debug("Configuration details:\r\n{}", config.debugPrint()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.debug("Configuration details:\r\n{}", config.debugPrint()); | |
if(logger.isDebugEnabled()){ | |
logger.debug("Configuration details:\r\n{}", config.debugPrint()); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is very low cost. Why do you feel the if conditional is needed here?
@@ -71,7 +71,7 @@ public void initialize() { | |||
protocol = baseProtocol; | |||
|
|||
if (config.security == ServerSecurity.SSL) { | |||
protocol.concat("s"); | |||
protocol = protocol.concat("s"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only useful change here. Please remove all the log-bloating debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not going to happen. Debug logging is needed and useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a Codeowner I prefer to keep the badly written style we had before.
While researching this problem in the community forum, I found this gremlin.
The protocol setup fails due to this line in the handler, which does nothing:
So I fixed that and added some actual debug output.
Signed-off-by: 9037568 namraccr@gmail.com