jhuckaby / Cronicle

A simple, distributed task scheduler and runner with a web based UI.
http://cronicle.net
Other
3.87k stars 388 forks source link

Email Never Arriving/Sending - Log shows Email sent successfully #809

Closed DGoose closed 1 month ago

DGoose commented 1 month ago

I am having trouble getting the configuration to work to send emails. I am using an external email account from a webhost I use for various random things.

Currently in the web interface there are no errors that show up. In my Cronicle.log file I see entries such as this:

[1726901172.848][2024-09-21 01:46:12][cronicleprdserver][1641][Cronicle][debug][5][Email sent successfully for job: jm1bsd7a602][{"text":"To:etc etc etc

But no email ever arrives. I have also checked the sent mail from the host webmail and it shows nothing there for sent emails. I have tested sending via SMTP from Thunderbird from another machine and it works fine - both in email delivery as well as showing in sent mail. I just get no notifications anywhere of the emails sending or failing to send, except the one in the Cronicle.log file.

Below is my config file (excerpt). I realize that the 'rejectUnauthorized' is not a safe flag, but until I get the certificate problem solved it was throwing an error. I know why the cert is getting flagged.

Is there anything wrong in my config or is there another cause of my issues.

{ "base_app_url": "http://localhost:3012", "email_from": "cronicle@mywebsitehere.com", "smtp_hostname": "mail.mywebsitehere.com", "smtp_port": 465, "mail_options":{ "port":465, "auth":{ "user":"cronicle@mywebsitehere.com", "pass":"hunter2" }, "connectionTimeout":10000, "greetingTimeout":10000, "socketTimeout":10000, "tls":{ "rejectUnauthorized":false } }, "secret_key": "secretkeyhere", ........ all below that is default

I am running Cronicle on a Raspberry Pi 3 - Debian 12 Bookworm - the Raspberry Pi version. Kernel 6.6.31+rpt-rpi-v8 NodeJS 18.19.0 Cronicle Version 0.9.59 Single Server Filesystem storage

Currently I'm just running a instance of the test plugin manually until I get that working.

Any direction is greatly appreciated

jhuckaby commented 1 month ago

Hmmm, well if the log says the email was successfully sent, then your SMTP server "accepted" the mail. Now, delivery of the mail is another story, because that happens in the background, and Cronicle has no idea if that succeeds or fails.

So something in your configuration is causing your mail host to block or drop the mail. This usually comes down to something like IP address or the "From" address.

Cronicle uses nodemailer for sending mail, and this is a widely used and trusted software package, so I don't think that is the issue. It's usually something subtle in your configuration. Try setting the "From" address to your own email account address at that 3rd party mail host.

They also may be blocking your IP address for a variety of reasons.

Sorry I couldn't be of more help.

DGoose commented 1 month ago

Thanks for the response. Host has been telling me that its on the application side, but I finally got them to send me some server logs and the email is definitely making it to them. They still claim that its not on their end, but I've tried through another email host instead and it worked fine. Oh well, thanks anyway!