aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

Use AmazonSimpleEmailServiceClientBuilder when creating AWSJavaMailTransport without provided credentials.

Open serhiimarian opened this issue 4 years ago • 1 comments

We want our application to use amazon SES instead of custom SMTP, part of this functionality is tied to TransportListeners, so I decided to go with AWSJavaMailTransport instead of just AmazonSimpleEmailServiceClient, I need to pick up credentials from assigned role in ECS Fargate service, but when I'm trying to fill properties with credentials taken from different providers I get AmazonSimpleEmailServiceException: The security token included in the request is invalid.. As a workaround I want to use AWSJavaMailTransport without credentials, for it to rely on no argument constructor for AmazonSimpleEmailServiceClient, but deprecated version sets region to us-east-1 by default, while AmazonSimpleEmailServiceClientBuilder.defaultClient() picks up both proper credentials and region.

I want to use AmazonSimpleEmailServiceClientBuilder.defaultClient() in protocolConnect() method AWSJavaMailTransport.

  • AWS Java SDK version used: 1.12.22
  • JDK version used: jdk1.8.0_302 (Amazon Coretto)
  • Operating System and version: Windows 10

serhiimarian avatar Aug 31 '21 20:08 serhiimarian

Hi @serhiimarian apologies for taking so long to get a response. Reasonable feature request, I see that the client created in protocolConnect() is the deprecated version new AmazonSimpleEmailServiceClient().

The team focus is in releasing features for the Java SDK v2, so this has low chance of being implemented unfortunately.

debora-ito avatar Jun 22 '22 01:06 debora-ito