Questions about `config.production.json`

Hey everyone,

I’ve made a few tweaks to my config.production.json file to add a mail server, but had a few quick questions about further modifications, based on the info in the docs here.

In the mail section my config file:

"mail": {
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.mailgun.org",
      "port": 465,
      "auth": {
        "user": "postmaster@mnchrm.co",
        "pass": "xxx"
      }
    }
  },

If I want to add a from address, does it matter where I put that? Should that be on the first line, right before transport?

Second, I want to remove image compression on my ghost blog. The end of my config file looks like this:

  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/mnchrm/content"
  }
}

Can I just append the imageOptimization in the middle there, like this?

  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/mnchrm/content"
  },
  "imageOptimization": {
  "resize": false
  }
}

Finally, do I need the compression item as well, or is that covered by imageOptimization? If I add that, should it go under imageOptimization like this:

"imageOptimization": {
  "resize": false
  "compress": false
  }

or as it’s own item like this:

"imageOptimization": {
  "resize": false
  },
"compress": false

Thanks!

Yes, that’s where I place it.

Incidentally, you should use 587 (TLS) as this is the default port for mail submission. Port 465 should no longer be used for SMTP communications.

Thanks much. I’ll throw that in there, then. Any idea on the image compression stuff? I added

"imageOptimization": {
  "resize": false

to the bottom which seemed to help, but didn’t add "compress" anywhere; not sure I need to.

Port 465 should no longer be used for SMTP communications.

Hmm, is it an issue if I do use it? I had it set at 587 earlier and sent out a newsletter to my members, but someone informed me they were getting an error trying to sign up for my site, “Failed to send magic link.” I confirmed this with a test email I have. I’m not sure where I saw suggesting to switch it, but it seemed to solve my issue. Might have to dig around for another solution if this is a security risk or something.

Thanks!

I’ve not used the image optimization option, so can’t help there.

TLS is preferable, and works with Ghost and Mailgun. Note that it is negotiated over plain text, and switches to TLS, so there are a couple of config changes; search the forum.

At some point, it is likely that port 467 support will be removed.

So I just confirmed that new member signup was working, then SSH’d in and swapped the port back to 587, and have now confirmed I’m unable to add new users. I get the same “Failed to send magic link” error. Any idea why that might be, or how I can fix it? Changing the port in my config file is the only change I’ve made. I’ve got Mailgun all set up, my DNS is correct and address is verified, and believe I’ve got the settings correct on the back-end. Could I need to give Ghost access to that port or something?

Got it. I updated the config file again to match your recommendations here; just adding these lines:

      "secure": false,
      "requireTLS": true,

Hopefully this all seems good, but thanks again for your help here and in the past!

1 Like