Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit b8900fc9 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #6580 from thundernest/smtp_logging

SMTP: Log "sensitive" responses when "Log sensitive information" is enabled
parents 29204414 a8432dd6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -283,8 +283,9 @@ class SmtpTransport(
        logResponse(smtpResponse)
    }

    private fun logResponse(smtpResponse: SmtpResponse, omitText: Boolean = false) {
    private fun logResponse(smtpResponse: SmtpResponse, sensitive: Boolean = false) {
        if (K9MailLib.isDebug()) {
            val omitText = sensitive && !K9MailLib.isDebugSensitive()
            Timber.v("%s", smtpResponse.toLogString(omitText, linePrefix = "SMTP <<< "))
        }
    }
@@ -532,7 +533,7 @@ class SmtpTransport(

        repeat(pipelinedCommands.size) {
            val response = responseParser.readResponse(isEnhancedStatusCodesProvided)
            logResponse(response, omitText = false)
            logResponse(response)

            if (response.isNegativeResponse && firstException == null) {
                firstException = buildNegativeSmtpReplyException(response)