# ProcessEmailQueueCommand.php

**URL:** <https://forum.mautic.org/t/processemailqueuecommand-php/2035>\
**Category:** Product Support\
**Created:** [July 9, 2015, 5:22pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035 "2015-07-09T17:22:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![franmex](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@franmex](https://forum.mautic.org/u/franmex)\
**Post date:** [July 9, 2015, 5:22pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/1 "2015-07-09T17:22:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![franmex](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@franmex](https://forum.mautic.org/u/franmex)\
**Post date:** [July 9, 2015, 5:22pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/2 "2015-07-09T17:22:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [July 10, 2015, 2:10pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/3 "2015-07-10T14:10:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![franmex](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@franmex](https://forum.mautic.org/u/franmex)\
**Post date:** [July 10, 2015, 2:30pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/4 "2015-07-10T14:30:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gmillard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gmillard/32/5_2.png) [@gmillard](https://forum.mautic.org/u/gmillard)\
**Post date:** [July 10, 2015, 2:57pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/5 "2015-07-10T14:57:24Z")

</div>

Hi @franmex,

So that error is a bit of an odd one 🙂 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

---

<div class="post-metadata">

**Author:** ![franmex](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@franmex](https://forum.mautic.org/u/franmex)\
**Post date:** [July 10, 2015, 4:23pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/6 "2015-07-10T16:23:24Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![gmillard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gmillard/32/5_2.png) [@gmillard](https://forum.mautic.org/u/gmillard)\
**Post date:** [July 10, 2015, 4:28pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/7 "2015-07-10T16:28:12Z")

</div>

Can you please provide a screenshot of your cron jobs?

Thanks!  
Alan

---

<div class="post-metadata">

**Author:** ![franmex](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@franmex](https://forum.mautic.org/u/franmex)\
**Post date:** [July 10, 2015, 4:38pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/8 "2015-07-10T16:38:20Z")

</div>

Hello!

Thanks for fast answer.  
Here is a screenshot of what I have:  
 ![](http://s11.postimg.org/bevy4eklv/screenshot_2015_07_10_12_30_40.png)

---

<div class="post-metadata">

**Author:** ![gmillard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gmillard/32/5_2.png) [@gmillard](https://forum.mautic.org/u/gmillard)\
**Post date:** [July 10, 2015, 5:02pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/9 "2015-07-10T17:02:24Z")

</div>

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?

```auto
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

---

<div class="post-metadata">

**Author:** ![franmex](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@franmex](https://forum.mautic.org/u/franmex)\
**Post date:** [July 10, 2015, 6:33pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/10 "2015-07-10T18:33:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gmillard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gmillard/32/5_2.png) [@gmillard](https://forum.mautic.org/u/gmillard)\
**Post date:** [July 10, 2015, 10:11pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/11 "2015-07-10T22:11:33Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![franmex](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@franmex](https://forum.mautic.org/u/franmex)\
**Post date:** [July 11, 2015, 4:05pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/12 "2015-07-11T16:05:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jd26](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jd26/32/62_2.png) [@jd26](https://forum.mautic.org/u/jd26)\
**Post date:** [February 27, 2016, 7:47pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/13 "2016-02-27T19:47:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 10:59pm UTC](https://forum.mautic.org/t/processemailqueuecommand-php/2035/14 "2020-02-02T22:59:26Z")

</div>

Closed on February 2, 2020, 10:59pm UTC


