Using a separate email for support

Running ghost 5.19.1 I edited the config to allow it to use postfix to send out user login emails. However, my postfix is only setup to send mail, and not receive. When I change the support address to a gmail one in the ghost admin panel, it uses that as the from address and seems to disregard the config address.

How can it be set to use my local mailserver for user login emails, and a separate email to be displayed as the support one?

My ghost mail config


"mail": {
    "transport": "sendmail",
    "fromaddress": "noreply@mywebsite.com"
  }

The settings in Admin are for the newsletter, not transactional email.

How have you configured Postfix? Is it using Google as a relay, or have you set up MX records for your domain? Additionally, I use "from": not "fromaddress": in my config, albeit I use Mailgun for transactional mail, too.

Postfix is setup as
inet_interfaces = loopback-only
And with my hostnames and ssl certificates

My MX records are set with my DNS provider, and my server IP has reverse DNS lookups set as well. I’ve sent test SMTP messages without issue.

Is there a way to configure how the login emails are sent as opposed to newsletters?

Did you change fromaddress as suggested? For example…

"mail": {
    "from": "noreply@mywebsite.com",
    "transport": "Sendmail"
  },

You’ll need to restart Ghost after you make the change.

Yeah I changed it to ā€œfromā€ and the emails still come from the default mailing address ā€œnoreply@mywebsite.comā€ instead of the ā€œtest@mywebsite.comā€ that I had set it to.

But I’m not looking to send newsletters anyways. I was hoping there would be functionality to change mailing services based on things like login emails, posts, newsletters. That way I can keep ā€œno-reply@mywebsite.comā€ as the postfix mailer for login requests, and the button on the user page that says ā€œSupportā€ can be an entirely different email. I’m look into the database cause I’m sure the value is stored there.

The table ā€˜settings’ stores the ā€œfromā€ address. So the moment that is changed, it is used for all transactional emails even though in the UI under portal settings it is listed as the " Support email address".

Ideally I was just hoping to change the button on the portal for the user to be directed to a monitored support address, while emails like login tokens were sent from a non-monitored address.

It looks like helpers.js under portal/source/utils handles that address with getSupportAddress. Looks like I can change it there to return the value I want on the front end without altering the ā€˜settings’ table

Used the following code to just remove the contact button, I just decided to use a dedicated page for it

<script>
window.onload = function () {
    let portal = document.getElementById("ghost-portal-root");
    const interval = setInterval(() => {
        let frame = portal.querySelector('[title="portal-popup"]');
        if (frame !== null) {
            const styleElement = document.createElement("style");
            styleElement.innerHTML = `.gh-portal-account-footerright { display: none; }`;
            frame.contentDocument.head.appendChild(styleElement);
        } else {
            frame = null
        }
    }, 300)
}
</script>

Thanks for trying to help, I found the issue I was running into
/core/server/services/members/config.js contains:

    get defaultEmailDomain() {
        return this._settingsHelpers.getDefaultEmailDomain();
    }

    getEmailFromAddress() {
        // Individual from addresses are set per newsletter - this is the fallback address
        return `noreply@${this.defaultEmailDomain}`;
    }

    getEmailSupportAddress() {
        return this._settingsHelpers.getMembersSupportAddress();
    }

    getAuthEmailFromAddress() {
        return this.getEmailSupportAddress();
    }

Which looks to set the address for authentication as the support address, I’m not sure if this is intended functionality or the benefits from this. I was able to override the getAuthEmailFromAddress() to

getAuthEmailFromAddress() {
return ā€˜no-reply-logins@${this.defaultEmailDomain}’;
}

and have it return the address that I want to use exclusively for authentication emails. Then I was able to set the ā€œSupport Email Addressā€ to mywebsite@gmail.com in the admin panel without changing the address for authentication emails

1 Like