Hello folks, my app recently changed to a custom domain and since then i’m no longer receiving any new emails to the “received_messages” table. I’ve tried a couple of test emails and they are not coming through. Is there anything I need to do after changing the domain?
I received an automated response to the test:
The remote server is misconfigured.
554 5.7.1 <info@____>: Relay access denied
Still not able to receive messages. The latest error when sending a test message is:
551 This application cannot handle incoming email
Again, there were two apps: basically a splash page and full prod app. I switched the domain to point from one to another and can’t receive email any more.
I think it would be helpful to get a bit more context here so that folks can help – what domain was your app on before? Are the emails now being sent to the new domain? How is your domain configured (eg are you using something funny like Cloudflare or just 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?
In your most recent post you mention a different error:
Just to confirm, these are emails to a domain (eg somewhere.com) that used to point at one app, and now points at another? The error “551 This application cannot handle incoming email” happens if the deployment environment at that domain doesn’t have an @anvil.email.handle_message function. To ask the obvious, can your “splash page” app handle email?
Thanks Meredyd, I had improperly defined the message-processing function in the server module. It works now.
Yes the splash page was handling email properly, and the domain was pointing to it. Now that the domain has been switched, I had to reconfigure the tables and mail handler function in the new target app. Hope this helps someone.
More email problems, this time it’s the same error message but to a different app/custom domain.
1. App has the email component configured.
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 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.
Still not able to receive email: Error: 554 5.7.1 anything@ ... Relay access denied
This thread has been marked “solved”, so it’s unlikely that it will get further attention. You may want to start a new thread, so that your question gets the attention it deserves.
@p.colbert is right - this should probably be a new topic.
When you do post that new topic, can I also suggest including the answers I mentioned above?
What domain was your app on before? Are the emails now being sent to the new domain? How is your domain configured (eg are you using something funny like Cloudflare or just 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?
In addition to which, it would be helpful to know how you’re seeing those SMTP errors – what system is reporting them?