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!

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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠