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)!
Problem
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 Gandi.net for email services. While with google, email via SMTP worked fine with app password.
While the configuration for gandi.net 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.
config.production.json
…
"mail": {
"from": "'Bluelf Tribe' <email>",
"transport": "SMTP",
"options": {
"host": "mail.gandi.net",
"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 gandi.net, 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
../current/node_modules/nodemailer/lib/well-known/services.json
"GandiMail": {
"aliases": ["Gandi", "Gandi Mail"],
"host": "mail.gandi.net",
"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