ProcessEmailQueueCommand.php

Hello!



I installed mautic on the vps we have but I have a problem with sending emails.

If I use Mandrill, there is an API call but enails are not sent through. So I set Mandrill using smtp settings and test email is sent. I can also send direct emails but if I want to use the queued emails option, I get an error in the log file. I’d like to use the queued option because if all my emails are streamed directly, some are not catched by mandrill.

The error I get every 5 minutes when the cron job runs is :



[09-Jul-2015 18:00:03 UTC] PHP Warning: rename(/path/to/mautic/app/spool/default/0XLRin6gqv.message.sending.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry,/path/to/mautic/app/spool/default/0XLRin6gqv.message.sending.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry): File name too long in /path/to/mautic/app/bundles/CoreBundle/Command/ProcessEmailQueueCommand.php on line 96

[09-Jul-2015 18:00:03 UTC] PHP Warning: file_get_contents(/path/to/mautic/app/spool/default/0XLRin6gqv.message.sending.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry): failed to open stream: File name too long in /path/to/mautic/app/bundles/CoreBundle/Command/ProcessEmailQueueCommand.php on line 98



Thank you for your support

Hello!

I installed mautic on the vps we have but I have a problem with sending emails.
If I use Mandrill, there is an API call but enails are not sent through. So I set Mandrill using smtp settings and test email is sent. I can also send direct emails but if I want to use the queued emails option, I get an error in the log file. I’d like to use the queued option because if all my emails are streamed directly, some are not catched by mandrill.
The error I get every 5 minutes when the cron job runs is :

[09-Jul-2015 18:00:03 UTC] PHP Warning: rename(/path/to/mautic/app/spool/default/0XLRin6gqv.message.sending.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry,/path/to/mautic/app/spool/default/0XLRin6gqv.message.sending.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry): File name too long in /path/to/mautic/app/bundles/CoreBundle/Command/ProcessEmailQueueCommand.php on line 96
[09-Jul-2015 18:00:03 UTC] PHP Warning: file_get_contents(/path/to/mautic/app/spool/default/0XLRin6gqv.message.sending.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry.finalretry): failed to open stream: File name too long in /path/to/mautic/app/bundles/CoreBundle/Command/ProcessEmailQueueCommand.php on line 98

Thank you for your support

Hi,

could you check logs if there is some file permission error? The email in form of a file should be retried maximally 3 times if there is some problem sending it and then the file should be deleted. In your case the file is not deleted and resent again and again.

Hello!

Thanks you for your reply.
The error log is showing these 2 lines:
[Thu Jul 09 12:52:47 2015] [error] [client 187.145.179.xxx] client denied by server configuration: /home/path/to/mautic/app/console mautic:leadlists:update --env=prod
[Thu Jul 09 12:49:44 2015] [error] [client 187.145.179.xxx] client denied by server configuration: /home/path/to/mautic/app/console mautic:email:process --env=prod

Hi @franmex,

So that error is a bit of an odd one :slight_smile: It says that Apache is trying to serve the commands as a web page rather than being executed directly via PHP and is thus blocking access due to Apache’s configuration.

Can you please describe how you have your cron jobs setup and also check to see if your host only allows web accessible scripts for cron jobs?

Thanks,
Alan

Hello @alanhartless,

Thanks for your answer.
I contacted host and they say there is no problem for cron jobs running like the Mautic ones.
I have cron jobs set in cpanel to run every 5 minutes.

We tried to change the permissions to 755 on all concerned files but emails queued are still not sent.

Thanks!

Can you please provide a screenshot of your cron jobs?

Thanks!
Alan

Hello!

Thanks for fast answer.
Here is a screenshot of what I have:

They look okay; although on some hosts you do need the full path to php and the -q flag as you do for your vtigercron.php script. Are you still getting this error in your server’s log?

client denied by server configuration: /home/path/to/mautic/app/console mautic:leadlists:update --env=prod

If you go in to Configuration of Mautic and click and the Test Connection button, does it show a success?

Thanks,
Alan

Hello!

Thanks so much for helping me.
I changed the cron jobs so that they have the complete path, as my vtiger cron.
I have no more error messages, either in Mautic error logs and in my cpanel error logs.

If I hot test connection button, I get the Success message. I can send the test email.
But if I want to send a custom email to a lead, I get the message saying that the email is sent. However, I have nothing in Mandrill API logs.

Is there a way to see emails that are queued?

If using the queue feature, the messages should be stored in app/spool/default. Each file is a message.

However, I just remembered that there was a bug with Mandrill and Mautic’s queue feature that was fixed with https://github.com/mautic/mautic/pull/532. I bet that’s the issue. It’ll be in 1.1.3 or you can try patching from that pull request.

Thanks,
Alan

Hello!

Thanks a lot for the message.
I made all the changes you mention in Github, and now I can send emails using Mandrill API. However, if I use the queued email option, emails, are not sent, I just have an API call even if my email appears in app/spool/default.
So I set it to send immedietely and it works fine.
I’ll use it this way until next release. Thanks a lot for your time.

Fran Mex!
I see you have vtiger cron job, could you tell me if it works?