Error in configuring SMTP
# support
s
I have deployed Medplum on AWS account successfully and it is working smoothly. But I am trying to configure SMTP. For that i have followed following steps: 1) updated support email id in both: config,json file and in AWS parameter store 2)Added following block in config,json file and in AWS parameter store: "smtp": { "host": "smtp.sendgrid.net", "port": 587, "username": "apikey", "password": "YOUR_API_KEY" } 3) I executed server update command Still it is throwing error, here are some screenshots for ref. But I have one more doubt, in above mentioned SMTP block, what should be the username? apikey or actual username? For now i am using actual username. I kindly request your assistance in resolving this issue. Your guidance and support would be highly appreciated.
r
HI @sanket_89360 , is there any additional information in your server logs about this failure. That might give more insight into why this failed
s
I will check and get back to you
@rahul1 i checked the logs of the ECS cluster service but didn't find any failed logs. Can you specifically mention which logs need to be checked?
p
Hey @rahul1 What do you think about above issue? Any other ways to finding out the root cause
@rahul1 console debug logs
does 127.0.0.1 error tells something?
r
@sanket_89360 , i just wanted to confirm that you took the following steps: 1. Sign up for a Sendgrid account 2. Create and store a SendGrid API key with full access "Mail Send" permissions. 3. Verify your SendGrid Sender Identity 4. Created a new key in AWS parameter store called
/medplum/[environment]/smtp
5. The value of this AWS secret was
Copy code
{
  "host": "smtp.sendgrid.net",
  "port": 587,
  "username": "apikey",
  "password": "THE_API_KEY_YOU_CREATED_IN_STEP_2"
}
If this is all true, then I would recommend confirming your connectivity wth sendgrid. As you can see here ( https://github.com/medplum/medplum/blob/f38c6b873e672263743315ed3a0e48aeb03dd2c4/packages/server/src/email/email.ts#L144-L152), we are simply using the
nodemailer
package to send an SMTP request to the sendgrid server
p
@sanket_89360 please check above
s
@rahul1 i have followed the above mentioned steps. the only confusion was related with what should be the username? "actual username" or "apikey". i tried both approaches. but it didnt work. i will check the sendgrid connectivity.
@rahul1 I checked SendGrid connectivity, and it is okay. but still issue is same.
p
@rahul1 is the value seems in the right format?
r
@sanket_89360 my apologies. I was just informed that we have an open issue to support SMTP configuration on AWS (vs. localhost). https://github.com/medplum/medplum/issues/2894
This issue is on our backlog, and I can let you know when it has been resolved
p
ahhh, so any workaround to make it work on aws?
I also see one PR merged for self hosting around it https://github.com/medplum/medplum/pull/2530
s
okay, thanks for the update
@rahul1 Is the issue related to SMTP configuration still unresolved, or has it been resolved? Along with this, I have one more doubt. What should be the plan of action if I want to change the base domain in the existing deployed infrastructure? Should I redeploy from scratch with a new domain or should I change the parameters related to the base domain and URL in the config.json file and in the parameter store, followed by the execution of infrastructure upgrade and server update commands?
@rahul1 any update?
r
Hi @sanket_89360 , this is an issue we are trackig, but it is not currently being actively developed in the current sprint. However, we'd be happy to take a community contribution if you are willing 🙂 This issue is marked as one our "good first issues"
if you'd like to change the base domain, do you not need to re-deploy from scratch, as this will wipe your database
Instead you can: * Update your DNS / hosted zone settings * Update the relevant settings in AWS Parameter Store * Update the relevant settings in your config.json, and then redeploy the medplum app
s
@rahul1 ok, thank you