Mail sent with the wrong domain

I believe to have an issue similar to this but I’m lost with the resolution steps :thinking:

If I check the PTR record with dig -x 150.x.x.x +short I see the domain I want. But for some reasons, Exim is now sending the emails using the wrong one (however it was working properly before)

for i in $(ip a | awk ‘/inet / {print $2}’ | cut -d ‘/’ -f1); do dig -x $i | grep -vE ‘^;|^$’;done

shows two PTRs, the second that it shows is the one currently in use to send emails, which is wrong (generic Oracle domain ending with …25.oraclevcn.com). Where do I have to change it so that it finds the right one?

Many thanks

I maybe wrong here, but is it sending through an alias, which maybe added under the primary domain, and or is there any forwarder setup?
Also, as per that post, it maybe due to incorrect IP as well.
These may help too, I guess: https://serverfault.com/questions/548826/exim-change-sender-address-when-sending-mails-out-of-local-network
31. Address rewriting

Thank you for your reply!
I’m not sure I can answer that, I’ve set this a very long time ago. How can I check that?

Go to the mail domain in GUI/Panel. Check under the said email if there are any aliases set against it or if anything that maybe out of order. I am outside and my panel will not open on my browser right now. I also cannot recall the exact exim commands/files, but this may help: https://serverfault.com/questions/173104/understanding-exim4s-etc-aliases
Exim Cheatsheet (very old, but some may still work).

The inbox has a forward all set, but I’ve tried creating a new inbox based on the same domain and the issue is still the same. I’ve tried a different email account based on a different domain and that’s affected too. I’m not sure what has happened but whatever it is it’s affecting all the domains :disappointed_face:

Is there any cloudflare or similar thing / pattern in between? Also, do try and provide logs. You can find them in the UI or under the domain logs. You can see the sent header as well. Would definitely require logs mate.

Also, check this comment once: After 421 misdirected request solution - Problems with email - #4 by sahsanu

Sorry for the late reply here!
But I think I might have missed to share this info when I started the thread, the emails are sent properly, there’s no issue there, but due to the error I shared above, sometimes they go to spam.
The emails are delivered without errors, but if this is of any help, this is the log of the email I’ve sent as a test:

2025-07-17 18:24:58 1ucTHt-007xGP-WF <= [email protected] H=hestia.mycoolsite.com (webmail.mycoolsite.com) [127.0.0.1] P=esmtpa A=dovecot_login:[email protected] S=611 [email protected]
2025-07-17 18:24:58 1ucTHt-007xGP-WF => [email protected] R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [172.253.63.27] X=TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256 CV=yes K C="250 2.0.0 OK 6a1803df08f44-70514dd394fsi5277226d6.243 - gsmtp"
2025-07-17 18:24:58 1ucTHt-007xGP-WF Completed