diff -ruN roundcubemail-0.1beta2.orig/program/js/app.js roundcubemail-0.1beta2/program/js/app.js
--- roundcubemail-0.1beta2.orig/program/js/app.js	2006-08-11 14:41:51.000000000 +0200
+++ roundcubemail-0.1beta2/program/js/app.js	2006-08-18 14:35:44.000000000 +0200
@@ -397,6 +397,7 @@
                                 classname:row.className,
                                 deleted:this.env.messages[uid] ? this.env.messages[uid].deleted : null,
                                 unread:this.env.messages[uid] ? this.env.messages[uid].unread : null,
+                                junk:this.env.messages[uid] ? this.env.messages[uid].junk : null,
                                 replied:this.env.messages[uid] ? this.env.messages[uid].replied : null};
               
       // set eventhandlers to table row
@@ -3280,11 +3282,12 @@
     
     this.env.messages[uid] = {deleted:flags.deleted?1:0,
                               replied:flags.replied?1:0,
+                              junk:flags.junk?1:0,
                               unread:flags.unread?1:0};
     
     var row = document.createElement('TR');
     row.id = 'rcmrow'+uid;
-    row.className = 'message '+(even ? 'even' : 'odd')+(flags.unread ? ' unread' : '')+(flags.deleted ? ' deleted' : '');
+    row.className = 'message '+(even ? 'even' : 'odd')+(flags.unread ? ' unread' : '')+(flags.junk ? ' junk' : '')+(flags.deleted ? ' deleted' : '');
     
     if (this.in_selection(uid))
       row.className += ' selected';
diff -ruN roundcubemail-0.1beta2.orig/program/lib/imap.inc roundcubemail-0.1beta2/program/lib/imap.inc
--- roundcubemail-0.1beta2.orig/program/lib/imap.inc	2006-07-26 00:11:50.000000000 +0200
+++ roundcubemail-0.1beta2/program/lib/imap.inc	2006-08-18 13:03:14.000000000 +0200
@@ -1231,7 +1231,7 @@
 
 	/* FETCH date,from,subject headers */
 	$key="fh".($c++);
-	$request=$key." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCE)])\r\n";
+	$request=$key." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCE X-SPAM-FLAG)])\r\n";
 
 	if (!fputs($fp, $request)) return false;
 	do{
@@ -1280,6 +1280,7 @@
 			$result[$id]->from = $headers["from"];
 			$result[$id]->to = str_replace("\n", " ", $headers["to"]);
 			$result[$id]->subject = str_replace("\n", "", $headers["subject"]);
+			$result[$id]->junk = array_key_exists("x-spam-flag", $headers) ? true : false;
 			$result[$id]->replyto = str_replace("\n", " ", $headers["reply-to"]);
 			$result[$id]->cc = str_replace("\n", " ", $headers["cc"]);
 			$result[$id]->bcc = str_replace("\n", " ", $headers["bcc"]);
diff -ruN roundcubemail-0.1beta2.orig/program/steps/mail/func.inc roundcubemail-0.1beta2/program/steps/mail/func.inc
--- roundcubemail-0.1beta2.orig/program/steps/mail/func.inc	2006-08-07 18:02:07.000000000 +0200
+++ roundcubemail-0.1beta2/program/steps/mail/func.inc	2006-08-18 14:37:23.000000000 +0200
@@ -415,6 +415,10 @@
       $js_row_arr['unread'] = true;
     if ($header->answered)
       $js_row_arr['replied'] = true;
+    if ($header->junk)
+      $js_row_arr['junk'] = true;
+
+
     // set message icon  
     if ($attrib['deletedicon'] && $header->deleted)
       $message_icon = $attrib['deletedicon'];
@@ -428,10 +432,11 @@
 	// set attachment icon
     if ($attrib['attachmenticon'] && preg_match("/multipart\/m/i", $header->ctype))
       $attach_icon = $attrib['attachmenticon'];
-        
-    $out .= sprintf('<tr id="rcmrow%d" class="message%s%s %s">'."\n",
+
+    $out .= sprintf('<tr id="rcmrow%d" class="message%s%s%s %s">'."\n",
                     $header->uid,
                     $header->seen ? '' : ' unread',
+		    $header->junk ? ' junk' : '',
                     $header->deleted ? ' deleted' : '',
                     $zebra_class);    
     
@@ -542,6 +547,7 @@
 
     $a_msg_flags['deleted'] = $header->deleted ? 1 : 0;
     $a_msg_flags['unread'] = $header->seen ? 0 : 1;
+    $a_msg_flags['junk']   = $header->junk ? 1 : 0;
     $a_msg_flags['replied'] = $header->answered ? 1 : 0;
     $commands .= sprintf("this.add_message_row(%s, %s, %s, %b, %b);\n",
                          $header->uid,
diff -ruN roundcubemail-0.1beta2.orig/skins/default/mail.css roundcubemail-0.1beta2/skins/default/mail.css
--- roundcubemail-0.1beta2.orig/skins/default/mail.css	2006-07-30 12:14:19.000000000 +0200
+++ roundcubemail-0.1beta2/skins/default/mail.css	2006-08-18 13:03:14.000000000 +0200
@@ -454,6 +454,12 @@
   background-color: #FFFFFF;
 }
 
+#messagelist tr.junk
+{
+  /*font-style: oblique;*/
+  background-color: #e0ffcc;
+}
+
 #messagelist tr.selected td
 {
   font-weight: bold;
@@ -611,7 +617,7 @@
   height: 18px;
   list-style-image: none;
   list-style-type: none;
-  background: url(images/icons/attachment.png) 52px 1px no-repeat #DFDFDF; 
+  background: url(images/icons/attachment.png) 52px 1px no-repeat #DFDFDF;
   border-bottom: 1px solid #FFFFFF;
 }
 
diff -ruN roundcubemail-0.1beta2.orig/skins/default/templates/mail.html roundcubemail-0.1beta2/skins/default/templates/mail.html
--- roundcubemail-0.1beta2.orig/skins/default/templates/mail.html	2006-06-27 23:56:44.000000000 +0200
+++ roundcubemail-0.1beta2/skins/default/templates/mail.html	2006-08-18 13:03:14.000000000 +0200
@@ -56,6 +56,7 @@
 <roundcube:label name="select" />:&nbsp;
 <roundcube:button command="select-all" label="all" classAct="active" />&nbsp;
 <roundcube:button command="select-all" prop="unread" label="unread" classAct="active" />&nbsp;
+<roundcube:button command="select-all" prop="junk" label="junk" classAct="active" />&nbsp;
 <roundcube:button command="select-none" label="none" classAct="active" /> &nbsp;&nbsp;&nbsp;
 <roundcube:label name="quota" />: <roundcube:object name="quotaDisplay" />
 </div>
