Open qifeng-bai opened 3 months ago
Questions: 1, How to configure the different senders: For example, for alert-test, the sender should be alerts-test@ala.org.au For alerts prod, it should be alers@ala.org.au
Issues:
Run './gradlew bootRun' under the terminal which runs with comp-login.
The first error:
Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), WebIdentityTokenCredentialsProvider: To use assume role profiles the aws-java-sdk-sts module must be on the class path.,
After addimplementation 'com.amazonaws:aws-java-sdk-sts:1.12.553'
in
The error become:
org.springframework.mail.MailSendException: Failed messages: com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), WebIdentityTokenCredentialsProvider: You must specify a value for roleArn and roleSessionName, com.amazonaws.auth.profile.ProfileCredentialsProvider@7bffdb58: Unable to load credentials into profile [profile comp]: AWS Access Key ID is not specified.: ]
Questions: 1, How to configure the different senders: For example, for alert-test, the sender should be alerts-test@ala.org.au For alerts prod, it should be alers@ala.org.au
There should be no change to the way the mails from
address is configured using config.postie.emailSender
this should have a different address for the test and prod environments.
Note: you will need to make sure that the senders email address is verified in the AWS SES configuration for the environment. ie. the alerts@ala.org.au will need to be verified in prod AWS SES
To send via SES simply add the the ala-mail
library to the alerts dependency and update the grails-mail plugin to the latest version:
implementation 'org.grails.plugins:mail:4.0.0'
implementation 'au.org.ala:ala-mail:1.0.0-SNAPSHOT'
You will also need to enable the sending of emails via SES:
mail.ses.enabled = true
You can revert to the SMTP delivery by setting mail.ses.enabled = false
in the /data/alerts/config/alerts-config.properties
file
Link to #211
At this moment, Alerts use:
to forward local Postfix server. Postfix server is configured to use SMPT4Dev on dev environment or Gmail relay service on test / prod env
@brucehyslop mentioned: