$read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
}
+
+ /******************************************************************************
+ ** Remove specified flag from specified messages
+ ******************************************************************************/
+ function sqimap_messages_remove_flag ($imap_stream, $start, $end, $flag) {
+ fputs ($imap_stream, "a001 STORE $start:$end -FLAGS (\\$flag)\r\n");
+ $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
+ }
+
+
/******************************************************************************
** Returns some general header information -- FROM, DATE, and SUBJECT
******************************************************************************/
if (strpos(strtolower(trim($line)), "charset=")) {
$pos = strpos($line, "charset=") + 8;
$charset = trim($line);
- if (strpos($line, " ", $pos) > 0) {
- $charset = substr($charset, $pos, strpos($line, " ", $pos));
+ if (strpos($line, ";", $pos) > 0) {
+ $charset = substr($charset, $pos, strpos($line, ";", $pos)-$pos);
} else {
$charset = substr($charset, $pos);
}