If it's not a header that RC fetches automatically you first need to use the hook imap_init to add the test header to the list of headers to fetch.
function test_header($args) { $args['fetch_headers'] .= " TEST"; return($args); }
Then later you can use this: $args['headers']->others['test']
Cor
List info: http://lists.roundcube.net/dev/