fiveai / Cachet

📛 An open source status page system for everyone.
https://cachethq.io
BSD 3-Clause "New" or "Revised" License
101 stars 28 forks source link

SMTP Issue #47

Open athornfam2 opened 3 years ago

athornfam2 commented 3 years ago

I'm on Cachet... I'm having issues with configuring and setting "mail" settings. When I go to the Mail section no matter what I put in and save... no errors but when I go to another page and then back or just attempt to test it the app wipes out all of my configured settings. I've also gone into the .env file and set the appropriate settings then do this sudo php artisan config:cache but I eventually get this page (which isn't good) 2021-03-02 19_43_06-Window

sedan07 commented 3 years ago

@athornfam2 under the directory you've installed Cachet there should be a directory called storage if you could see if the file: storage/logs/laravel.log has any useful info on the cause the error. Look for the start of stack trace and pop it on here.

LilTrublMakr commented 3 years ago

I am also having a problem with mail. I am able to get my settings set, but whenever I try to send a test email or add a subscriber, I get a 500 error.

Log for sending a test email: https://pastebin.com/nkk1tuZt Log for adding a subscriber: https://pastebin.com/BqqJSb2Z

sedan07 commented 3 years ago

@LilTrublMakr just to double check, the email address(s) approved on mailgun to send emails from is the same one Cachet is trying to send as?

LilTrublMakr commented 3 years ago

I have the email address set up through mailgun, yes. As far as them getting approved to be sent, looking at the logs, I see no indication that they are even making it that far.

athornfam2 commented 3 years ago

@athornfam2 under the directory you've installed Cachet there should be a directory called storage if you could see if the file: storage/logs/laravel.log has any useful info on the cause the error. Look for the start of stack trace and pop it on here.

https://pastebin.com/eQ5X6Up2

athornfam2 commented 3 years ago

I have the email address set up through mailgun, yes. As far as them getting approved to be sent, looking at the logs, I see no indication that they are even making it that far.

For me, as soon as I add all the necessary information back into the Mail section on the WWW page it reverts all information back to log/testing like it doesn't even keep the data. When I manually put the information into mailgun it crashes the entire app.

LilTrublMakr commented 3 years ago

Yeah, still getting nowhere. I have tried using SMTP and Mailgun, and test mode and all of them result in a 500 error when sending a test. I know that Mailgun should work because I use it in multiple other applications and it works. I think the 500 is throwing before the email can even make it to Mailgun because I am not seeing any logs in Mailgun that it is making it that far.

LilTrublMakr commented 3 years ago

Ok... So the settings don't save from within Cachet... I had to change the environment variables in docker to get them to stick. Switching from "mailgun" to "smtp" worked for me. I am able to send test emails and add subscribers now.

athornfam2 commented 3 years ago

Ok... So the settings don't save from within Cachet... I had to change the environment variables in docker to get them to stick. Switching from "mailgun" to "smtp" worked for me. I am able to send test emails and add subscribers now.

Where would you change that under a vanilla linux install? /var/www/html/cachet

LilTrublMakr commented 3 years ago

Are you using Docker?

If you aren't: ls -a to see if .env is in there. If it is, use a text editor like nano to edit it with sudo nano .env.

If you are using Docker, edit your docker file or docker-compose file to change it.

athornfam2 commented 3 years ago

Are you using Docker?

If you aren't: ls -a to see if .env is in there. If it is, use a text editor like nano to edit it with sudo nano .env.

If you are using Docker, edit your docker file or docker-compose file to change it.

So, that's where my original issue came from. When I manually change the .env file it crashes with the image in my first post.

LilTrublMakr commented 3 years ago

Did you restart the container after making the edit? Maybe even make the edit with the container stopped?

pavog commented 3 years ago

I discussed this issue in the upstream repo at #4260 and filed a pr to fix it #4261.