I’m looking for mailer options. Ghost seems to be ignoring my “from:” config option and sending everything as noreply@domain.com , so SES is rejecting them.
Gmail no longer support STMP “less than secure apps” options.
Gmail would be nice, Is there any intent to create an oAuth integration to meet the stricter future requirements. I hear you can use 2FA and SMTP. I’m not sure how that would work for an app. How would you 2FA?
Suggestions?
how do I set the from address. Where is this noreply@domain.com coming from?
jannis
April 25, 2024, 5:02am
3
That depends on your Ghost version. It’s either in the config or – for earlier versions (can’t recall the exact version now, but the change was recently, in the last 2-3 months) – in the newsletter settings.
2 Likes
This might be the issue fixed in 5.78.0.
opened 10:49AM - 21 Mar 21 UTC
closed 03:53PM - 30 Jan 24 UTC
bug
pinned
### Issue Summary
Currently, using Ghost v4.0, if you try to update the email… s in your Admin Settings of Ghost under Members->Email and try to update either support or newsletter, they are set to noreply@domain.tld
They should ideally use the "from" address if set in your config's mail part.
### To Reproduce
The bigger problem is not this, its the fact that if you set custom SMTP and even "from" address in your config's mail part, and try to update the emails given in your Admin Area above, Ghost ignores whatever is set in your config and still uses noreply@domain.tld or no-reply@domain.tld which creates issue with SMTP config as when Ghost tries to send such mails (confirmation mails), the SMTP server will reject it as the "from" mail is different from the actual userid/smtp emailid.
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
This is how postfix (SMTP) logs it:
```
NOQUEUE: reject: RCPT from unknown[xx.xx.xx.xx]: 553 5.7.1 <noreply@dly.in>: Sender address rejected: not owned by user user1@dly.in; from=<noreply@dly.in> to=<user1@dly.in> proto=ESMTP helo=<[127.0.0.1]>
```
The logic for this part (and how I fixed it) lies here:
`core/server/services/members/settings.js`
This is how Ghost currently does it
```
const [,toDomain] = email.split('@');
let fromEmail = `noreply@${toDomain}`;
if (fromEmail === email) {
fromEmail = `no-reply@${toDomain}`;
}
```
Ideally it should atleast check if a from address exists in your config.mail or use the smtp id instead. This just limits the usage of mail and SMTP in general to a very handful of providers.
I had to fix it by overriding fromEmail to use email itself and then I was able to update the mail in my Admin:
```
let fromEmail = `noreply@${toDomain}`;
if (fromEmail === email) {
fromEmail = `no-reply@${toDomain}`;
}
fromEmail = email;
```
### Technical details:
* Ghost Version: v4.0
* Node Version:
* Browser/OS: Chrome
* Database: MySQL
1 Like
I’m running
Ghost-CLI version: 1.26.0
Ghost version: 5.82.3 (at /var/www/ghost)