row = $row; } /* What the agent asked for - ticket, reply or retry */ public function asked(): string { return (string) $this->row['email_unprocessed_action']; } /* Its row's id, for the logs as a mailbox email's UID is */ public function uid(): int { return intval($this->row['email_unprocessed_id']); } /* The raw body (all after the headers) - the parser's last resort for an email with no text or HTML part */ public function body(): string { $parts = preg_split("/\r?\n\r?\n/", $this->contents, 2); return $parts[1] ?? ''; } /* Read, flagged - nothing to mark: it is in no mailbox */ public function flag(BackedEnum|string $flag, string $operation, bool $expunge = false): void { } /* Taken - sorted, on the ticket it went on */ public function move(string $folder, bool $expunge = false): ?int { mailUnprocessedDone($this->uid(), $this->ticket_id); return null; } }