What I’m trying to do:
This is a first time email setup for a custom domain. Trying to receive email from a simple gmail account test.
What I’ve tried and what’s not working:
Send an simple test email from a gmail account. This is the checklist I’ve run through:
1. Assure the app has the email component configured.
App has Email component added. I can see the message about being able to send to “anything@” my custom domain.
2. App has a server-module with an email-handling function defined.
Simplest example for a server module function from Meredyd’s online post about this:
@anvil.email.handle_message
def incoming_email(msg):
app_tables.received_messages.add_row(
from_addr=msg.envelope.from_address,
text_content=msg.text
)
msg.reply(text="Thank you for your message.")
3. Data table defined “received_messages” with server access.
Has identical fields as the online example.
4. App is published to the master branch.
5. A record is configured in the domain console.
Yes, an “A” record is set up to point to 52.56.203.177
Still not able to receive email, the automated response to my gmail test is:
Error: 554 5.7.1 anything@ ... Relay access denied
Again, this is coming as an automated reply to a sample email sent to the domain.
Replying to your specific questions:
What domain was your app on before? Are the emails now being sent to the new domain?
This is a completely new custom domain. I have another app with a custom domain that’s working fine and copied the exact same processes (A record, handler function, app config)
How is your domain configured (eg are you using something funny like Cloudflare or just straight DNS)?
This is simple godaddy domain just like the other example app. Straight DNS.
You say your emails aren’t appearing in a received_messages
table, which I assume is a data table. Do you see new messages arriving in the App Logs and the just don’t make it into your data table, or are they not showing up at all?
Yep, simple data table. The messages don’t show up in the app logs at all. Should they be there? I’ve never seen email received show up in an app log.