Log4j with SES or WorkMail

0

I have registered a domain "example.com" on Route53, the identity for this domain has been verified on SES, an organisation "example" has been created on WorkMail and a user "user@example.com" has been created and enabled on WorkMail. I'd like to use this user@example.com to send emails from Log4j using the email appender. My .xml property file is as follows:

<Appenders> <Console name="ConsoleAppender" target="SYSTEM_OUT"> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /> </Console> <File name="FileAppender" fileName="application-${date:yyyyMMdd}.log" immediateFlush="false" append="true"> <PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> </File> <SMTP> <name>EmailAppender</name> <subject>Error</subject> <to>recipient</to> <from>**user@example.com**</from> <smtpHost>**smtp.mail.us-east-1.awsapps.com**</smtpHost> <smtpPort>**465**</smtpPort> <ignoreExceptions>false</ignoreExceptions> <smtpUsername>**user**</smtpUsername> <smtpPassword>**********</smtpPassword> <smtpProtocol>smtps</smtpProtocol> <HtmlLayout charset="UTF-8" locationInfo="true" /> <ThresholdFilter level="ERROR"/> </SMTP> </Appenders>

However I get the following error message: ERROR Caught exception while sending e-mail notification.: javax.mail.AuthenticationFailedException: 535 Authentication credentials invalid javax.mail.AuthenticationFailedException: 535 Authentication credentials invalid

I'm having the hardest time trying to find what is missing in my configuration.

I've tried to create a SMTP gateway in WorkMail on port 465 with username and password the same as what I use for user@example.com on WorkMail, but I get an error message: Failed to connect to the SMTP gateway. Verify that your gateway configuration is correct and reachable from public network.

Finally I've also tried to obtain Amazon SES SMTP credentials using the SES console, and use them instead in my .xml above, but I still get the same error message.

At this point I've run out of ideas, any help much appreciated!

已提問 2 年前檢視次數 232 次
1 個回答
0

Hi,

I'm sorry to hear you're experiencing problems sending mail. WorkMail is a Business Email and Calendar Solution which is not intended to be used for automated mailing. SES is the solution to be used for that.

The error implies the authentication failed. Are you using the correct region end-point? The SES SMTP credentials are region bound.

Kind regards, Robin

AWS
專家
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南