As mentioned check my calendar plugin hook 'messages_list'
In my case the IMAP server receives:
"IMAPD" 2156 272 "2011-01-24 09:24:28.078" "127.0.0.1" "RECEIVED: A0007 FETCH 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101 (UID RFC822.SIZE FLAGS INTERNALDATE BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE LIST-POST DISPOSITION-NOTIFICATION-TO USER-AGENT X-RC-ATTACHMENT USER-AGENT X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)])"
... X-RC-ATTACHMENT ...
and returns that header!
in init section:
$this->add_hook('messages_list', array($this, 'pass_ics_header'));
associated method:
function pass_ics_header($p){
if(is_array($p['messages'])){
foreach($p['messages'] as $message){
if($message->others['x-rc-attachment']){
$message->list_flags['extra_flags']['ics'] = 1;
}
}
}
return $p;
}