Thomas Koch wrote:
> On Wednesday 07 November 2007 21:43:07 Dave Fischetti wrote:
>> Hey Gontran, Thanks for the reply.
>>
>> I don't believe anything has changed. Since seeing this error. Though
>> I am on a Dedicated Virtual Server on Media Temple. They do
>> periodically update things. But my version of EZ has remained 2007.1.1
>>
>> PHP 5 is running in CGI mode (I still have php 4 on the server
>> everywhere else. This is my only php5 script right now).
>>
>> I guess I can live with the Notice, and just silence the PHP5 notices
>> display. I just thought I might have missed something.
>>
>> The script is being called by a cron job:
>> /usr/bin/lynx -source http://www.domain.com/inbox.php5
>>
>> I guess I could silence the cron so it doesnt reply at all (thats
>> where I'm seeing the errors. In my returned cron emails)
>>
>> Thanks so much for the reply. Really appreciate it.
>>
>> Fish
>>
>>  ><>
>>
>> On Nov 7, 2007, at 1:24 AM, Gontran Zepeda wrote:
>>> In the interest of understanding your situation, please allow a
>>> question or
>>> few.
>>>
>>> % On 2007-11-07 at 00:20:53 -0500, Dave Fischetti wrote:
>>>> I'm using the MAIL component in my application. All has been running
>>>> great, but recently started receiving this error sporadically when
>>>> parsing incoming mail in a mailbox.
>>>>
>>>> <b>Notice</b>:  Trying to get property of non-object in <b>/var/www/
>>>> vhosts/domain.com/httpdocs/inbox.php5</b> on line <b>684</b><br />
>>> Has anything changed on your system relating to web services?  Have
>>> you
>>> changed the version of Components that you are using?  Which version
>>> are
>>> you using?
>>>
>>>> That line is this function:
>>>>
>>>> function formatAddress( $address )
>>>> {
>>>>     return "{$address->email}";
>>>> }
>>>>
>>>> now I'm not sure what is causing it all of a sudden, but I am seeing
>>>> spam that sometimes comes into the account that has now FROM address,
>>>> but I haven't ensured that its happening when receiving those
>>>> messages.
>>>>
>>>>
>>>> Any help would be greatly appreciated.
>>> Honestly, this seems like a harmless error message considering the
>>> circumstance you explain.  May I suggest modifying your php.ini
>>> settings to
>>> not output error level NOTICE warnings?  I believe that may cure
>>> what ails
>>> your system.
>>>
>>> Yours,
>>> --
>>> Gontran
>>> % # E Pluribus Unix
>>> % /usr/bin/fortune
>>> BOFH Excuse #254:
>>>
>>> Interference from lunar radiation
> 
> Hi Dave,
> 
> I just feel bad about ignoring the real cause of the problem. The code 
> snippet 
> you sent is not enough to analyze the problem, because we don't see where and 
> how the $address object is created.
> 
> Instead of ignoring the notice, you could for example add sth. like:
> 
> if($address instance of ezcMailAddress)
> {
>     return $address->email; // Why the { and " here?
> }
> return '';
> 
> But you should investigate, why you actually don't give an object to the 
> formatAddress function.

Hi,

As Dave said earlier, there are some spam messages with no From address. 
In this case the $address which is passed to the formatAddress is null. 
So as Thomas said, to avoid the notice you should check if $address is 
an ezcMailAddress before returning its email property.

Cheers,
Alex.

-- 
Alexandru Stanoi
eZ Components System Developer
eZ Systems | http://ez.no
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to