Index: js/app.js
===================================================================
--- js/app.js	(revision 241)
+++ js/app.js	(working copy)
@@ -2752,6 +2752,10 @@
     this.env.mailbox = mbox;
     };
 
+  this.set_message_coltypes = function(coltypes)
+  {
+    this.coltypes = coltypes;
+  };
 
   // create a table row in the message list
   this.add_message_row = function(uid, cols, flags, attachment, attop)
@@ -2784,8 +2788,9 @@
     row.appendChild(col);
 
     // add each submitted col
-    for (var c in cols)
-      {
+    for (var n = 0; n < this.coltypes.length; n++)
+    {
+      var c = this.coltypes[n];
       col = document.createElement('TD');
       col.className = String(c).toLowerCase();
       col.innerHTML = cols[c];
Index: steps/mail/func.inc
===================================================================
--- steps/mail/func.inc	(revision 241)
+++ steps/mail/func.inc	(working copy)
@@ -497,6 +497,8 @@
       && !array_search('to', $a_show_cols))
     $a_show_cols[$f] = 'to';
 
+  $commands .= sprintf("this.set_message_coltypes(%s);\n", array2js($a_show_cols));
+
   // loop through message headers
   for ($n=0; $a_headers[$n]; $n++)
     {
