0

Running Civicrm v4.7.14 on Wordpress v4.7 PHP v 5.6.29

For the last couple of weeks, I've been getting the following PHP warning emails, mostly hourly, from my host's server, after the CRON runs with cli.php. All permissions are set correctly in root /httpdocs /wp-content /plugins /civicrm /civicrm /bin/cli.php.

My host has investigated the email setup but found no problems.

Everything else with CRON is working normally and all scheduled jobs are being executed as far as I can tell, with the exception of mail_report where error message is "Finished execution of Mail Reports with result: Failure, Error message: A fatal error was triggered: is not of type String". I'm not sure whether this has any relevance and it would appear that this message was being received prior to when the PHP warnings started.

Mail() is used (rather than SMTP).

The PHP warning messages are as follows: PHP Warning: scandir(INBOX/cur): failed to open dir: No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: scandir(): (errno 2): No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: scandir(INBOX/new): failed to open dir: No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: scandir(): (errno 2): No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: scandir(INBOX/cur): failed to open dir: No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: scandir(): (errno 2): No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: scandir(INBOX/new): failed to open dir: No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: scandir(): (errno 2): No such file or directory in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/mysite.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Mailing/MailStore/Maildir.php on line 85

Lines 85 to 89 in the Maildir.php file shows: foreach (scandir($dir) as $file) { if ($file == '.' or $file == '..') { continue; } $path = $dir . DIRECTORY_SEPARATOR . $file;

I'm not sure whether I have any missing core files and any help to find out the cause of these warning messages would be greatly appreciated.

1 Answer 1

1

What this is suggestive of is that the configuration setting for the mail account look in correct as its trying to retrieve emails to see if it needs to process them (for bounces or replies etc) and it can't find the relevant directories

Seamus

2
  • To state what's implicit in Seamus' reply - this is an issue with checking inbound mail. Your outbound mail settings (e.g. SMTP vs mail()) shouldn't matter here. Jan 2, 2017 at 18:14
  • Thanks Seamus and Jon for your help. I've tried several combinations of settings in Administer>civimail>Mail Accounts with the result that either the cli.php cron would not work, or that if it did work, the php warnings persisted. So I've now dispensed with the php.cli and am using a URL cron instead. So far the CRON is working as it should and the warnings have stopped.
    – peterb
    Jan 6, 2017 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.