Subscription Confirmation Emails Marked as Spam

I am using the member features to allow for an email subscription. After the user enters there email address and hits submit, they receive an email asking to confirm the subscription.

This email is always ending up in the spam folder. Gmail is saying that the email is “not encrypted” and that appears to be the reason they are marking it as spam.

What can I do to ensure that this email is properly secured or otherwise sent in a way that means it will end up in the users inbox and not their spam box?

Hi @linuxdeveloper.io,

that usually happens when TLS isn’t properly set up on your mail server.
May i ask, which email provider you use for sending your transactional mails ?

A good way start troubleshooting is checking the email header from your “spam” email at:
https://mxtoolbox.com/EmailHeaders.aspx

Let me know if you need any help! :slight_smile:

I have Mailgun setup, but even before Mailgun was setup, the mail was working.

Here is the header analysis:

DMARC Record for blog.linuxdeveloper.io
No DMARC Record found for sub-domain.

Organization Domain of this sub-domain is: linuxdeveloper.io Inbox Receivers will apply linuxdeveloper.io DMARC record to mail sent from blog.linuxdeveloper.io
DMARC Record for linuxdeveloper.io (organizational domain)
No DMARC Record found for linuxdeveloper.io
Test	Result	
	DMARC Record Published	No DMARC Record found	 More Info

My blog is blog.linuxdeveloper.io so I am not sure why it is looking for the organization of just linuxdeveloper.io

Any ideas how I can fix this?

So i had a look at your DNS Records and your MX Entries seem to be from Fastmail or something, i guess the only service you’re sending mails with is them?
But you have no DKIM, SPF and DMARC Record set up, which is a good indicator why you’re mail is ending up in the spam folder.
So you should definitely set up those 3 Records according to your mail provider (eg. mailgun).

I have setup the DKIM and SPF as you mentioned on the domain. However I am still having the same issue.

I believe this is because my mail is setup as follows:

   "mail": {
     "transport": "Direct"
   },

I believe the “direct” method means it just uses sendmail and sends directly without authentication. Is this why I am seeing “mail is not encrypted”?

Should I change this configuration to use Mailgun like it does for the other member features? Or is there a way for me to get it working with the normal “direct” method?

Yes. Please see here for setting up with Mailgun: https://ghost.org/docs/concepts/config/#update-your-configproductionjson-file

That is the case.
As @benravetta already mentioned, the best solution is to set it up with mailgun.
Sending your emails over mailgun also safes you alot of hassle about your mailserver reputation and keeps your mails out of spam.

Issue Solved.

I thought I was already setup with Mailgun, since under Labs -> Members there is a Mailgun section which I had already filled out.

Why do I need to also setup mail in the config.production.json separately? What parts of the app use the configuration in the Labs and which part uses the configuration from the config file? It seems to me that the member post emails use the Labs config, but the mailing list confirmation emails use the file config. This is very confusing.

After setting up Mailgun in the config.json everything started working.

Also, another issue I noticed, was when signing up to the newsletter, it would often say “Enter a valid email address” even when a valid one was entered. This was because some domains were failing with the sendmail (default email way) and once I switched it over to Mailgun by configuring the config.json file, this started working even worse.

It turns out that the Free version of Mailgun can only send mail to your email address and approved recipients, making it unusable for the needs. I needed to upgrade to the next tier (which I believe is still free) in order to make it work. Once I did this, everything started working as expected, and all email addresses were accepted as valid.

Indeed,

the mailgun setting in the admin menu is only for sending newsletters.
Transactional mails (subscribe,signin,signup) are managed through the settings in your config.production.json.
I know it can be rather confusing at first, your not the first to mention that :smiley:
I think you mean the Flex Tier from Mailgun, there is no Free Tier anymore afaik.
The Flex Tier is free for up to 5k/month first 3 months, after that a little over 1k/month, i think.

Mailgun pricing is extremely confusing. I’m sure they have changed it about 5 times since I signed up a year or so ago. I signed up, they offered 10000 emails a month for free (WOW, ok). Next thing I know it’s 1300 a month lol. I just checked out their pricing page and now it’s 5000 free emails for the first 3 months and then it’s Pay As You Go??

1 Like

Sendgrid works well and has a free tier.

Is it possible to configure Ghost for Sendgrid?

It still isn’t clear the difference between the mail settings under Lab -> Members and the mail settings for Ghost itself.

I think this page does a fantastic job explaining everything :slight_smile:

Looks like @vikaspotluri123 has beaten me to it. I think the config for email is for transactional emails, whereas the API set up inside the members panel is for members (bulk) newsletters etc.

Since Mailgun is clearly untenable if it costs >$1k a month, what are the other options?

This brings me back to the original sendmail solution.

Is there a solution for me to continue using sendmail for the transnational mail, but have them properly encrypted with TLS?

What other options are there for making this work besides Mailgun? There must be a way for me to get sendmail to work properly.

I currently don’t have any paying members, so my budget is low.

I’m confused, you have no paying members but Mailgun is pricing at $1k+ for you? Mailgun is a good platform. If you’re just starting out, you will be hard pressed to beat the email deliverability of Mailgun. There are of course others, Mailchimp, etc.

I was going off the posts above which stated that Mailgun costs north of $1k per month. Maybe that is wrong.

Like somebody above said, their pricing is confusing and they don’t seem to have a free tier, or make it clear what it will cost.

I run my blog off a $5 vps, so anything above a few dollars for a low-volume blog is untenable.

I think he was talking about the number of emails you get for free. Mailgun changed their pricing recently, and had some serious communication issues as well as invoicing problems. The first ~1300 emails are free

1 Like

Yes sorry @linuxdeveloper.io if you were confused about that, I was indeed referring to email volume. The pricing is quite cheap for the basic volume. As mentioned, 1300 emails a month are free for me currently. But it appears the plan has changed now and I have been grandfathered into an old plan.

As mentioned by previous posts, we we`re referring to ~1300 emails per month, that you can send for free, after that you have to pay according to mailguns flex tier pricing.
Sorry for the confusion :smiley:

Back to your question.
Can you set up your droplet to act as your mail server?
Totally.
Will it be easy?
Probably not.
The problem isn’t sending the mail per se.
It’s getting the mail to your customers inbox in a timely and safe manner, that is the problem.
Most people tend to forget that without TSL, SPF and DKIM, properly set up, you’re mails are going to get flagged by your customers mailprovider and get deleted or at least moved to spam.
Nobody wants that. That’s why mail providers exist in the first place. They keep their servers of of any blacklists and follow proper encryption and protocol standards.

Anyway, i would start out with mailgun, if i were you. And if you notice, that the 3000 emails per month for the first 3 Months aren’t enough you could still move to another provider.

There are also big firms like aws or google cloud, that offer alot of solutions for mail delivery. Google Cloud for example gives you a 300$ credit to use on any service they have, so that might be something for you aswell, later on.

But feel free to ask if you have any further questions :stuck_out_tongue:

Cheers!