Hi,
this is how I got it partly working:
##################################################### function init() { $this->add_hook('message_headers_output', array($this, 'headers')); }
function compose($args) {
// retrieve RC's UID
$reply_uid = $args['param']['reply_uid'];
if($reply_uid) {
// we are going to reply to some e-mail
// fetch header block
$rcube = rcube::get_instance();
$storage = $rcube->get_storage();
$header = $storage->get_raw_headers($reply_uid);
/* doesn't work:
$header = $storage->get_message_header($uid);
$message_id = $header->get('message-id');
*/
// try to "parse"
$matches = preg_match('/Message-I[dD]: (.+)/', $header,
$message_ids);
if($matches == 1) {
$args['message-id'] = $message_ids[0];
error_log("replying to " . $args['message-id']);
}
}
}
#############################################
As you see in the comment you suggested solution with calling get() doesn't work for me. I always got values like "mid:12345" with 12345 being a random(?) number, probably another ID for that e-mail.
Using the raw header I am able to get the original message ID.
Unfortunately I don't find the value from $args['message-id'] with JavaScript. Where should it be?
I am not really happy with "parsing" the mail header on my own. Any suggestions why get('message-id') doesn't work?
Daniel Böhmer