Setting up pstfix on a vps and using it with ghost

Hey

I’m creating a friend’s website with ghost. Let’s be honnest : he’s cheap. But I definitely get it. Especially when you see the cost and restrinctions of hosts and mail services. But that’s another debate. That was to say : he wants to use the newletter functionnality but as free as it can get. We’re using a VPS for ghost. Some will say that it’s not enough but no website and no newsletter are not enough to reach people so when we face the limits of such a setup… then I guess we’ll move on. For now, portal-related mails are working trough our tiny tiny mail plan that’s included with the domain. I was successful setting the stmp in ghost’s config. But newsletter are not working : ghost keeps asking us to setup mailgun. And anyways, I don’t think that our domain provider will allow a newsletter use, even if it’s between 0 and 2000 people (which is big, compared to what we actually have).

That’s why I want to use postfix. It itself quick to install… but I’m lost in configuration. There are several tutorials explaining the process and even two of them are explaining how to set it up for Ghost. They all miss a paragraph about DNS. How am I supposed to set the DNS ? Do I need to set the DNS ? do I need to use the main domain ? a subdomain like “stmp.domain.com” or “mail.domain.com” ?

For now, I can’t even send a mail from the shell comand.

I know that it sounds more like a question related to postfix rather than to ghost but I’m not trying “to make postfix work”. I’m trying “to make postfix work with ghost” and on the same server. So i’m rather looking for someone who’s been able to make postfix work for ghost more than someone who simply knows how to work with postfix.

If you are that person, thanks for helping !!

Some answers to what to do for DNS here: How I finally got Google to accept my contact form mail

(Caveat: I don’t do a newsletter.)

You know that mailgun has an unadvertised flex plan that’s (free? Or super cheap?) for small numbers of newsletters, right?

You can’t use Postfix for newsletter delivery; only transactional mail. Moreover, when configuring Mailgun for newsletters, you’re not sending the emails from your server since this uses an API. I’d recommend using Mailgun; it’ll most likely be free to use for your list, and can also handle transactional email.

This depends entirely on what you intend to do. Your easiest route is Mailgun:

  • Create a free account (sign up for the trial, and then downgrade–posts in the forum about this)
  • Configure bulk email in Mailgun; you’ll be guided through the DNS settings
  • Configure transactional email in Mailgun
  • Create an A (and AAAA) address for your hostname (this differs to the WWW address)

Most likely, you will need to set up a relay in Postfix (you may find that this is the only way to send from your host.) I use Postfix with a Mailgun for this, using StartTLS. I’m happy to share the steps, but for Ubuntu 22.04 only, so this may not work for you.

Depending on what you decide to do, I can walk you through the steps needed to configure Postfix with Mailgun.

1 Like

TL;DR

  • You can setup and manage local SMTP (sending) on your VPS
    • you need to set up SPF records in your DNS - lookup Sender Policy Framework
    • you just use sendmail - no need for postfix - use localhost as your SMTP gateway
    • restrict SMTP to localhost/127.0.0.1 - you don’t want to be a spam gateway
    • on Ubuntu server and Debian, sendmail is provided by exim4
    • exim config easier than original sendmail - well documented, somewhat complex
    • only do this if you want a small project
  • Go with Mailgun if you just want it to work

Postfix is more about collecting incoming email, storing it and providing access via IMAP/POP3 servers so you can read your email.

P.S. I don’t use the newsletter functionality - so am just assuming that Ghost is using a multi-address BCC via sendmail interface to send.

1 Like

Hey ! that’s a really interesting article ! Thanks
But I don’t think that mailgun has a free tier. It has a free trial, as far I can tell. I mean, that’s what the tiers page seems to indicate.

1 Like

Hey,
I’m not sure that I get it. You’re using postfix but with Mailgun ? My goal was to try t o avoid paying services

I use Mailgun as an SMTP relay with Postfix for transactional email. For newsletters, I use Ghost with the Mailgun API.

You can’t use Ghost and Postfix (SMTP) to send bulk email.

And, to be clear, Mailgun is free for small lists of up to 1,000 emails, and $1 per 1,000 thereafter. Simply start the trial, and then downgrade to the Flex pay as you go model.

1 Like

This is incorrect. Postfix is an MTA just like Sendmail. It isn’t an IMAP/POP3 server.

They’ve quit advertising the flex plan, but several folks on the forum have reported getting it on request, so that appears to be an option still, as mjw says.

Unless I’m misquoting, the entire point of Ghost requiring Mailgun for newsletters is because you shouldn’t (or can’t, or will have a really bad time if you) use a transactional sending client for bulk email. Ghost uses the Mailgun API to send newsletters, and the mail client configured in your config for transactional emails. This also allows for more personalized newsletters (e.g. Hey {first_name},)

Docs: Why do I have to set up Mailgun for newsletters?

@GregFdz: As @mjw and @Cathy_Sarisky have mentioned, if you’re on the free tier, and you send out 1 newsletter a week to 2,000 people, that’s 8,000 emails being sent for $8. If that’s too much, it would probably be better to use a different ESP (as in, don’t use Ghost’s built-in newsletter functionality, but use the other parts of it). If you really want Ghost to support more bulk email providers than Mailgun, there’s an open call for help: Support sending bulk email from other providers - #5 by Hannah

I saw this on Reddit the other day:

Oops - MJW points out that Postfix is a sendmail drop-in, I was thinking of Courier.

And I see that MJW has confirmed that Ghost doesn’t just use a sendmail compatible multi-address bcc, but is tied into a Mailgun API - kind of limits your options.

Can you modify MX records with your domain provider? What hosting are you using? Clouds like AWS will require reverse-domain lookup to be allowed so your emails look legit.