What Happens When Your Computer Sleeps and Wakes Up
Close your laptop, open it three hours later, and Premail will have already processed every email that arrived while you were away. No manual refresh, no missed messages. The behavior is the same whether you're on Mac, Windows, or Linux. Here's exactly how that works.
What happens when your computer sleeps
When your operating system suspends, whether that's macOS sleep, Windows Modern Standby or hibernate, or Linux suspend-to-RAM, all network connections close and background processes freeze. Premail's polling loops stop mid-cycle, and any open IMAP connections to iCloud, Gmail's History API, or Outlook's Graph API are dropped.
Before each polling cycle, Premail writes a last-polled timestamp to disk. That timestamp is the key to catching up cleanly on wake.
Catching up on wake
When your computer wakes, Premail's watchers restart and immediately detect that they've been offline. Rather than starting fresh from "now," each watcher reads the last-polled timestamp saved before sleep and fetches everything that arrived since that moment.
For iCloud accounts, Premail opens a new IMAP connection and retrieves all messages delivered after the saved timestamp. They're emitted through the classifier and your rules exactly as they would have been in real time. The whole catch-up happens before the first new-message poll, so you won't see a gap in the Activity log.
For Gmail accounts, Premail uses Google's History API to replay everything that happened since the last known history ID. If you were asleep long enough that the history window expired (Google keeps it for about a week), Premail falls back to a timestamp-based query using the same last-polled value and then resets the history cursor. Either way, no messages are skipped.
For Outlook accounts, Premail uses Microsoft Graph delta queries to fetch only the messages that arrived since the last sync. It resumes from its saved delta link and catches up before resuming normal polling.
What you'll see
On wake, the account status indicator briefly shows Reconnecting while the connection is re-established. Within a few seconds it returns to Connected and any catch-up messages appear in the Activity tab, already classified and actioned.
If the network itself takes a moment to come back after wake (common on Wi-Fi), Premail retries automatically with an increasing delay, starting at a few seconds and capping at five minutes. It will keep trying until the connection succeeds, then run the catch-up immediately.
Can anything be missed?
The only scenario that could cause a missed message is if you uninstall Premail and reinstall it after a sleep, because the saved timestamp would be lost. In normal use, with the app running continuously, the timestamp-based catch-up ensures complete coverage regardless of how long your computer was asleep.
If you're ever unsure, the Activity tab shows a log of every message Premail has processed. A healthy catch-up will show a cluster of messages with timestamps from during your sleep window, all processed at once when you woke up.