I'm close.... So close... (grin)
The filters plugin makes an IMAP query that fetches the RECEIVED lines from
the headers of every message using fputs and sqimap_read_data. But it ONLY
GETS BACK ONE HEADER.
Here's the code in question:
fputs($imap_stream, "A3999 FETCH 1:* (FLAGS BODY.PEEK[HEADER.FIELDS (RECEIVED)])\n");
$read = sqimap_read_data ($imap_stream, 'A3999', true, $response, $message);
Ok, so I tried telnet'ing to port 143 of my mailserver and did the query
myself, and it DOES answer with tons of headers. But sqimap_read_data only
returns with one header in $message. Is this correct behaviour for
sqimap_read_data? To not return the complete output from a command, but
just the first message in that output?
I already fixed the endless loop in the SPAM filter part of the code, but
it's only checking the first message's headers because of this.