On Jan 2, 2008, at 7:21 AM, Alexandru Stanoi wrote:
> Dave Fischetti wrote:
>> Hey Derick and all...
>> I just thought I would follow up on this again and see if anyone
>> can shed any light on this. It just happened again and I'm stumped
>> as to how to prevent the script from dying when it tries to parse
>> an email that has an image path that is incorrect in the header.
>> As mentioned, this is the Warning i'm receiving (below)... any
>> help is REALLY appreciated!
>> Will just ignoring all warnings allow this to right right? not the
>> right solution, but its something? Don't think it will help though.
>> Error below.... Thanks again
>> <br />
>> <b>Warning</b>: fopen(/tmp/13420-1/cam_data/photo093.jpg) [<a
>> href='function.fopen'>function.fopen</a>]: failed to open stream:
>> No such file or directory in <b>/usr/include/php/
>> ezcomponents-2007.1.1/ Mail/src/parser/parts/file_parser.php</b> on
>> line <b>131</b><br />
>> <br />
>> <b>Warning</b>: stream_filter_append() expects parameter 1 to be
>> resource, boolean given in <b>/usr/include/php/
>> ezcomponents-2007.1.1/ Mail/src/parser/parts/file_parser.php</b> on
>> line <b>173</b><br />
>> <br />
>> <b>Fatal error</b>: Uncaught exception
>> 'ezcBaseFileNotFoundException' with message 'The file '/tmp/
>> 13420-1/cam_data/photo093.jpg' could not be found.' in /usr/
>> include/php/ezcomponents-2007.1.1/Mail/src/parts/ fileparts/
>> disk_file.php:86
>> Stack trace:
>> #0 /usr/include/php/ezcomponents-2007.1.1/Mail/src/parts/
>> file.php(93): ezcMailFile->__set('fileName', '/tmp/13420-1/
>> ca...')
>> #1 /usr/include/php/ezcomponents-2007.1.1/Mail/src/parts/fileparts/
>> disk_file.php(32): ezcMailFilePart->__construct('/tmp/13420-1/
>> ca...')
>> #2 /usr/include/php/ezcomponents-2007.1.1/Mail/src/parser/parts/
>> file_parser.php(246): ezcMailFile->__construct('/tmp/13420-1/
>> ca...')
>> #3 /usr/include/php/ezcomponents-2007.1.1/Mail/src/parser/parts/
>> multipart_parser.php(146): ezcMailFileParser->finish()
>> #4 /usr/include/php/ezcomponents-2007.1.1/Mail/src/parser/parts/
>> multipart_parser.php(180): ezcMailMultipartParser-
>> >parseBody('------ =_Part_84...')
>> #5 /usr/include/php/ezcomponents-2007.1.1/Mail/src/parser/parts/
>> rfc822_parser.php(111): ezcMailMultipartParser-
>> >parseBody('------ =_Part_ in <b>/usr/include/php/
>> ezcomponents-2007.1.1/Mail/src/parts/ fileparts/disk_file.php</b>
>> on line <b>86</b><br />
>
> Hi Dave,
>
> I opened an issue for this (http://issues.ez.no/12318) and I added a
> fix for it. The slashes (and other unsafe characters) are converted
> to underscores. This should prevent the warnings you get.
>
> The fix is in SVN for now, and it will be available in Mail 1.4.1
> release which will come out soon (later this month probably).
>
> Hope this fixes your problem.
>
> Cheers,
Alex, Thanks for this. Its really appreciated.
If you don't mind I do have one quick question about something
different. The parser has been working great for me. All users who
submit images from their phones are parsed and added to their account.
This works great for all users accept those sending emails from a
specific mobile carrier.
I check if there is an image with:
if ( get_class( $part ) === 'ezcMailFile' ) {
and when I get here, this is where I have the problem
$my_image = array_values(getimagesize($part->fileName));
For this specific carrier, I get this error every time an image is
attached:
<b>Warning</b>: array_values() [<a href='function.array-
values'>function.array-values</a>]: The argument should be an array in
<b>/var/www/vhosts/broadtexter.com/httpdocs/_maintenance/phpcgi/
inboxManager.php5</b> on line <b>671</b><br />
I realize this is probably not a EZ issue. But perhaps there's
something I should be doing differently for messages from this source.
Below is an example of the source of a message like this. I'm not sure
whats different here when compared to the other users who get parsed
no problem.
Thanks again:
Dave
Message Source below
------------------------------
MIME-Version: 1.0
Content-Type: multipart/related; type="text/html";
boundary="----=_Part_659415_20850935.1199378668689"
Importance: Normal
X-MMS-Message-Type: MM4_forward.REQ
X-Priority: 3
------=_Part_659415_20850935.1199378668689
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
Content-ID: <0000>
Content-Disposition: inline
<html>
[snip]
</html>
------=_Part_659415_20850935.1199378668689
Content-Type: text/plain; charset=utf-8; name=smiltextpartfilename0.txt
Content-Transfer-Encoding: 7bit
Content-Location: smiltextpartfilename0.txt
Content-ID: <155>
Content-Disposition: inline
msg
------=_Part_659415_20850935.1199378668689
Content-Type: image/jpeg; name=1231071650a.jpg
Content-Transfer-Encoding: base64
Content-Location:1231071650a.jpg
Content-ID: <156>
/9j/4AAQSkZJRgABAQAAAQABAAD/
2wBDAAEBAQEBAQEBAQECAQEBAgICAQECAgICAgICAgIDAgMD
AwMCAwMEBAQEBAMFBQUFBQUHBwcHBwgICAgICAgICAj/
2wBDAQEBAQICAgUDAwUHBQQFBwgICAgI
CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAj/
xAGiAAAABgIDAQAA
AAAAAAAAAAAHCAYFBAkDCgIBAAsQAAIBAgUCAwQGBgUFAQMGbwECAwQRBQYhEgAHMUETCFEiYRRx
gTKRCaEj8M
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components