我遇到了一些关于SpringBoot2.4邮件服务器连接的奇怪问题
my application.yml如下所示:
spring:
mail:
host: ${MAIL_HOST:mail.lbg.ac.at}
port: ${MAIL_PORT:55587}
username: ${MAIL_USER:fallbackusernamehere}
password: ${MAIL_PASSWORD:fallbackpasswordhere}
protocol: smtp
defaultEncoding: UTF-8 # Default message encoding
properties:
mail:
smtp:
auth: ${MAIL_AUTH:true}
starttls: ${MAIL_STARTTLS_ENABLED:true}
当我在本地或本地docker容器中启动SpringBoot服务时,邮件发送就像一个符咒。但是,当我尝试从kubernetes服务中托管的容器发送邮件时,收到以下错误:
Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 334 TlRMTVNTUAACAAAAEgASADgAAAAFgokCq230OvybM5cAAAAAAAAAADIBMgFKAAAACgA5OAAAAA9CAE8ATABUAFoATQBBAE4ATgACABIAQgBPAEwAVABaAE0AQQBOAE4AAQAOAEwAQgBHAC0ARQBYADMABABKAGkAbgB0AGUAcgBuAC4AbAB1AGQAdwBpAGcAYgBvAGwAdAB6AG0AYQBuAG4AZwBlAHMAZQBsAGwAcwBjAGgAYQBmAHQALgBhAHQAAwBaAEwAQgBHAC0ARQBYADMALgBpAG4AdABlAHIAbgAuAGwAdQBkAHcAaQBnAGIAbwBsAHQAegBtAGEAbgBuAGcAZQBzAGUAbABsAHMAYwBoAGEAZgB0AC4AYQB0AAUASgBpAG4AdABlAHIAbgAuAGwAdQBkAHcAaQBnAGIAbwBsAHQAegBtAGEAbgBuAGcAZQBzAGUAbABsAHMAYwBoAGEAZgB0AC4AYQB0AAcACAAyRcGDghbXAQAAAAA=\n;\n nested exception is:\n\tjava.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 518 out of bounds for byte[512]
这种行为非常奇怪,因为甚至java版本(带有SpringBoot2.4.2的Java11)也与服务器上的相同。有人知道这是什么原因吗?
暂无答案!
目前还没有任何答案,快来回答吧!