Forcing submission port 587 for outgoing email

Server:
gulag-news.com
Port 25 blocked
External mailer: Kingmailer
Ghost mail config:
“mail”: {
“transport”: “SMTP”,
“options”: {
“service”: “Kingmailer”,
“auth”: {
“user”: “ozgulag-protonmail-com/free-trial”,
“pass”: “…”
}
}
},

LetsEncrypt wildcard cert created with certbot using DNS (only way with wildcard certs.)

mysql Ver 8.0.26-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))

If you’re looking for help, please provide information about your environment. If you delete this template and don’t provide any information, your topic will be automatically closed.

If you aren’t running the latest version of Ghost, the first thing we’ll ask you to do is update to the latest version of Ghost.

  • What’s your URL? This is the easiest way for others to help you
    https//gulag-news.com
  • What version of Ghost are you using? If it’s not the latest, please update Ghost first before opening your topic
    Ghost 4.19.0

And

  • How was Ghost installed and configured?
    ghost install
    but without setting up the SSL, because the certs had already been set up for the web server.

  • What Node version, database, OS & browser are you using?
    node --version
    v14.18.1
    mysql --version
    mysql Ver 8.0.26-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))

  • What errors or information do you see in the console?
    On attempting to invite the first staff member, this error message appaeared:
    Error sending email! Error sending email: Failed to send email. Reason: Email has been temporarily rejected. Please check your email settings and resend the invitation.

  • What steps could someone else take to reproduce the issue you’re having?

How can I force the Ghost mailer to submit mail on port 587? Is there an option in the json setup file? Does the certificate need to be specified there?

I found the discussion of ‘Secure connection’ in the docs, and I upgraded the mail config to:

"mail": {
  "transport": "SMTP",
  "options": {
    "host": "kingmailer.org",
    "port": 587,
    "auth": {
      "user": "ozgulag-protonmail-com/free-trial",
      "pass": "................."
    }
  }
},

However, when I try to send with this configuration, I get

[2021-10-19 12:19:33] ERROR "POST /ghost/api/canary/admin/invites/" 500 1050ms

NAME: EmailError
MESSAGE: Error sending email: Failed to send email. Reason: Email has been temporarily rejected. Please check your email settings and resend the invitation.

level: normal

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."
EmailError: Failed to send email. Reason: Email has been temporarily rejected.
    at createMailError (/var/www/news/versions/4.19.0/core/server/services/mail/GhostMailer.js:67:12)
    at GhostMailer.handleDirectTransportResponse (/var/www/news/versions/4.19.0/core/server/services/mail/GhostMailer.js:140:19)
    at GhostMailer.send (/var/www/news/versions/4.19.0/core/server/services/mail/GhostMailer.js:116:25)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

The mail is not being rejected at the server of the recipient, or it is failing either internally or in the attempt to talk to kingmailer. I’ll try to get hold of kingmailer logs.

I modified my mail settings as follows:
“mail”: {
“transport”: “SMTP”,
“options”: {
“host”: “kingmailer.org”,
“port”: 587,
“secure”: false,
“tls”: {
“minVersion”: “TLSv1.2”
},
“auth”: {
“user”: “ozgulag-protonmail-com/free-trial”,
“pass”: “…”
}
}
},

The tls entries I put in there just to see if Ghostmailer would accept Nodemailer settings. I suspect that Nodemailer, hence Ghostmailer, comes with its own certificate and key.

The more important thing, I suspect, was completely disabling the postfix and dovecot installations I had been trying to get working in a NO-25 server environment. So I’m now relying completely on Ghostmailer and Kingmailer.

If I’m feeling lucky I might experiment with 465 and secure: true later on.