[RCD] Getting message ID for selected message/message replied to

Daniel Böhmer post at daniel-boehmer.de
Thu Apr 18 14:21:13 CEST 2013


thanks for your code snippet. I am pretty sure the hook is being called 
because when I made a typo I got an error message that the method get() could 
not be called on a non-object. It seems to me that this is a runtime error and 
thus the hook method must have been called.

> and now in javascript you can use rcmail.env.messageid variable.

Unfortunately I don't find this attribute in the rcmail.env object. I inspect 
it with Firebug. I also tried to add another variable with a static string 
just in case the result of the function is undefined or something alike. 
However I cannot get any additional attribute into rcmail.env.

	public $task = 'mail';

	function init() {
		// include our files
		// register hook for message headers being processed
		$this->add_hook('message_headers_output', array($this, 'headers'));
	// provide message ID from message header
	function headers($args) {
		$rcmail = rcube::get_instance();

		$rcmail->output->set_env('foo', 'bar');
		$rcmail->output->set_env('messageid', $args['headers']->get('message-

		// DOCUMENTATION SAYS method for this hook shall return the
		// (possibly modified) output argument
		return $args['output'];

I only know the list of available hooks found at [1]. Can you point me at 
documentation for $rcmail->output->set_env or $args['headers']. I cannot find 


Daniel Böhmer, Diplominformatiker (BA)
Freelance Software Developer

Diese E-Mail ist mit GnuPG digital signiert. Wenn GnuPG nicht verwendet 
wird, bitte die Datei "signature.asc" einfach ignorieren. //
This e-mail is digitally signed with GnuPG. If GnuPG is not used, 
please just ignore the file "signature.asc".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.roundcube.net/pipermail/dev/attachments/20130418/1e8989f6/attachment.sig>

More information about the dev mailing list