tags:

views:

198

answers:

1

Using PHP 5.2.0-8+etch13 on a LeaseWeb server, I have code that process a file emailed to a certain address by picking up the email via imap. I call imap_open (checking for errors and not finding any), get the number of messages via imap_num_msg, and look over then calling imap_header on each. All runs without errors.

I then check if ('U' == $header->Unseen || 'N' == $header->Recent). This works fine on with the same code on a ModWest shared server, but does not find new messages when it should on Leaseweb and ModWest VPS servers. A print_r of a test email sent just before running the code has the header showing...

stdClass Object
(
    [date] => Tue, 24 Mar 2009 17:57:55 +0100
    [Date] => Tue, 24 Mar 2009 17:57:55 +0100
    [subject] => Data 200903
    [Subject] => Data 200903
    [in_reply_to] => <[email protected]>
    [message_id] => <[email protected]>
    [references] => <[email protected]>  <[email protected]>
    [toaddress] => [email protected]
    [to] => Array
        (
            [0] => stdClass Object
                (
                    [mailbox] => data
                    [host] => xxx.com
                )

        )

    [fromaddress] => "me" <[email protected]> 
    [from] => Array
        (
            [0] => stdClass Object
                (
                    [personal] => me
                    [mailbox] => me
                    [host] => xxx.com
                )

        )

    [reply_toaddress] => "me" <[email protected]> 
    [reply_to] => Array
        (
            [0] => stdClass Object
                (
                    [personal] => me
                    [mailbox] => me
                    [host] => xxx.com
                )

        )

    [senderaddress] => [email protected]
    [sender] => Array
        (
            [0] => stdClass Object
                (
                    [mailbox] => me
                    [host] => gmail.com
                )

        )

    [Recent] => N
    [Unseen] =>  
    [Flagged] =>  
    [Answered] =>  
    [Deleted] =>  
    [Draft] =>  
    [Msgno] =>    1
    [MailDate] => 24-Mar-2009 17:57:55 +0100
    [Size] => 8802
    [udate] => 1237913875
)
  1. Is there something I'm doing that causes this to be "read"?
  2. How can I tell that this is a "new" messsage.

Thanks, Ed

A: 

Just a shot in the dark, but could that particular method of accessing the header information on this other type of server be interpreted as being read?

jerebear