CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • EmailProcessor fails due to wrong folder?
Pages: [1]

Author Topic: EmailProcessor fails due to wrong folder?  (Read 1603 times)

Thoudahl

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7.1
  • MySQL version: 5.5.15
  • PHP version: 5.3.8
EmailProcessor fails due to wrong folder?
February 19, 2012, 01:35:40 pm
Hi all

I'm quite new to this wonderfull tool, but I soon don't have any more hair to pull out after trying to get the EmailProcessor to work.

I finally got it to connect to the mail-server, but now i'm getting a hole bunch of warnings:


Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/tmp/111703-1/) is not within the allowed path(s): (/var/www/<domain>/:/var/www/tmp/) in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php on line 145

Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is 1600 is not allowed to access /tmp owned by uid 0 in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php on line 147

Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/tmp/111703-1/20100604150738356.pdf) is not within the allowed path(s): (/var/www/<domain>/:/var/www/tmp/) in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php on line 154

Warning: fopen(/tmp/111703-1/20100604150738356.pdf) [function.fopen]: failed to open stream: Operation not permitted in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php on line 154

Warning: stream_filter_append() expects parameter 1 to be resource, boolean given in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php on line 196

Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php on line 240

... going on for quite a while...

Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php on line 253

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/tmp/111703-1/20100604150738356.pdf) is not within the allowed path(s): (/var/www/<domain>/:/var/www/tmp/) in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parts/fileparts/disk_file.php on line 80

Fatal error: Uncaught exception 'ezcBaseFileNotFoundException' with message 'The file '/tmp/111703-1/20100604150738356.pdf' could not be found.' in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parts/fileparts/disk_file.php:86 Stack trace: #0 /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parts/file.php(86): ezcMailFile->__set('fileName', '/tmp/111703-1/2...') #1 /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parts/fileparts/disk_file.php(32): ezcMailFilePart->__construct('/tmp/111703-1/2...') #2 /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/file_parser.php(269): ezcMailFile->__construct('/tmp/111703-1/2...') #3 /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/parts/multipart_parser.php(146): ezcMailFileParser->finish() #4 /var/www/<domain>/public_html/admi in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parts/fileparts/disk_file.php on line 86

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/tmp/111703-1/) is not within the allowed path(s): (/var/www/<domain>/:/var/www/tmp/) in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/shutdown_handler.php on line 88

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/tmp/111703-1/) is not within the allowed path(s): (/var/www/<domain>/:/var/www/tmp/) in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/shutdown_handler.php on line 88

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/tmp/111703-1/) is not within the allowed path(s): (/var/www/<domain>/:/var/www/tmp/) in /var/www/<domain>/public_html/administrator/components/com_civicrm/civicrm/packages/ezc/Mail/src/parser/shutdown_handler.php on line 94


As far as I can read the error and warning messages it's simply trying to access something out of my root directory.
Changing openbase_dir is not an option, so:
How can I make place a tmp folder inside my /var/www/<domain>/ folder?

best,
Christian

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: EmailProcessor fails due to wrong folder?
February 19, 2012, 04:31:44 pm

I would first try and get it working by turning off open_basedir and safemode first (or get it working on a different machine without these restrictions)

If i had to guess, its the ezc Mail packages thats using the /tmp directory. So there is no config within Civi to use a different dir. You might want to check up on the ezc code and/or the ezc forums

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Thoudahl

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7.1
  • MySQL version: 5.5.15
  • PHP version: 5.3.8
Re: EmailProcessor fails due to wrong folder?
February 20, 2012, 02:26:24 am
I found out that ezc is using the sys_get_temp_dir() that usually is placed outside the root of some webhosts.
My quick fix was to just write a valid path in the processor file.

Luciano S.

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
  • iXiam Team Leader
  • CiviCRM version: 4.2+ / 4.3+ / 4.4+
  • CMS version: Drupal
  • MySQL version: 5.1+ / 5.5+
  • PHP version: 5.3+ / 5.4+
Re: EmailProcessor fails due to wrong folder?
April 24, 2012, 01:37:19 am
Hi

I'm having the same issue when executing the cron EmailProcessor.php with emailtoactivity=! in v3.4.8

What is the exact modification you have made to have this working? "write a valid path in the processor file." ?

cheers!

Thoudahl

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7.1
  • MySQL version: 5.5.15
  • PHP version: 5.3.8
Re: EmailProcessor fails due to wrong folder?
April 24, 2012, 04:35:31 am
Hi sluc23,

My dirty hack was just to write a valid path where there the EmailProcessor is using sys_get_temp_dir()
The problem is that sys_get_temp_dir() is refering to a directory not in your root directory. Therefore I wrote a path to a temp folder that I have write access for.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • EmailProcessor fails due to wrong folder?

This forum was archived on 2017-11-26.