# Invio email SMTP dal host sbagliato

**URL:** <https://meta.discourse.org/t/smtp-email-sending-from-wrong-host/68347>\
**Category:** Product Support\
**Created:** [18 Agosto 2017, 10:56pm UTC](https://meta.discourse.org/t/smtp-email-sending-from-wrong-host/68347 "2017-08-18T22:56:03Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![frostyfrog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frostyfrog/32/120808_2.png) [@frostyfrog](https://meta.discourse.org/u/frostyfrog)\
**Post date:** [18 Agosto 2017, 10:56pm UTC](https://meta.discourse.org/t/smtp-email-sending-from-wrong-host/68347/1 "2017-08-18T22:56:03Z")

</div>

I’ve looked at the configs and I can’t figure out how to change the host that email is being sent from, other than changing the `DISCOURSE_HOSTNAME` variable. However, based on the comments, If I change that to say… example(dot)com, then if I visit VPS.provider.example(dot)com, I will no longer see the discourse service.

Alrighty, let’s see if I can make that a bit clearer now… (my real domain is replaced with [example.com](http://example.com))

- My VPS hosting discourse is on a different machine than my email server (due to the fact that I don’t trust the discourse-setup and launcher scripts being run as root).
- My email server serves email from example(dot)com
- Discourse is running on myvps.do.example(dot)com
- Discourse is logging into smtp.example(dot)com to send emails
- Discourse is sending emails from noreply@myvps.do.example(dot)com
- Google receives the email and throws it away due to strict SPF and DKIM rules
- Google sends me an email of said rejection by the next day via the DMARC system

I’m not sure what I can do to fix this, is there anyway to change the sending address? (I’ll be taking a look into spoofing the [header.from=myvps.do.example.com](http://header.from=myvps.do.example.com) from the postfix side to see if that helps at all) I’m able to login to the system since I can send emails to example(dot)com and be just fine, but sending to other email providers is another story.

---

_[View the full topic](https://meta.discourse.org/t/smtp-email-sending-from-wrong-host/68347)._
