Emails not being sent automatically (cronjob)

Checklist
[X] I have read intro post: About the Installation Issues category
[X] I have read the tutorials, help and searched for similar issues
[X] I provide relevant information about my server (component names and versions, etc.)
[X] I provide a copy of my logs and healthcheck
[X] I describe the steps I have taken to troubleshoot the problem
[X] I describe the steps on how to reproduce the issue

OS: Ubuntu 18.04.5 LTS
Webserver: Nginx 1.14.0
Php: 7.2.24
Database: MariaDB 10.1.47
Passbolt: …how do I figure this out? I can’t click the help button on my top navigation bar.

Healthcheck:

Troubleshooting Steps I’ve Taken:

  1. Checked the crontab for the webserver user (www-data), and the entry is in there as:
    *** * * * * /var/www/passbolt/bin/cake EmailQueue.sender >> /var/log/passbolt.log**

Reproduce The Issue:
Execute some action that would send an email in the software, such as recovery an existing account. After I enter my email, it says it sent the email, but the email never comes. I run the cake EmailQueue.sender myself manually, and it successfully sends the email. The crontab must not be running itself.

@swebervna Try first running the commands suggested in the Healthcheck FAIL lines near the top to clear those up.

Those suggested commands fixed my permissions issue, but I still need help regarding the emails not sending automatically via the cronjob.

@swebervna

I have tried a couple ways in the past, including setting crontab as the www-data user. Currently, I have my Ubuntu18.04 crontab set as the root user running a command as www-data. Maybe this would work for you:

* * * * * su -c "/var/www/passbolt/bin/cake EmailQueue.sender >> /var/log/passbolt.log" -s /bin/bash www-data

@garrett
Wow, I’ve been gone for a while haha!

Dang, that didn’t work. :confused: that work’s for you? And just to be clear, you’re adding that command to root’s crontab, right?

@swebervna Correct, root crontab.

@swebervna What command are you running when you do it manually and it works?

./bin/cake EmailQueue.sender

I run that as root.

@garrett

Well, it works if the command is in root’s crontab, running as root:

* * * * * /var/www/passbolt/bin/cake EmailQueue.sender >> /var/log/passbolt.log

Is this unadvised, though?

I checked the cake file and there’s Execute permissions:
image

When it comes to updates and other things, this link is my go to for recommended file permissions so nothing goes bad. At least we know why it doesn’t work now.