barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.65k stars 459 forks source link

SEEN SINCE Issue #720

Open NathanielB2 opened 7 months ago

NathanielB2 commented 7 months ago

Environment (please complete the following information):

Your Text A clear and concise description of what you want.

I'm using cron to fetch unseen emails once per minute. The emails are orders that are made from a online ordering system for restaurants that once orders are made they send an email. THEY ALL refuse to send this data using webhook so we have no choice to fetch the data from the emails they send. I have been doing this since we all went on covid lock-down with no issues. We are on a VPS and can handle the load.

The question, I ran into something odd and I guess it's because I do not fully understand how PHP-imap is fetching the emails SEEN or UNSEEN by date. I have a test order that contains new products I need to get the data from so I wanted to run test from the test order. After the email was in the inbox I ran the test code for UNSEEN for 28 November 2023 and the order and data was shown on the screen for the echos and print_r I have placed. The issue is the email is marked seen after fetching it but when I change the code to SEEN SINCE 28 November 2023 the order email will not fetch. I have changed the date and still nothing. I then put it back to UNSEEN and marked in the email server as unseen and once I refresh its shown again and marked seen.

It does find older SEEN emails by date just not the latest ones on the current day. Is this a server time issue maybe?

Any help would be greatly appreciated.