diff -ruN roundcubemail-cvs-20060413/program/js/app.js roundcubemail-cvs-20060413.new/program/js/app.js
--- roundcubemail-cvs-20060413/program/js/app.js	2006-04-13 20:07:06.000000000 +0200
+++ roundcubemail-cvs-20060413.new/program/js/app.js	2006-08-18 10:27:50.000000000 +0200
@@ -341,6 +341,7 @@
       this.message_rows[uid] = {id:row.id, obj:row,
                                 classname:row.className,
                                 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
@@ -1491,6 +1492,7 @@
   // move selected messages to the specified mailbox
   this.move_messages = function(mbox)
     {
+
     // exit if no mailbox specified or if selection is empty
     if (!mbox || !(this.selection.length || this.env.uid) || mbox==this.env.mailbox)
       return;
@@ -2642,11 +2644,12 @@
     var even = rowcount%2;
     
     this.env.messages[uid] = {replied:flags.replied?1:0,
-                              unread:flags.unread?1:0};
+                              unread:flags.unread?1:0,
+			      junk:flags.junk?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-cvs-20060413/program/lib/imap.inc roundcubemail-cvs-20060413.new/program/lib/imap.inc
--- roundcubemail-cvs-20060413/program/lib/imap.inc	2006-03-27 21:06:30.000000000 +0200
+++ roundcubemail-cvs-20060413.new/program/lib/imap.inc	2006-08-18 10:27:11.000000000 +0200
@@ -1212,7 +1212,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{
@@ -1261,6 +1261,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"]);
@@ -2079,4 +2080,4 @@
 	return (iil_C_Expunge($conn, $folder) >= 0);
 }
 
-?>
\ No newline at end of file
+?>
diff -ruN roundcubemail-cvs-20060413/program/steps/mail/func.inc roundcubemail-cvs-20060413.new/program/steps/mail/func.inc
--- roundcubemail-cvs-20060413/program/steps/mail/func.inc	2006-04-06 19:35:04.000000000 +0200
+++ roundcubemail-cvs-20060413.new/program/steps/mail/func.inc	2006-08-18 01:32:30.000000000 +0200
@@ -394,6 +394,8 @@
       $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['unreadicon'] && !$header->seen)
@@ -406,10 +408,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);    
     
@@ -511,6 +514,7 @@
       }
 
     $a_msg_flags['unread'] = $header->seen ? 0 : 1;
+    $a_msg_flags['junk']   = $header->junk ? 1 : 0;
     $a_msg_flags['replied'] = $header->answered ? 1 : 0;
     
     if ($header->deleted)
@@ -1470,4 +1474,4 @@
   }
   
   
-?>
\ No newline at end of file
+?>
diff -ruN roundcubemail-cvs-20060413/skins/default/mail.css roundcubemail-cvs-20060413.new/skins/default/mail.css
--- roundcubemail-cvs-20060413/skins/default/mail.css	2006-04-04 23:41:22.000000000 +0200
+++ roundcubemail-cvs-20060413.new/skins/default/mail.css	2006-08-18 01:32:15.000000000 +0200
@@ -439,6 +439,12 @@
   background-color: #FFFFFF;
 }
 
+#messagelist tr.junk
+{
+  /*font-style: oblique;*/
+  background-color: #e0ffcc;
+}
+
 #messagelist tr.selected td
 {
   font-weight: bold;
diff -ruN roundcubemail-cvs-20060413/skins/default/templates/mail.html roundcubemail-cvs-20060413.new/skins/default/templates/mail.html
--- roundcubemail-cvs-20060413/skins/default/templates/mail.html	2006-03-23 23:32:47.000000000 +0100
+++ roundcubemail-cvs-20060413.new/skins/default/templates/mail.html	2006-08-18 06:50:28.000000000 +0200
@@ -54,6 +54,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>
