SMTP mail function fails - config parameters & options unclear

Debug Information:

OS: FreeBSD, v13.2
Node Version: v18.18.0
Ghost Version: 5.69.2
Ghost-CLI Version: 1.25.3
Environment: production (circa 2mo)
Command: ‘ghost start’

Sendmail replaced by Dragonfly MTA; BOTH work(ed)!


After switching my email service provider, email function fails. No conclusive documentation or discussions found. Comprehensive syntax and parameters for SMTP, Direct, Sendmail transports unknown. Prefer Sendmail/dma.

Tested local MTA with:

$ mail -s FOO <email>

Email tests to 3 different domains arrived without problem. IOW, DNS TXT and MX records are up-to-date.

Recently switched from Google Workspace (default apps & enterprise convolutions are overkill) to for email services. While with google, email via SMTP worked fine with app password.

While the configuration for uses the same structural configuration as Google, it fails with Gandi.

The way I am testing email in ghost is by going into a draft post, previewing it, and then using the mail option. If there’s a better way, please let me know. Error: Please verify your email settings.


  "mail": {
    "from": "'Bluelf Tribe' <email>",
    "transport": "SMTP",
    "options": {
      "host": "",
      "port": 587,
      "auth": {
        "user": "mylogin",
        "pass": "mypass"

I’d prefer to get email working with my local MTA rather than making a direct connection to, but in the end, having email working is the ultimate goal.

For “transport” I tried both “SMTP” and “Direct” = FAILURE.

Incidentally, when is insert
"service": "GandiMail",

… after “options”, I get

Error detected in the production configuration.

Message: Invalid mail service
Configuration Key(s): mail.options.service
Current Value(s): GandiMail

However, did find reference to GandiMail in

"GandiMail": {
    "aliases": ["Gandi", "Gandi Mail"],
    "host": "",
    "port": 587

“mylogin” and “mypass” are correct when used with my MUA (mail client).

One of my problems, aside from not being familiar with javascript development, is that I don’t have any reference (parameters [secure or secureConnection? — requireTLS?], examples) for HOW TO configure “mail” with Direct versus SMTP versus Sendmail transports. If it exists, can you point the way?

I spent a lot of time and effort going through some .js sources as well as nodemailer help to figure this out, but without understanding the framework of what does what to whom, I confess I am a little lost. Maybe a lot =)

I saw references to sendmail in some of the .js code, but don’t know the mechanism for how ghost/nodemailer formats and communicates with sendmail (/usr/sbin/sendmail), and now dma (Dragonfly MTA):

$ cat /etc/mail/mailer.conf
# $FreeBSD$
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
# If dma(8) is installed, an example mailer.conf that uses dma(8) instead can
# can be found in /usr/share/examples/dma.
#sendmail	/usr/libexec/sendmail/sendmail
#mailq		/usr/libexec/sendmail/sendmail
#newaliases	/usr/libexec/sendmail/sendmail
#hoststat	/usr/libexec/sendmail/sendmail
#purgestat	/usr/libexec/sendmail/sendmail

sendmail        /usr/libexec/dma
mailq           /usr/libexec/dma
newaliases      /usr/libexec/dma

From my reading it sounds like transactional emails are handled by the mail command which passes content on to sendmail.

I hope this resonates with someone who’s maybe already lost their hair but figured it out, or the dev team would know precisely which parameters go with which transport when using nodemail configured via config.production.json.

Cheers for now,
=)D etlev

Have you tried testing with the “forgot password” or “welcome” emails instead?

I’m not sure if the “preview” emails go out using the “transactional” email settings or the “bulk” email settings-- Mailgun.

1 Like

Welcome ~ SignUp from new email?
Result: Failure

Invite new Staff …
Result: Failure

Failed to send invitation to <email>

I don’t see an option for “Forgot password”.

In config.production.json try setting the mail transport to sendmail or maybe Sendmail.

Leave the options empty, or adjust the path and args as seen here:

Based on looking on my own Ghost server, the sendmail transport appears to be built-in, so no additional packages should need to be installed.

1 Like

The long form solution using transport :: SMTP was likely thwarted because of my impatience with DNS deltas. Finally got that to work by removing a small TXT record snippet from my DNS record and waiting a little longer for those changes to propagate.

The short form solution by using transport :: Sendmail also worked once I got the clue to remove all options.

Researched and hacked on this for a while - glad to have it working, finally!

Thanks so much Mark for your pointer with Sendmail. I kept fiddling with options, guessing, since I didn’t come across any instructions.

You are welcome, and good luck with FreeBSD! It served me well for about 10 years.