Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Insecure and Non-Authenticated SMTP Servers on Localhost #54

Open
fritz-fritz opened this issue May 29, 2024 · 6 comments
Open

Comments

@fritz-fritz
Copy link
Contributor

I'm not sure if I am doing something wrong, but I can't seem to successfully use the Sendmail Transport for NodeMailer. I was under the impression that the configuration file format is the same as Ghost and so attempted to manually replicate the same settings.

As I have sendmail successfully configured on the VPS where Ghosler and Ghost will be running, I do not require SMTP and instead just the Sendmail transport.

My Ghost config.production.json mail snippet is here:

  "mail": {
    "transport": "Sendmail",
    "from": "Sender <noreply@example.com>"
  }

And so my Ghosler equivalent was similarly thus:

"mail":[{"reply_to":"'Support' <help@example.com>","from":"'Newsletter' <noreply@example.com>","transport":"Sendmail","batch_size":10,"delay_per_batch":1250}]

Unfortunately though, the analytics tab shows that it was stuck "Sending" and had not gone out. I do not see anything in the logs either in Debug or in Error.

Additionally, such a change to the config.production.json causes the "Settings" tab to return a 500 code so I suspect the backend does not parse the config correctly or handle the transport definition.

@ItzNotABug
Copy link
Owner

ItzNotABug commented May 29, 2024

Hey @fritz-fritz 👋,
The config file for Ghosler is not same as Ghost as it supports adding multiple email addresses for splitting the newsletter sending load / limit.

You should be able to go to Ghosler > Settings > Scroll down to Email Settings > Add all the required info. > Save.

@fritz-fritz
Copy link
Contributor Author

Yes I understand that much, though the goal is NOT to use a hardcoded SMTP server and instead rely on NodeMailer's Sendmail transport directly. Ghosler does use NodeMailer correct?

@ItzNotABug
Copy link
Owner

Ghosler indeed uses Nodemailer for sending the newsletter but via SMTP credentials.

Afaik the sendmail flag is similar to mail() in PHP, this might send the emails but high chance they land up in the SPAM folder. Using proper credentials from SMTP can avoid that to a good extent. Better if you use services that provide emails for exactly these purposes.

@fritz-fritz
Copy link
Contributor Author

I do appreciate how responsive and helpful you are!

Okay well I have confirmed I can talk to my sendmail server via telnet localhost 25 and so i'm attempting to configure Ghosler to use localhost 25. The sendmail server does NOT require authentication and does NOT support TLS. I have attempted to configure the config as such:

"mail":[{"reply_to":"'Support' <help@example.com>","from":"'Newsletter' <noreply@example.com>","host":"localhost","port":"25","batch_size":10,"delay_per_batch":1250,"auth":{"user":null,"pass":null},"secure":false}]

Unfortunately, it doesn't actually send.

Ghosler Error Log:

[2024-05-29 09:34:57 UTC] => [ERROR] => Newsletter: Error: 00A841FA37700000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:354:
[2024-05-29 09:34:57 UTC] => [ERROR] => Newsletter: Error: 00A841FA37700000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:354:

Mail Log:

2024-05-29T09:34:57.420232+00:00 ghost sm-mta[36438]: 44T9YvbS036438: localhost [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA-v4
2024-05-29T09:34:57.434182+00:00 ghost sm-mta[36439]: 44T9Yvwn036439: localhost [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA-v4

I'm not sure what is causing the SSL error as theoretically I have disabled secure transport on the mail setting. But my theory here is that Ghosler initiates the connection to the MTA but with SSL/TLS and so doesn't handle the response properly hence the MTA not getting the MAIL command.

@fritz-fritz
Copy link
Contributor Author

Oh and I am using a local sendmail instance to relay to my sender so that I can apply custom milters to the outgoing messages such as MIME signing.

@fritz-fritz
Copy link
Contributor Author

ahhhhh you hardcoded it to use secure transport

secure: true,

@fritz-fritz fritz-fritz changed the title Support NodeMailer Sendmail Transport Support Insecure and Non-Authenticated SMTP Servers on Localhost Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants