phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] email/inc new_nav.js, 1.2 selectboxes.js, 1.3 hook_se


From: skwashd
Subject: [Phpgroupware-cvs] email/inc new_nav.js, 1.2 selectboxes.js, 1.3 hook_settings.inc.php, 1.5 hook_preferences.inc.php, 1.16 class.bomessage.inc.php, 1.16 class.bopreferences.inc.php, 1.25 class.bosend.inc.php, 1.13 class.bojsaddressbook.inc.php, 1.3 class.boindex.inc.php, 1.32 class.bofilters.inc.php, 1.16 class.bofolder.inc.php, 1.10 class.html_widgets.inc.php, 1.5 class.mail_dcom.inc.php, 1.12 class.mail_dcom_nntp.inc.php, 1.6 class.mail_dcom_nntp_sock.inc.php, 1.6 class.mail_dcom_imap_sock.inc.php, 1.17 class.mail_dcom_imap.inc.php, 1.23 class.mail_dcom_base.inc.php, 1.11 class.mail_dcom_base_sock.inc.php, 1.26 class.bocompose.inc.php, 1.10 class.boattach_file.inc.php, 1.6 class.boaction.inc.php, 1.19 class.mail_dcom_pop3.inc.php, 1.13 class.mail_dcom_pop3_sock.inc.php, 1.21 class.uijsaddressbook.inc.php, 1.5 class.uimessage.inc.php, 1.13 class.uiindex.inc.php, 1.24 class.uifolder.inc.php, 1.7 class.uicompose.inc.php, 1.7 class.uifilters.inc.php, 1.16 class.uipreferences.inc.php, 1.19 class.uisearch.inc.php, 1.3 ho ok_notifywindow.inc.php, 1.13 hook_notifywindow_simple.inc.php, 1.11 hook_manual.inc.php, 1.10 hook_home.inc.php, 1.58 functions.inc.php, 1.119 hook_admin.inc.php, 1.9 class.uiattach_file.inc.php, 1.4 class.ui_mail_debug.inc.php, 1.4 class.mail_msg_wrappers.inc.php, 1.40 class.mail_send.inc.php, 1.13 class.mail_msg_display.inc.php, 1.43 class.mail_msg_base.inc.php, 1.81 class.mail_filters.inc.php, 1.9 class.mail_msg.inc.php, 1.6 class.msg_bootstrap.inc.php, 1.4 class.so_mail_msg.inc.php, 1.3 class.svc_debug.inc.php, 1.3 class.svc_nextmatches.inc.php, 1.4 class.spell_svc_php.inc.php, 1.4 class.spell_svc_none.inc.php, 1.4 class.spell.inc.php, 1.4 class.spell_struct.inc.php, 1.4
Date: Mon, 14 Mar 2005 00:22:00 +0100

Update of email/inc

Modified Files:
     Branch: MAIN
            new_nav.js lines: +0 -940
            selectboxes.js lines: +0 -1024
            hook_settings.inc.php lines: +4 -4
            hook_preferences.inc.php lines: +0 -0
            class.bomessage.inc.php lines: +74 -47
            class.bopreferences.inc.php lines: +134 -107
            class.bosend.inc.php lines: +391 -831
            class.bojsaddressbook.inc.php lines: +14 -14
            class.boindex.inc.php lines: +30 -19
            class.bofilters.inc.php lines: +155 -155
            class.bofolder.inc.php lines: +18 -18
            class.html_widgets.inc.php lines: +12 -12
            class.mail_dcom.inc.php lines: +14 -14
            class.mail_dcom_nntp.inc.php lines: +2 -2
            class.mail_dcom_nntp_sock.inc.php lines: +2 -2
            class.mail_dcom_imap_sock.inc.php lines: +103 -103
            class.mail_dcom_imap.inc.php lines: +20 -3
            class.mail_dcom_base.inc.php lines: +18 -18
            class.mail_dcom_base_sock.inc.php lines: +8 -8
            class.bocompose.inc.php lines: +120 -216
            class.boattach_file.inc.php lines: +65 -133
            class.boaction.inc.php lines: +104 -229
            class.mail_dcom_pop3.inc.php lines: +0 -0
            class.mail_dcom_pop3_sock.inc.php lines: +180 -180
            class.uijsaddressbook.inc.php lines: +3 -3
            class.uimessage.inc.php lines: +79 -60
            class.uiindex.inc.php lines: +86 -64
            class.uifolder.inc.php lines: +20 -20
            class.uicompose.inc.php lines: +22 -22
            class.uifilters.inc.php lines: +141 -141
            class.uipreferences.inc.php lines: +109 -109
            class.uisearch.inc.php lines: +2 -2
            hook_notifywindow.inc.php lines: +6 -6
            hook_notifywindow_simple.inc.php lines: +2 -2
            hook_manual.inc.php lines: +0 -0
            hook_home.inc.php lines: +4 -4
            functions.inc.php lines: +2 -2
            hook_admin.inc.php lines: +0 -0
            class.uiattach_file.inc.php lines: +3 -3
            class.ui_mail_debug.inc.php lines: +139 -140
            class.mail_msg_wrappers.inc.php lines: +463 -434
            class.mail_send.inc.php lines: +0 -0
            class.mail_msg_display.inc.php lines: +81 -81
            class.mail_msg_base.inc.php lines: +397 -397
            class.mail_filters.inc.php lines: +18 -18
            class.mail_msg.inc.php lines: +0 -0
            class.msg_bootstrap.inc.php lines: +16 -16
            class.so_mail_msg.inc.php lines: +75 -75
            class.svc_debug.inc.php lines: +4 -4
            class.svc_nextmatches.inc.php lines: +19 -19
            class.spell_svc_php.inc.php lines: +0 -0
            class.spell_svc_none.inc.php lines: +0 -0
            class.spell.inc.php lines: +45 -45
            class.spell_struct.inc.php lines: +0 -0

Log Message:
should have done this a while ago - SaD code

====================================================
Index: email/inc/new_nav.js
diff -u email/inc/new_nav.js:1.1 email/inc/new_nav.js:1.2
--- email/inc/new_nav.js:1.1    Thu Mar 13 20:03:17 2003
+++ email/inc/new_nav.js        Sun Mar 13 23:22:44 2005
@@ -1,940 +0,0 @@
-<script type="text/javascript" language="javascript" 
src="phpgwapi/templates/justweb/navcond.js"></script>
-
-<script type="text/javascript" language="javascript">
-/******************************************
-* navcond.js - Condensed version of       *
-*              dhtmllib.js and navbar.js. *
-* Copyright 2000 by Mike Hall.            *
-* Web address: http://www.brainjar.com    *
-* Last update: July 17, 2000.             *
-******************************************/
-       var isMinNS4 = (navigator.appName.indexOf("Netscape")>=0 && 
parseFloat(navigator.appVersion)>=4)?1:0;
-       var isMinIE4 = (document.all)?1:0;
-       var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.")>=0)?1:0;
-
-       function hideLayer(layer) {
-               if (isMinNS4) layer.visibility = "hide";
-               if (isMinIE4) layer.style.visibility = "hidden";
-       }
-       function showLayer(layer) {
-               if (isMinNS4) layer.visibility = "show";
-               if (isMinIE4) layer.style.visibility = "visible";
-       }
-       function inheritLayer(layer) {
-               if (isMinNS4) layer.visibility = "inherit";
-               if (isMinIE4) layer.style.visibility = "inherit";
-       }
-       function getVisibility(layer) {
-               if (isMinNS4) {
-                       if (layer.visibility=="show") return "visible";
-                       if (layer.visibility=="hide") return "hidden";
-                       return layer.visibility;
-               }
-               if (isMinIE4) return layer.style.visibility;
-               return "";
-       }
-       function moveLayerTo(layer,x,y) {
-               if (isMinNS4) layer.moveTo(x,y);
-               if (isMinIE4) {
-                       layer.style.left = x;
-                       layer.style.top = y;
-               }
-       }
-       function moveLayerBy(layer,dx,dy) {
-               if (isMinNS4) {
-                       layer.moveBy(dx,dy);
-               }
-               if (isMinIE4) {
-                       layer.style.pixelLeft += dx;
-                       layer.style.pixelTop += dy;
-               }
-       }
-       function getLeft(layer) {
-               if (isMinNS4) return layer.left;
-               if (isMinIE4) return layer.style.pixelLeft;
-               return -1;
-       }
-       function getTop(layer) {
-               if (isMinNS4) return layer.top;
-               if (isMinIE4) return layer.style.pixelTop;
-               return -1;
-       }
-       function getRight(layer) {
-               if (isMinNS4) return layer.left + getWidth(layer);
-               if (isMinIE4) return layer.style.pixelLeft + getWidth(layer);
-               return -1;
-       }
-       function getBottom(layer) {
-               if (isMinNS4) return layer.top + getHeight(layer);
-               if (isMinIE4) return layer.style.pixelTop + getHeight(layer);
-               return -1;
-       }
-       function getPageLeft(layer) {
-               var x;
-               if (isMinNS4) return layer.pageX;
-               if (isMinIE4) {
-                       x = 0;
-                       while(layer.offsetParent != null) {
-                               x += layer.offsetLeft;
-                               layer = layer.offsetParent;
-                       }
-                       x += layer.offsetLeft;
-                       return x;
-               }
-               return -1;
-       }
-       function getPageTop(layer) {
-               var y;
-               if (isMinNS4) return layer.pageY;
-               if (isMinIE4) {
-                       y = 0;
-                       while (layer.offsetParent!=null) {
-                               y += layer.offsetTop;
-                               layer = layer.offsetParent;
-                       }
-                       y += layer.offsetTop;
-                       return y;
-               }
-               return -1;
-       }
-       function getWidth(layer) {
-               if (isMinNS4) {
-                       if (layer.document.width) return layer.document.width;
-                       else return layer.clip.right-layer.clip.left;
-               }
-               if (isMinIE4) {
-                       if (layer.style.pixelWidth) return 
layer.style.pixelWidth;
-                       else return layer.clientWidth;
-               }
-               return -1;
-       }
-       function getHeight(layer) {
-               if (isMinNS4) {
-                       if (layer.document.height) return layer.document.height;
-                       else return layer.clip.bottom-layer.clip.top;
-               }
-               if (isMinIE4) {
-                       if (layer.style.pixelHeight) return 
layer.style.pixelHeight;
-                       else return layer.clientHeight;
-               }
-               return -1;
-       }
-       function getzIndex(layer) {
-               if (isMinNS4) return layer.zIndex;
-               if (isMinIE4) return layer.style.zIndex;
-               return -1;
-       }
-       function setzIndex(layer,z) {
-               if (isMinNS4) layer.zIndex = z;
-               if (isMinIE4) layer.style.zIndex = z;
-       }
-       function clipLayer(layer, clipleft, cliptop, clipright, clipbottom) {
-               if (isMinNS4) {
-                       layer.clip.left = clipleft;
-                       layer.clip.top = cliptop;
-                       layer.clip.right = clipright;
-                       layer.clip.bottom = clipbottom;
-               }
-               if (isMinIE4) layer.style.clip = 'rect('+cliptop+' 
'+clipright+' '+clipbottom+' '+clipleft+')';
-       }
-       function getClipLeft(layer) {
-               if (isMinNS4) return layer.clip.left;
-               if (isMinIE4) {
-                       var str = layer.style.clip;
-                       if (!str) return 0;
-                       var clip = getIEClipValues(layer.style.clip);
-                       return(clip[3]);
-               }
-               return -1;
-       }
-       function getClipTop(layer) {
-               if (isMinNS4) return layer.clip.top;
-               if (isMinIE4) {
-                       var str = layer.style.clip;
-                       if (!str) return 0;
-                       var clip = getIEClipValues(layer.style.clip);
-                       return clip[0];
-               }
-               return-1;
-       }
-       function getClipRight(layer) {
-               if (isMinNS4) {
-                       return layer.clip.right;
-               }
-               if (isMinIE4) {
-                       var str = layer.style.clip;
-                       if (!str) return layer.style.pixelWidth;
-                       var clip = getIEClipValues(layer.style.clip);
-                       return clip[1];
-               }
-               return -1;
-       }
-       function getClipBottom(layer) {
-               if (isMinNS4) return layer.clip.bottom;
-               if (isMinIE4) {
-                       var str = layer.style.clip;
-                       if (!str) return layer.style.pixelHeight;
-                       var clip = getIEClipValues(layer.style.clip);
-                       return clip[2];
-               }
-               return -1;
-       }
-       function getClipWidth(layer)
-               if (isMinNS4) return layer.clip.width;
-               if (isMinIE4) {
-                       var str = layer.style.clip;
-                       if (!str) return layer.style.pixelWidth;
-                       var clip = getIEClipValues(layer.style.clip);
-                       return clip[1]-clip[3];
-               }
-               return -1;
-       }
-       function getClipHeight(layer) {
-               if (isMinNS4) return layer.clip.height;
-               if (isMinIE4) {
-                       var str = layer.style.clip;
-                       if (!str) return layer.style.pixelHeight;
-                       var clip = getIEClipValues(layer.style.clip);
-                       return clip[2]-clip[0];
-               }
-               return-1;
-       }
-       function getIEClipValues(str) {
-               var clip = new Array();
-               var i;
-               i = str.indexOf("(");
-               clip[0] = parseInt(str.substring(i+1,str.length),10);
-               i = str.indexOf(" ",i+1);
-               clip[1] = parseInt(str.substring(i+1,str.length),10);
-               i = str.indexOf(" ",i+1);
-               clip[2] = parseInt(str.substring(i+1,str.length),10);
-               i = str.indexOf(" ",i+1);
-               clip[3] = parseInt(str.substring(i+1,str.length),10);
-               return clip;
-       }
-       function scrollLayerTo(layer,x,y,bound) {
-               var dx = getClipLeft(layer)-x;
-               var dy = getClipTop(layer)-y;
-               scrollLayerBy(layer, -dx, -dy, bound);
-       }
-       function scrollLayerBy(layer,dx,dy,bound) {
-               var cl = getClipLeft(layer);
-               var ct = getClipTop(layer);
-               var cr = getClipRight(layer);
-               var cb = getClipBottom(layer);
-               if (bound) {
-                       if (cl+dx<0) dx = -cl;
-                       else if (cr+dx>getWidth(layer)) dx = getWidth(layer)-cr;
-                       if (ct+dy<0) dy=-ct;
-                       else if (cb+dy>getHeight(layer)) dy = 
getHeight(layer)-cb;
-               }
-               clipLayer(layer, cl+dx, ct+dy, cr+dx, cb+dy);
-               moveLayerBy(layer, -dx, -dy);
-       }
-       function setBgColor(layer,color) {
-               if (isMinNS4) layer.bgColor = color;
-               if (isMinIE4) layer.style.backgroundColor = color;
-       }
-       function setBgImage(layer,src) {
-               if (isMinNS4) layer.background.src = src;
-               if (isMinIE4) layer.style.backgroundImage = "url("+src+")";
-       }
-       function getLayer(name) {
-               if (isMinNS4) return findLayer(name,document);
-               if (isMinIE4) return eval('document.all.'+name);
-               return null;
-       }
-       function findLayer(name,doc) {
-               var i,layer;
-               for(i=0;i<doc.layers.length;i++) {
-                       layer = doc.layers[i];
-                       if (layer.name == name) {
-                               return layer;
-                       }
-                       if (layer.document.layers.length>0) {
-                               if ((layer = findLayer(name,layer.document)) != 
null) {
-                                       return layer;
-                               }
-                       }
-               }
-               return null;
-       }
-       function getImage(name) {
-               if (isMinNS4) {
-                       return findImage(name,document);
-               }
-               if (isMinIE4) {
-                       return eval('document.all.'+name);
-               }
-               return null;
-       }
-       function findImage(name,doc) {
-               var i,img;
-               for(i=0;i<doc.images.length;i++) {
-                       if (doc.images[i].name == name) return doc.images[i];
-               }
-               for(i=0;i<doc.layers.length;i++) {
-                       if ((img = findImage(name,doc.layers[i].document)) != 
null) {
-                               img.container = doc.layers[i];
-                               return img;
-                       }
-               }
-               return null;
-       }
-       function getImagePageLeft(img) {
-               var x,obj;
-               if (isMinNS4) {
-                       if (img.container != null) return img.container.pageX + 
img.x;
-                       else return img.x;
-               }
-               if (isMinIE4) {
-                       x = 0;
-                       obj = img;
-                       while(obj.offsetParent!=null) {
-                               x += obj.offsetLeft;
-                               obj = obj.offsetParent;
-                       }
-                       x += obj.offsetLeft;
-                       return x;
-               }
-               return -1;
-       }
-       function getImagePageTop(img) {
-               var y,obj;
-               if (isMinNS4) {
-                       if (img.container != null) return 
img.container.pageY+img.y;
-                       else return img.y;
-               }
-               if (isMinIE4) {
-                       y = 0;
-                       obj = img;
-                       while(obj.offsetParent != null) {
-                               y += obj.offsetTop;
-                               obj = obj.offsetParent;
-                       }
-                       y += obj.offsetTop;
-                       return y;
-               }
-               return -1;
-       }
-       function getWindowWidth() {
-               if (isMinNS4) return window.innerWidth;
-               if (isMinIE4) return document.body.clientWidth;
-               return -1;
-       }
-       function getWindowHeight() {
-               if (isMinNS4) return window.innerHeight;
-               if (isMinIE4) return document.body.clientHeight;
-               return -1;
-       }
-       function getPageWidth() {
-               if (isMinNS4) return document.width;
-               if (isMinIE4) return document.body.scrollWidth;
-               return -1;
-       }
-       function getPageHeight() {
-               if (isMinNS4) return document.height;
-               if (isMinIE4) return document.body.scrollHeight;
-               return -1;
-       }
-       function getPageScrollX() {
-               if (isMinNS4) return window.pageXOffset;
-               if (isMinIE4) return document.body.scrollLeft;
-               return -1;
-       }
-       function getPageScrollY() {
-               if (isMinNS4) return window.pageYOffset;
-               if (isMinIE4) return document.body.scrollTop;
-               return -1;
-       }
-
-       var isMinIE5_5 = (isMinIE5&&navigator.appVersion.indexOf("5.5")>=0)?1:0;
-       var navBars = new Array();
-
-       function NavBarMenuItem(text, link) {
-               this.text = text;
-               this.link = link;
-       }
-       function NavBarMenu(hdrWidth, menuWidth) {
-               this.hdrWidth = hdrWidth;
-               this.width = menuWidth;
-               this.height = 0;
-               this.items = new Array();
-               this.addItem = navBarMenuAddItem;
-       }
-       function navBarMenuAddItem(item) {
-               this.items[this.items.length] = item;
-       }
-       function NavBar(width) {
-               this.x = 0;
-               this.y = 0;
-               this.width = width;
-               this.height = 0;
-               this.align = "left";
-               this.minWidth = 0;
-               this.inverted = false;
-               this.menus = new Array();
-               this.created = false;
-               this.border = 2;
-               this.padding = 4;
-               this.separator = 1;
-               this.borderColor = "#000000";
-               this.hdrFgColor = "#000000";
-               this.hdrBgColor = "#999999";
-               this.hdrHiFgColor = "#ffffff";
-               this.hdrHiBgColor = "#666666";
-               this.itmFgColor = "#000000";
-               this.itmBgColor = "#cccccc";
-               this.itmHiFgColor = "#ffffff";
-               this.itmHiBgColor = "#000080";
-               this.hdrFontFamily = "Arial,Helvetica,sans-serif";
-               this.hdrFontStyle = "plain";
-               this.hdrFontWeight = "bold";
-               this.hdrFontSize = "10pt";
-               this.itmFontFamily = "MS Sans Serif,Arial,Helvetica,sans-serif";
-               this.itmFontStyle = "plain";
-               this.itmFontWeight = "bold";
-               this.itmFontSize = "8pt";
-               this.setSizes = navBarSetSizes;
-               this.setColors = navBarSetColors;
-               this.setFonts = navBarSetFonts;
-               this.addMenu = navBarAddMenu;
-               this.create = navBarCreate;
-               this.hide = navBarHide;
-               this.show = navBarShow;
-               this.moveTo = navBarMoveTo;
-               this.moveBy = navBarMoveBy;
-               this.getzIndex = navBarGetzIndex;
-               this.setzIndex = navBarSetzIndex;
-               this.getWidth = navBarGetWidth;
-               this.getMinWidth = navBarGetMinWidth;
-               this.getAlign = navBarGetAlign;
-               this.setAlign = navBarSetAlign;
-               this.resize = navBarResize;
-               this.invert = navBarInvert;
-               this.isInverted = navBarIsInverted;
-               this.index = navBars.length;
-               navBars[this.index] = this;
-       }
-       function navBarSetSizes(border,padding,separator) {
-               if (!this.created) {
-                       this.border = border;
-                       this.padding = padding;
-                       this.separator = separator;
-               }
-       }
-       function navBarSetColors(bdColor, hdrFgColor, hdrBgColor, hdrHiFgColor, 
hdrHiBgColor, itmFgColor, itmBgColor, itmHiFgColor, itmHiBgColor) {
-               if (!this.created) {
-                       this.borderColor = bdColor;
-                       this.hdrFgColor = hdrFgColor;
-                       this.hdrBgColor = hdrBgColor;
-                       this.hdrHiFgColor = hdrHiFgColor;
-                       this.hdrHiBgColor = hdrHiBgColor;
-                       this.itmFgColor = itmFgColor;
-                       this.itmBgColor = itmBgColor;
-                       this.itmHiFgColor = itmHiFgColor;
-                       this.itmHiBgColor = itmHiBgColor;
-               }
-       }
-       function navBarSetFonts(hdrFamily, hdrStyle,hdrWeight, hdrSize, 
itmFamily, itmStyle, itmWeight, itmSize) {
-               if (!this.created) {
-                       this.hdrFontFamily = hdrFamily;
-                       this.hdrFontStyle = hdrStyle;
-                       this.hdrFontWeight = hdrWeight;
-                       this.hdrFontSize = hdrSize;
-                       this.itmFontFamily = itmFamily;
-                       this.itmFontStyle = itmStyle;
-                       this.itmFontWeight = itmWeight;
-                       this.itmFontSize = itmSize;
-               }
-       }
-       function navBarAddMenu(menu) {
-               if (!this.created)this.menus[this.menus.length] = menu;
-       }
-       function navBarCreate() {
-               var str;
-               var i, j;
-               var norm, high, end;
-               var width, height;
-               var x, y;
-               var scrX, scrY;
-               if (this.created||(!isMinNS4 && !isMinIE4)) return;
-               str = "";
-               if (isMinIE4 && !isMinIE5) {
-                       scrX = getPageScrollX();
-                       scrY = getPageScrollY();
-                       window.scrollTo(getPageWidth(), getPageHeight());
-               }
-               if (isMinNS4) {
-                       str += '<layer 
name="navBar'+this.index+'_filler"></layer>\n<layer 
name="navBar'+this.index+'_hdrsBase">\n';
-               }
-               if (isMinIE4) {
-                       str += '<div id="navBar'+this.index+'_filler" 
style="position:absolute;"></div>\n<div id="navBar'+this.index+'_hdrsBase" 
style="position:absolute;">\n';
-               }
-               for(i=0;i<this.menus.length;i++) {
-                       norm = '<table border=0 cellpadding='+this.padding+' 
cellspacing=0'+(this.menus[i].hdrWidth>0?' 
width='+this.menus[i].hdrWidth:'')+((isMinIE4&&!isMinIE5)?' 
id="navBar'+this.index+'_tbl'+i+'"':'')+'><tr><td'+(this.menus[i].hdrWidth==0?' 
nowrap=1'+this.menus[i].hdrWidth:'')+'><span 
style="color:'+this.hdrFgColor+';font-family:'+this.hdrFontFamily+';font-size:'+this.hdrFontSize+';font-style:'+this.hdrFontStyle+';font-weight:'+this.hdrFontWeight+';">';
-                       high = '<table border=0 cellpadding='+this.padding+' 
cellspacing=0'+(this.menus[i].hdrWidth>0?' 
width='+this.menus[i].hdrWidth:'')+'><tr><td'+(this.menus[i].hdrWidth==0?' 
nowrap=1'+this.menus[i].hdrWidth:'')+'><span 
style="color:'+this.hdrHiFgColor+';font-family:'+this.hdrFontFamily+';font-size:'+this.hdrFontSize+';font-style:'+this.hdrFontStyle+';font-weight:'+this.hdrFontWeight+';">';
-                       end = '</span></td></tr></table>';
-                       if (isMinNS4) {
-                               str += '<layer 
name="navBar'+this.index+'_head'+i+'">'+norm+this.menus[i].items[0].text+end+'</layer>\n<layer
 
name="navBar'+this.index+'_headHigh'+i+'">'+high+this.menus[i].items[0].text+end+'</layer>\n<layer
 name="navBar'+this.index+'_headDummy'+i+'"></layer>\n';
-                       }
-                       if (isMinIE4) {
-                               str += '<div 
id="navBar'+this.index+'_head'+i+'" 
style="position:absolute;">'+norm+this.menus[i].items[0].text+end+'</div>\n<div 
id="navBar'+this.index+'_headHigh'+i+'" 
style="position:absolute;">'+high+this.menus[i].items[0].text+end+'</div>\n<div 
id="navBar'+this.index+'_headDummy'+i+'" style="position:absolute;">';
-                               if (isMinIE5_5) {
-                                       str += '<table cellspacing=0 
width="100%" height="100%"><tr><td>&nbsp;</td></tr></table>';
-                                       str += '</div>\n';
-                               }
-                       }
-               }
-               if (isMinNS4) {
-                       str += '</layer>\n';
-                       this.baseLayer = new Layer(this.width);
-                       this.baseLayer.document.open();
-                       this.baseLayer.document.write(str);
-                       this.baseLayer.document.close();
-               }
-               if (isMinIE4) {
-                       str += '</div>\n';
-                       str = '<div id="navBar'+this.index+'" 
style="position:absolute;left:0px;top:0px;">\n'+str+'</div>\n';
-                       document.body.insertAdjacentHTML("beforeEnd", str);
-                       this.baseLayer = getLayer("navBar"+this.index);
-               }
-               width = 0;
-               height = 0;
-               for(i=0;i<this.menus.length;i++) {
-                       this.menus[i].hdrNormLayer = 
getLayer('navBar'+this.index+'_head'+i);
-                       this.menus[i].hdrHighLayer = 
getLayer('navBar'+this.index+'_headHigh'+i);
-                       this.menus[i].hdrDmmyLayer = 
getLayer('navBar'+this.index+'_headDummy'+i);
-                       height = 
Math.max(height,getHeight(this.menus[i].hdrNormLayer));
-                       this.height = height+2*this.border;
-                       if (isMinIE4 && !isMinIE5) {
-                               width = this.menus[i].hdrWidth;
-                               if (width==0) {
-                                       width = 
eval('document.all.navBar'+this.index+'_tbl'+i+'.clientWidth');
-                               }
-                               navBarIEResizeLayer(this.menus[i].hdrNormLayer, 
width, height);
-                               navBarIEResizeLayer(this.menus[i].hdrHighLayer, 
width, height);
-                               navBarIEResizeLayer(this.menus[i].hdrDmmyLayer, 
width, height);
-                       }
-               }
-               x = this.border;
-               y = this.border;
-               for(i=0;i<this.menus.length;i++) {
-                       width = Math.max(this.menus[i].hdrWidth, 
getWidth(this.menus[i].hdrNormLayer));
-                       if (this.menus[i].width==0) {
-                               this.menus[i].width = width+2*this.border;
-                       }
-                       moveLayerTo(this.menus[i].hdrNormLayer, x, y);
-                       setBgColor(this.menus[i].hdrNormLayer, this.hdrBgColor);
-                       clipLayer(this.menus[i].hdrNormLayer, 0, 0, 
width,height);
-                       inheritLayer(this.menus[i].hdrNormLayer);
-                       moveLayerTo(this.menus[i].hdrHighLayer, x, y);
-                       setBgColor(this.menus[i].hdrHighLayer, 
this.hdrHiBgColor);
-                       clipLayer(this.menus[i].hdrHighLayer, 0, 0, 
width,height);
-                       hideLayer(this.menus[i].hdrHighLayer);
-                       moveLayerTo(this.menus[i].hdrDmmyLayer, x, y);
-                       if (isMinIE4) {
-                               navBarIEResizeLayer(this.menus[i].hdrDmmyLayer, 
width,height);
-                       }
-                       clipLayer(this.menus[i].hdrDmmyLayer,0,0,width,height);
-                       inheritLayer(this.menus[i].hdrDmmyLayer);
-                       this.menus[i].hdrDmmyLayer.highLayer = 
this.menus[i].hdrHighLayer;
-                       this.menus[i].hdrLeft = x;
-                       x += width+this.border;
-                       this.menus[i].hdrRight = x;
-               }
-               this.minWidth = x;
-               this.width = Math.max(this.minWidth, this.width);
-               moveLayerTo(this.baseLayer, this.x, this.y);
-               setBgColor(this.baseLayer, this.borderColor);
-               if (isMinIE4) {
-                       navBarIEResizeLayer(this.baseLayer, this.width, 
this.height);
-               }
-               clipLayer(this.baseLayer, 0, 0, this.width, this.height);
-               this.fillerLayer = getLayer('navBar'+this.index+'_filler');
-               moveLayerTo(this.fillerLayer, this.border, this.border);
-               setBgColor(this.fillerLayer, this.hdrBgColor);
-               width = this.width-2*this.border;
-               height = this.height-2*this.border;
-               if (isMinIE4) {
-                       navBarIEResizeLayer(this.fillerLayer, width, height);
-               }
-               clipLayer(this.fillerLayer, 0, 0, width,height);
-               inheritLayer(this.fillerLayer);
-               this.hdrsBaseLayer = getLayer('navBar'+this.index+'_hdrsBase');
-               if (this.align=="left") {
-                       this.hdrsOffsetX = 0;
-               }
-               else if (this.align=="center") {
-                       this.hdrsOffsetX = 
Math.round((this.width-this.minWidth)/2);
-               }
-               else if (this.align=="right") {
-                       this.hdrsOffsetX = this.width-this.minWidth;
-               }
-               else {
-                       this.hdrsOffsetX = Math.min(parseInt(this.align,10), 
this.width-this.minWidth);
-               }
-               moveLayerTo(this.hdrsBaseLayer, this.hdrsOffsetX, 0);
-               setBgColor(this.hdrsBaseLayer, this.borderColor);
-               if (isMinIE4) {
-                       navBarIEResizeLayer(this.hdrsBaseLayer, this.minWidth, 
this.height);
-               }
-               clipLayer(this.hdrsBaseLayer, 0, 0, this.minWidth, this.height);
-               inheritLayer(this.hdrsBaseLayer);
-               for(i=0;i<this.menus.length;i++) {
-                       this.menus[i].hdrDmmyLayer.index = this.index;
-                       this.menus[i].hdrDmmyLayer.offsetX = 
this.menus[i].hdrLeft-this.border;
-                       if 
(this.menus[i].hdrDmmyLayer.offsetX+this.menus[i].width>this.width) {
-                               this.menus[i].hdrDmmyLayer.offsetX = 
this.menus[i].hdrRight-this.menus[i].width;
-                       }
-                       this.menus[i].hdrDmmyLayer.offsetY = 
this.height-this.border;
-                       this.menus[i].hdrDmmyLayer.onmouseover = navBarHeaderOn;
-                       this.menus[i].hdrDmmyLayer.onmouseout = navBarHeaderOff;
-                       if (isMinNS4) {
-                               this.menus[i].hdrDmmyLayer.document.highLayer = 
this.menus[i].hdrHighLayer;
-                               this.menus[i].hdrDmmyLayer.document.link = 
this.menus[i].items[0].link;
-                               
this.menus[i].hdrDmmyLayer.document.captureEvents(Event.MOUSEUP);
-                               this.menus[i].hdrDmmyLayer.document.onmouseup = 
navBarItemClick;
-                       }
-                       if (isMinIE4) {
-                               this.menus[i].hdrDmmyLayer.highLayer = 
this.menus[i].hdrHighLayer;
-                               this.menus[i].hdrDmmyLayer.link = 
this.menus[i].items[0].link;
-                               this.menus[i].hdrDmmyLayer.onclick = 
navBarItemClick;
-                       }
-               }
-               norm = '<table border=0 cellpadding='+this.padding+' 
cellspacing=0 width="100%"><tr><td><span 
style="color:'+this.itmFgColor+';font-family:'+this.itmFontFamily+';font-size:'+this.itmFontSize+';font-style:'+this.itmFontStyle+';font-weight:'+this.itmFontWeight+';">';
-               high = '<table border=0 cellpadding='+this.padding+' 
cellspacing=0 width="100%"><tr><td><span 
style="color:'+this.itmHiFgColor+';font-family:'+this.itmFontFamily+';font-size:'+this.itmFontSize+';font-style:'+this.itmFontStyle+';font-weight:'+this.itmFontWeight+';">';
-               end = '</span></td></tr></table>';
-               for(i=0;i<this.menus.length;i++) {
-                       width = this.menus[i].width-2*this.border;str="";
-                       for(j=1;j<this.menus[i].items.length;j++) {
-                               if (isMinNS4)str += '<layer 
name="navBar'+this.index+'_menu'+i+'_norm'+j+'" 
width='+width+'>'+norm+this.menus[i].items[j].text+end+'</layer>\n<layer 
name="navBar'+this.index+'_menu'+i+'_high'+j+'" 
width='+width+'>'+high+this.menus[i].items[j].text+end+'</layer>\n<layer 
name="navBar'+this.index+'_menu'+i+'_dmmy'+j+'" width='+width+'></layer>\n';
-                               if (isMinIE4) {
-                                       str += '<div 
id="navBar'+this.index+'_menu'+i+'_norm'+j+'" 
style="position:absolute;width:'+width+'px;">'+norm+this.menus[i].items[j].text+end+'</div>\n<div
 id="navBar'+this.index+'_menu'+i+'_high'+j+'" 
style="position:absolute;width:'+width+'px;">'+high+this.menus[i].items[j].text+end+'</div>\n<div
 id="navBar'+this.index+'_menu'+i+'_dmmy'+j+'" 
style="position:absolute;width:'+width+'px;">';
-                                       if (isMinIE5_5) {
-                                               str += '<table cellspacing=0 
width="100%" height="100%"><tr><td>&nbsp;</td></tr></table>';
-                                       }
-                                       str += '</div>\n';
-                               }
-                       }
-                       if (isMinNS4) {
-                               this.menus[i].baseLayer = new 
Layer(this.menus[i].width);
-                               this.menus[i].baseLayer.document.open();
-                               this.menus[i].baseLayer.document.write(str);
-                               this.menus[i].baseLayer.document.close();
-                       }
-                       if (isMinIE4) {
-                               str = '<div id="navBar'+this.index+'_menu'+i+'" 
style="position:absolute;left:0px; 
top:0px;width:'+this.menus[i].width+'px;visibility:hidden;">\n'+str+'</div>\n';
-                               
document.body.insertAdjacentHTML("beforeEnd",str);
-                               this.menus[i].baseLayer = 
getLayer("navBar"+this.index+"_menu"+i);
-                       }
-               }
-               if (isMinIE4 && !isMinIE5) {
-                       window.scrollTo(x, y);
-               }
-               for (i=0;i<this.menus.length;i++) {
-                       moveLayerTo(this.menus[i].baseLayer, 
this.menus[i].hdrDmmyLayer.offsetX, this.menus[i].hdrDmmyLayer.offsetY);
-                       setBgColor(this.menus[i].baseLayer,this.borderColor);
-                       if (this.menus[i].items.length>1) {
-                               this.menus[i].hdrDmmyLayer.menuLayer = 
this.menus[i].baseLayer;
-                               if 
(isMinNS4)this.menus[i].hdrDmmyLayer.document.menuLayer = 
this.menus[i].baseLayer;
-                       }else{
-                               this.menus[i].hdrDmmyLayer.menuLayer = null;
-                               if 
(isMinNS4)this.menus[i].hdrDmmyLayer.document.menuLayer = 
this.menus[i].baseLayer;
-                       }
-                       x = this.border;
-                       y = this.border;
-                       width = this.menus[i].width-2*this.border;
-                       for(j=1;j<this.menus[i].items.length;j++) {
-                               this.menus[i].items[j].normLayer = 
getLayer('navBar'+this.index+'_menu'+i+'_norm'+j);
-                               this.menus[i].items[j].highLayer = 
getLayer('navBar'+this.index+'_menu'+i+'_high'+j);
-                               this.menus[i].items[j].dmmyLayer = 
getLayer('navBar'+this.index+'_menu'+i+'_dmmy'+j);
-                               height = 
getHeight(this.menus[i].items[j].normLayer);
-                               
moveLayerTo(this.menus[i].items[j].normLayer,x,y);
-                               
setBgColor(this.menus[i].items[j].normLayer,this.itmBgColor);
-                               
clipLayer(this.menus[i].items[j].normLayer,0,0,width,height);
-                               inheritLayer(this.menus[i].items[j].normLayer);
-                               
moveLayerTo(this.menus[i].items[j].highLayer,x,y);
-                               
setBgColor(this.menus[i].items[j].highLayer,this.itmHiBgColor);
-                               
clipLayer(this.menus[i].items[j].highLayer,0,0,width,height);
-                               hideLayer(this.menus[i].items[j].highLayer);
-                               
moveLayerTo(this.menus[i].items[j].dmmyLayer,x,y);
-                               if 
(isMinIE4)navBarIEResizeLayer(this.menus[i].items[j].dmmyLayer,width,height);
-                               
clipLayer(this.menus[i].items[j].dmmyLayer,0,0,width,height);
-                               inheritLayer(this.menus[i].items[j].dmmyLayer);
-                               this.menus[i].items[j].dmmyLayer.highLayer = 
this.menus[i].items[j].highLayer;
-                               this.menus[i].items[j].dmmyLayer.onmouseover = 
navBarItemOn;
-                               this.menus[i].items[j].dmmyLayer.onmouseout = 
navBarItemOff;
-                               if (isMinNS4) {
-                                       
this.menus[i].items[j].dmmyLayer.document.highLayer = 
this.menus[i].items[j].highLayer;
-                                       
this.menus[i].items[j].dmmyLayer.document.parentHighLayer = 
this.menus[i].hdrHighLayer;
-                                       
this.menus[i].items[j].dmmyLayer.document.menuLayer = this.menus[i].baseLayer;
-                                       
this.menus[i].items[j].dmmyLayer.document.link = this.menus[i].items[j].link;
-                                       
this.menus[i].items[j].dmmyLayer.document.captureEvents(Event.MOUSEUP);
-                                       
this.menus[i].items[j].dmmyLayer.document.onmouseup = navBarItemClick;
-                               }
-                               if (isMinIE4) {
-                                       
this.menus[i].items[j].dmmyLayer.highLayer = this.menus[i].items[j].highLayer;
-                                       
this.menus[i].items[j].dmmyLayer.parentHighLayer = this.menus[i].hdrHighLayer;
-                                       
this.menus[i].items[j].dmmyLayer.menuLayer = this.menus[i].baseLayer;
-                                       this.menus[i].items[j].dmmyLayer.link = 
this.menus[i].items[j].link;
-                                       
this.menus[i].items[j].dmmyLayer.onclick = navBarItemClick;
-                               }
-                               y += height+this.separator;
-                       }
-                       width = this.menus[i].width;
-                       height = y-this.separator+this.border;
-                       this.menus[i].baseLayer.width = this.menus[i].width;
-                       this.menus[i].baseLayer.height = height;
-                       if (isMinIE4) {
-                               navBarIEResizeLayer(this.menus[i].baseLayer, 
width, height);
-                       }
-                       clipLayer(this.menus[i].baseLayer, 0, 0, width, height);
-                       this.menus[i].baseLayer.parentHighLayer = 
this.menus[i].hdrHighLayer;
-                       this.menus[i].baseLayer.onmouseout = navBarMenuOff;
-               }
-               this.created = true;
-               this.resize(this.width);
-               showLayer(this.baseLayer);
-       }
-       function navBarHide() {
-               if (this.created)hideLayer(this.baseLayer);
-       }
-       function navBarShow() {
-               if (this.created)showLayer(this.baseLayer);
-       }
-       function navBarMoveTo(x,y) {
-               this.x = x;
-               this.y = y;
-               if (this.created) {
-                       moveLayerTo(this.baseLayer, this.x, this.y);
-               }
-       }
-       function navBarMoveBy(dx,dy) {
-               this.x += dx;
-               this.y+= dy;
-               if (this.created) moveLayerTo(this.baseLayer,this.x,this.y);
-       }
-       function navBarGetzIndex() {
-               if (this.created) return getzIndex(this.baseLayer);
-               return 0;
-       }
-       function navBarSetzIndex(z) {
-               var i;
-               if (this.created) {
-                       setzIndex(this.baseLayer,z);
-                       for(i=0;i<this.menus.length;i++) {
-                               setzIndex(this.menus[i].baseLayer,z);
-                       }
-               }
-       }
-       function navBarGetWidth() {
-               return this.width;
-       }
-       function navBarGetMinWidth() {
-               return this.minWidth;
-       }
-       function navBarGetAlign() {
-               return this.align;
-       }
-       function navBarSetAlign(align) {
-               this.align = align;
-               if (this.created)this.resize(this.width);
-       }
-       function navBarResize(width) {
-               if (this.created) {
-                       this.width = Math.max(width,this.minWidth);
-                       if (isMinIE4) {
-                               
navBarIEResizeLayer(this.fillerLayer,this.width-2*this.border,this.height-2*this.border);
-                               
navBarIEResizeLayer(this.baseLayer,this.width,this.height);
-                       }
-                       
clipLayer(this.fillerLayer,0,0,this.width-2*this.border,this.height-2*this.border);
-                       clipLayer(this.baseLayer,0,0,this.width,this.height);
-                       if (this.align=="left") {
-                               this.hdrsOffsetX = 0;
-                       } else if (this.align=="center") {
-                               this.hdrsOffsetX = 
Math.round((this.width-this.minWidth)/2);
-                       }
-                       else if (this.align=="right") {
-                               this.hdrsOffsetX = this.width-this.minWidth;
-                       }
-                       else {
-                               this.hdrsOffsetX = 
Math.min(parseInt(this.align,10),this.width-this.minWidth);
-                       }
-                       moveLayerTo(this.hdrsBaseLayer,this.hdrsOffsetX,0);
-                       for(i=0;i<this.menus.length;i++) {
-                               this.menus[i].hdrDmmyLayer.offsetX = 
this.menus[i].hdrLeft-this.border;
-                               if 
(this.hdrsOffsetX+this.menus[i].hdrDmmyLayer.offsetX+this.menus[i].width>this.width)this.menus[i].hdrDmmyLayer.offsetX
 = this.menus[i].hdrRight-this.menus[i].width;
-                       }
-               }
-               else this.width = width;
-       }
-       function navBarInvert() {
-               this.inverted =!this.inverted;
-       }
-       function navBarIsInverted() {
-               return this.inverted;
-       }
-       function navBarIEResizeLayer(layer,width,height) {
-               layer.style.pixelWidth = width;
-               layer.style.pixelHeight = height;
-       }
-       function navBarHeaderOn(e) {
-               var bar;
-               var x,y;
-               bar = navBars[this.index];
-               if (this.menuLayer!=null) {
-                       x = bar.x+bar.hdrsOffsetX+this.offsetX;
-                       y = bar.y+this.offsetY;
-                       if (bar.inverted)y = 
bar.y-this.menuLayer.height+bar.border;
-                       moveLayerTo(this.menuLayer,x,y);
-                       this.menuLayer.left = getPageLeft(this.menuLayer);
-                       this.menuLayer.top = getPageTop(this.menuLayer);
-                       this.menuLayer.right = 
this.menuLayer.left+this.menuLayer.width+1;
-                       this.menuLayer.bottom = 
this.menuLayer.top+this.menuLayer.height+1;
-               }
-               if (isMinIE4) {
-                       if (bar.activeHeader!=null&&bar.activeHeader!=this) {
-                               hideLayer(bar.activeHeader.highLayer);
-                               if 
(bar.activeHeader.menuLayer!=null)hideLayer(bar.activeHeader.menuLayer);
-                       }
-                       bar.activeHeader = this;
-               }
-               showLayer(this.highLayer);
-               if (this.menuLayer!=null)showLayer(this.menuLayer);
-       }
-       function navBarHeaderOff(e) {
-               if (this.menuLayer!=null) {
-                       if (isMinIE4) {
-                               mouseX = 
window.event.clientX+document.body.scrollLeft;
-                               mouseY = 
window.event.clientY+document.body.scrollTop;
-                       }
-                       if 
(mouseX>=this.menuLayer.left&&mouseX<=this.menuLayer.right&&mouseY>=this.menuLayer.top&&mouseY<=this.menuLayer.bottom)
 return;
-                       hideLayer(this.menuLayer);
-               }
-               hideLayer(this.highLayer);
-       }
-       function navBarMenuOff(e) {
-               if (isMinIE4) {
-                       mouseX = window.event.clientX+document.body.scrollLeft;
-                       mouseY = window.event.clientY+document.body.scrollTop;
-                       if 
(mouseX>=this.left&&mouseX<=this.right&&mouseY>=this.top&&mouseY<=this.bottom) 
return;
-               }
-               hideLayer(this);
-               hideLayer(this.parentHighLayer);
-       }
-       function navBarItemOn() {
-               showLayer(this.highLayer);
-       }
-       function navBarItemOff() {
-               hideLayer(this.highLayer);
-       }
-       function navBarItemClick(e) {
-               if (this.link=="") return true;
-               if (this.menuLayer!=null) {
-                       hideLayer(this.menuLayer);
-               }
-               if (this.parentHighLayer!=null) {
-                       hideLayer(this.parentHighLayer);
-               }
-               hideLayer(this.highLayer);
-               if (this.link.indexOf("javascript:")==0) {
-                       eval(this.link);
-               } else {
-                       window.location.href = this.link;
-               }
-               return true;
-       }
-
-       var mouseX = 0;
-       var mouseY = 0;
-       if (isMinNS4) {
-               document.captureEvents(Event.MOUSEMOVE);
-       }
-       document.onmousemove = navBarGetMousePosition;
-
-       function navBarGetMousePosition(e) {
-               if (isMinNS4) {
-                       mouseX = e.pageX;
-                       mouseY = e.pageY;
-               }
-               if (isMinIE4) {
-                       mouseX = window.event.clientX+document.body.scrollLeft;
-                       mouseY = window.event.clientY+document.body.scrollTop;
-               }
-       }
-
-       var origWidth;
-       var origHeight;
-
-       if (isMinNS4) {
-               origWidth = window.innerWidth;
-               origHeight = window.innerHeight;
-       }
-
-       window.onresize = navBarReload;
-
-       function navBarReload() {
-               if (isMinNS4 && origWidth==window.innerWidth && 
origHeight==window.innerHeight) return;
-               if (isMinIE4) {
-                       setTimeout('window.location.href = 
window.location.href',2000);
-               }
-               else window.location.href = window.location.href;
-       }
-
-</script>
-
-
-
-
-
-<script type="text/javascript" language="javascript">
-       var myNavBar1 = new NavBar(0);
-       var dhtmlMenu;
-
-       //define menu items (first parameter of NavBarMenu specifies main 
category width, second specifies sub category width in pixels)
-       //add more menus simply by adding more "blocks" of same code below
-
-       dhtmlMenu = new NavBarMenu(60, 120);
-       dhtmlMenu.addItem(new NavBarMenuItem("Home", 
"http://brick.earthlink.net/mail/index.php";));
-       myNavBar1.addMenu(dhtmlMenu);
-
-       dhtmlMenu = new NavBarMenu(60, 140);
-       dhtmlMenu.addItem(new NavBarMenuItem("Edit", ""));
-       dhtmlMenu.addItem(new NavBarMenuItem("Add new Appointment", 
"http://brick.earthlink.net/mail/index.php?menuaction=calendar.uicalendar.day";));
-       dhtmlMenu.addItem(new NavBarMenuItem("Add new Todo", 
"http://brick.earthlink.net/mail/index.php?menuaction=todo.uitodo.add";));
-       myNavBar1.addMenu(dhtmlMenu);
-
-       dhtmlMenu = new NavBarMenu(125, 140);
-       dhtmlMenu.addItem(new NavBarMenuItem("Preferences", ""));
-       dhtmlMenu.addItem(new NavBarMenuItem("General", 
"http://brick.earthlink.net/mail/preferences/index.php";));
-       dhtmlMenu.addItem(new NavBarMenuItem("Email", 
"http://brick.earthlink.net/mail/index.php?menuaction=email.uipreferences.preferences";));
-       dhtmlMenu.addItem(new NavBarMenuItem("Calendar", 
"http://brick.earthlink.net/mail/index.php?menuaction=calendar.uipreferences.preferences";));
-       dhtmlMenu.addItem(new NavBarMenuItem("Addressbook", 
"http://brick.earthlink.net/mail/index.php?menuaction=addressbook.uiaddressbook.preferences";));
-       myNavBar1.addMenu(dhtmlMenu);
-
-       dhtmlMenu = new NavBarMenu(62, 120);
-       dhtmlMenu.addItem(new NavBarMenuItem("Help", ""));
-       dhtmlMenu.addItem(new NavBarMenuItem("General", ""));
-       myNavBar1.addMenu(dhtmlMenu);
-
-       //set menu colors
-       myNavBar1.setColors("#343434", "#eeeeee", "#60707C", "#ffffff", 
"#888888", "#eeeeee", "#60707C", "#ffffff", "#777777")
-       myNavBar1.setFonts("Verdana", "Normal", "Normal", "10pt", "Verdana", 
"Normal", "Normal", "10pt");
-
-       //uncomment below line to center the menu (valid values are "left", 
"center", and "right"
-       //myNavBar1.setAlign("center")
-
-       var fullWidth;
-
-       function init() {
-               // Get width of window, need to account for scrollbar width in 
Netscape.
-               fullWidth = getWindowWidth() - (isMinNS4 && getWindowHeight() < 
getPageHeight() ? 16 : 0);
-
-               myNavBar1.moveTo(10,36);
-               myNavBar1.resize(500 /*fullWidth*/);
-               myNavBar1.setSizes(0,1,1);
-               myNavBar1.create();
-               myNavBar1.setzIndex(2);
-       }
-</script>
\ No newline at end of file

====================================================
Index: email/inc/selectboxes.js
diff -u email/inc/selectboxes.js:1.2 email/inc/selectboxes.js:1.3
--- email/inc/selectboxes.js:1.2        Fri Mar 14 04:01:54 2003
+++ email/inc/selectboxes.js    Sun Mar 13 23:22:44 2005
@@ -1,1024 +0,0 @@
-/**************************************************************************\
- * phpGroupWare - Todo list                                                 *
- * http://www.phpgroupware.org                                              *
- * Written by Alex Borges <address@hidden>                          *
- * Low Level Design also by    Dave Hall address@hidden                        
  *
- * UI Design and market research by Gerardo Ramirez address@hidden
- * Code ripped off deveral public domain and gpl sites. Credits in each 
function
- * for those
- *-----------------------------------------------                          *
- *  This program is free software; you can redistribute it and/or modify it *
- *  under the terms of the GNU General Public License as published by the   *
- *  Free Software Foundation; either version 2 of the License, or (at your  *
- *  option) any later version.                                              *
- \**************************************************************************/
-
-
-
-
-//@class box_parser
-//@abstract Class that represents a csv list of strings. Each string has to 
hold an email address
-//@discussion This object is all mine. Its an interface to parse csv lists of 
"name" <email> style
-//entries such as those found in the to,cc,bcc boxes of a webmail client.
-//Example: ["Name Of Destiny Mail"][<address@hidden>]
-//@param str The constructor takes as input the string of csv's addresses and 
immediatly
-//parses it into an array csvlist, one entry per value in the string
-function box_parser(str)
-{
-       //This is a class attribute that constitutes an array of strings
-       var csvlist;
-       var i;
-       //This is just an attribute that gets used by other functions
-       var tempstr;
-       //This is the input text, the one received as parameter by the 
constructor
-       var thetext;
-       var comma;
-       //-------------------------------------------
-       //This are class method declarations as public for each method
-
-       this.csvparse=csvparse;
-       this.get_index_of=get_index_of;
-       this.remove_entry=remove_entry;
-       this.parse_out=parse_out;
-       this.add_entry=add_entry;
-       //---------------------------------------------
-       //---------------------------------------------
-       //Attribute initializations
-       //The input string gets parsed by the csvparse method
-       //and the attribute csvlist is initialized with the
-       //array said fucntion generates
-       this.csvlist=this.csvparse(str);
-
-
-
-}
-//@function parse_out
-//@abstract Generates a string from the internal array of strings
-//@discussion This function will take the csvlist array and parse it back into 
csv....its quite simple
-//actually it just calls the toString method on the array
-function parse_out()
-{
-       return this.csvlist.toString();
-}
-
-//@function remove_entry
-//@abstract Removes an element from the csvlist array
-//@param str The string or substring that will matcha against the removed 
element
-//@discussion This function takes a  string as a parameter.
-//It will be searched as per the get_index_of method throughout the whole
-//csvlist array. When it finds the string that matches with its input,
-//it will remove it from the array.
-//POSTCONDITION: If no such string is found, this function will return -2
-function remove_entry(str)
-{
-       var index;
-       index=this.get_index_of(str);
-       if(index!=-2)
-       {
-               this.csvlist.splice(index,1);
-       }
-}
-
-//@function add_entry
-//@abstract This function takes the full thing (a string) as parameter
-//and adds it to the end of the list.
-//@param completeout The string that u want added to this object's csvlist
-//@discussion When u parse_out this object
-//this string will be appended to the resulting string
-function add_entry(completeout)
-{
-       //alert("adding"+completeout);
-       this.csvlist[this.csvlist.length]=completeout;
-}
-
-//@function get_index_of
-//@abstract This  function gets you the index number for a particular string.
-//@param str The string u want searched within each of the elements of the 
csvlist array
-//@discussion Its a free regular expression search within each string of the 
array
-//The first match is what it returns as a string
-//POSTCONDITION: If no such string is found, this function will return -2
-function get_index_of(str)
-{
-       var emailfind;
-       var i;
-       emailfind=new RegExp("(.*)("+str+")(.*)");
-       for(var i=0;i<this.csvlist.length;i++)
-       {
-               if(emailfind.test(this.csvlist[i]))
-               {
-                       //alert("str "+str+" found in index "+i+" record is 
"+this.csvlist[i]);
-                       return i;
-               }
-       }
-       //Lets avoid the 0/false problem
-       //alert("str "+str+" Not found");
-       return -2;
-}
-//@function csvparse
-//@abstract Parses a csv into an array
-//@discussion This function splits the incoming string
-//into an array, an element per csv value in it
-function csvparse(str)
-{
-       return str.split(',');
-
-}
-
-
-//@class getObj
-//@abstract An object that can search within a document object
-//any html element, div or layer
-//@param name The name of the box type element we want to search for
-//@discussion This simple functions get us whatever element we want from
-//the current document .... its pretty damn cool
-//since we can get any div regardless of browser type
-//http://www.xs4all.nl/~ppk/js/ there is the guy that made it
-
-function getObj(name)
-{
-       if (document.getElementById)
-       {
-               this.obj = document.getElementById(name);
-               this.style = document.getElementById(name).style;
-       }
-       else if (document.all)
-       {
-               this.obj = document.all[name];
-               this.style = document.all[name].style;
-       }
-       else if (document.layers)
-       {
-               this.obj = getObjNN4(document,name);
-               this.style = this.obj;
-       }
-}
-//@function getObjNN4
-//@abstract internal function that allows getObj to work with netscape4
-function getObjNN4(obj,name)
-{
-       var x = obj.layers;
-       var thereturn;
-       for (var i=0;i<x.length;i++)
-       {
-               if (x[i].id == name)
-                       thereturn = x[i];
-               else if (x[i].layers.length)
-                       var tmp = getObjNN4(x[i],name);
-               if (tmp) thereturn = tmp;
-       }
-       return thereturn;
-}
-
-//@function hider
-//@param oname The element name as per ID="name"
-//@param hidunhid A flag. If its 0, it will unhide it, if its 1 it will hide it
-//@discusion A free function that allows us to hide or unhide a box type 
element
-//such as a div or a  textarea
-function hider(oname,hidunhid)
-{
-       var DHTML = (document.getElementById || document.all || 
document.layers);
-       if (!DHTML) return;
-       var x = new getObj(oname);
-       x.style.visibility = (hidunhid) ? 'hidden' : 'visible'
-}
-
-
-
-//This code blatantly ripped off from http://javascript.internet.com/
-//@class SelObj
-//@abstract Suposedly, this represents a select box....
-//@discussion I dont understand this code throughly yet
-//i only use it for autocompletion so, dont trust this object
-//as an abstraction of the selectbox html element
-function
-SelObj (formname, selname, textname, str)
-{
-  this.formname = formname;
-  this.selname = selname;
-  this.textname = textname;
-  this.select_str = str || '';
-  this.selectArr = new Array ();
-  this.initialize = initialize;
-  this.bldInitial = bldInitial;
-  this.bldUpdate = bldUpdate;
-}
-
-function
-initialize ()
-{
-  if (this.select_str == '')
-    {
-      for (var
-          i = 0;
-          i < document.forms[this.formname][this.selname].options.length;
-          i++)
-       {
-         this.selectArr[i] =
-           document.forms[this.formname][this.selname].options[i];
-         this.select_str +=
-           document.forms[this.formname][this.selname].options[i].value +
-           ":" +
-           document.forms[this.formname][this.selname].options[i].text + ",";
-       }
-    }
-  else
-    {
-      var tempArr = this.select_str.split (',');
-      for (var i = 0; i < tempArr.length; i++)
-       {
-         var prop = tempArr[i].split (':');
-         this.selectArr[i] = new Option (prop[1], prop[0]);
-       }
-    }
-  return;
-}
-
-function
-bldInitial ()
-{
-  this.initialize ();
-  for (var i = 0; i < this.selectArr.length; i++)
-    document.forms[this.formname][this.selname].options[i] =
-      this.selectArr[i];
-  document.forms[this.formname][this.selname].options.length =
-    this.selectArr.length;
-  return;
-}
-
-function
-bldUpdate ()
-{
-  var str =
-    document.forms[this.formname][this.textname].value.replace ('^\\s*', '');
-  if (str == '')
-    {
-      this.bldInitial ();
-      return;
-    }
-  this.initialize ();
-  var j = 0;
-  pattern1 = new RegExp ("^" + str, "i");
-  for (var i = 0; i < this.selectArr.length; i++)
-    if (pattern1.test (this.selectArr[i].text))
-      document.forms[this.formname][this.selname].options[j++] =
-       this.selectArr[i];
-  document.forms[this.formname][this.selname].options.length = j;
-  if (j == 1)
-    {
-      document.forms[this.formname][this.selname].options[0].selected = true;
-//document.forms[this.formname][this.textname].value =
-//      document.forms[this.formname][this.selname].options[0].text;
-    }
-}
-//@function This function serves us to instantiate two objects
-//@discussion Both SelObj and selectMover need the formname as
-//parameter for them to function. This is where we instantiate them
-//and pass them what they need for instantiation
-//SelObj needs also the textbox to autocomplete for and the name of the 
selectbox
-//where autocompletion is supposed to happen.
-function
-setUpVisual (form, selectbox, textbox)
-{
-  obj1 = new SelObj (form, selectbox, textbox);
-  mover = new selectMover(form);
-// menuform is the name of the form you use
-// itemlist is the name of the select pulldown menu you use
-// entry is the name of text box you use for typing in
-  obj1.bldInitial ();
-  return obj1;
-}
-//@class selectMover
-//@abstract This object encapsulates many selectbox functions
-//@param formname The name of the form where all the selectboxes are.
-//All selectboxes need to be in the same form for this to work!
-//@discussion This object is very stupidly built. As i was needing function
-//I just started pushing them here. Thus, this needs braking down into
-//a bunch of objects. One interesting thing however is that
-//it does provide many generic selectbox functions that easy handling of
-//selctbox data by name. This is important because in php we almost allways
-//need selectboxes to be named like selectbox[index] so that php gives us back 
arrays
-//and, of course, form.selectbox[1] means another thing completely.
-//So this provides many functions to encapsulate that.
-//
-function
-selectMover(formname)
-{
-       //@param formname
-       //@abstract This is a class attribute, the name of the form all 
selectboxes are in
-       //-------------------
-       //Public functions declarations
-       this.formname=formname;
-       this.moveSelectedOptions=moveSelectedOptions;
-       this.killLeftOver=killLeftOver;
-       this.moveOption=moveOption;
-       this.moveAll=moveAll;
-       this.sortSelect=sortSelect;
-       this.selectToParser=selectToParser;
-       this.stringToTextbox=stringToTextbox;
-       this.numberSelectedOptions=numberSelectedOptions;
-       this.selectAll=selectAll;
-       this.getSelectedIdx=getSelectedIdx;
-       this.optionvalue=optionvalue;
-       this.option2get=option2get;
-       this.getSize=getSize;
-       this.removeSelectedFromParser=removeSelectedFromParser;
-       this.update_emails=update_emails;
-       this.removeParsedFromSelect=removeParsedFromSelect;
-       this.selectOptionOfValue=selectOptionOfValue;
-       this.unselectAll=unselectAll;
-       this.clearSelectbox=clearSelectbox;
-       //--------- End decalrations
-       //Important class attributes that get filled up with the update_emails 
method
-       //The removeParsedFromSelect and removeFromParser depend on the 
update_emails
-       //function to be called before, so it knows exactly the available 
emails that
-       //we have in the html document.... emails are a very large issue of 
this applicacion
-       //We generaly have two places where we can get them. Look at the 
discussion on this functions
-       //to know what i mean.
-       this.email_values=Array();
-       this.email_keys=Array();
-}
-//@function update_emails
-//@abstract This function will update the email_keys and email_values class 
attributes
-//@param emails a javascript array with email addresses
-//@param keys a javascript array with addressbook id's
-//@discussion Searches hidden fields from the document looking for type=hidden 
name=email[id]
-//address@hidden tags, it also receives the  emails and keys arrays that may 
be set
-//by the secondary frame given a set_destboxes event
-//PRECONDIDTION: The email and keys should be tied by array key. Where 
email[i] has an id in
-//the addressbook backend given by keys[i]
-function
-update_emails(emails,keys)
-{
-               var retstring;
-               var pseudov;
-               var selectbox;
-               var sizeextra;
-               var exlude;
-               var reg_obj;
-               var keyextractor;
-               var emailidx;
-               emailidx=0;
-               //We need to extract the keys from the forms...this keys are 
inside the name
-               //as emails[key] ....so, we need to extract it with a regexp
-               keyextractor=RegExp("^emails.?([0-9]+).?$",'g');
-               retstring="";
-               if(keys)
-               {
-                       sizeextra=keys.length;
-               }
-               else
-               {
-                       sizeextra=0;
-               }
-               //We look for emails and keys in the form
-               for(var j=0;j<document.forms[this.formname].elements.length;j++)
-               {
-                       //This regex helps us find a field with name "emails"
-                       reg_obj=RegExp(".*emails.*",'g');
-                       
if(reg_obj.test(document.forms[this.formname].elements[j].name))
-                       {
-                               //found an email[ named field, this is for us
-                               
this.email_values[emailidx]=document.forms[this.formname].elements[j].value;
-                               
this.email_keys[emailidx]=document.forms[this.formname].elements[j].name.replace(keyextractor,'$1');
-                               //alert("email,key pair found in hidden email 
"+this.email_values[emailidx]+" key "+this.email_keys[emailidx]);
-                               emailidx++;
-                       }
-                       else
-                       {
-
-                               //alert("this does not qualify as hidden good 
info "+document.forms[this.formname].elements[j].name);
-                       }
-               }
-               //Now we see if we look for emails and keys in the javascript 
arrays
-               if(sizeextra != 0)
-               {
-                       for(var i=0;i<sizeextra;i++)
-                       {
-                               this.email_values[emailidx]=emails[i];
-                               this.email_keys[emailidx]=keys[i];
-                       //      alert("email,key pair found in updated email 
"+this.email_values[emailidx]+" key "+this.email_keys[emailidx]);
-                               emailidx++;
-                       }
-               }
-//             alert("Emails updated emails-> "+this.email_values);
-//             alert("Keys updated keys-> "+this.email_keys);
-               return this.email_values;
-
-}
-//@function index_of_value
-//@param ar Array to search in
-//@param value Value to search for
-//@discussion Free function to search any value in any array
-function index_of_value(ar,value)
-{
-       for(var i=0;i<ar.length;i++)
-       {
-               //alert("Searching "+ar[i]+" != "+value);
-               if(ar[i]==value)
-               {
-                       //alert("Found key for id "+value);
-                       return i;
-               }
-       }
-       return -2;
-}
-//@function removeParsedFromSelect
-//@param select The selectbox's name from which we will remove anything not 
found in the parser
-//@param parser A parser object in which we will search all options from the 
selectbox. Every option
-//not found in the corresponding parser will be killed and buried
-//@discussion Will remove the options from the selectbox not matching
-//addresses found in the parser.... IM your daddy!!!
-//This is used when the mainframe is loaded to sync the destination boxes with 
their parsers.
-// The final efect is that, if you remove by hand from the compose destination 
textboxes, the
-//the selectboxes will not include that element for the user
-function
-removeParsedFromSelect(select,parser)
-{
-       var fromlen;
-       var tolen;
-       var j;
-       var debuggs;
-       var selidx;
-       var namelen;
-       namelen=document.forms[this.formname]['nameselect[]'].options.length;
-       fromlen=document.forms[this.formname][select].length;
-       fromlimit=fromlen;
-       for (var i = 0; i < fromlimit; i=i+1)
-       {
-               
selidx=index_of_value(this.email_keys,document.forms[this.formname][select].options[i].value);
-               if(selidx != -2)
-               {
-                       //This option is not in the parser, killit!
-                       if(parser.get_index_of(this.email_values[selidx])==-2)
-                       {
-                               //By default, put this back into the nameselect
-                               
document.forms[this.formname]['nameselect[]'].options[namelen]=new 
Option(document.forms[this.formname][select].options[i].text,
-                                                                               
                document.forms[this.formname][select].options[i].value);
-                               
document.forms[this.formname][select].options[i].text="";
-                               
document.forms[this.formname][select].options[i].value="";
-                       }
-
-               }
-
-       }
-       this.killLeftOver(document.forms[this.formname][select]);
-       this.sortSelect(select);
-       this.sortSelect('nameselect[]');
-
-}
-//@function removeSelectedFromParser
-//@param selectfrom The selectbox whose selected options are to be removed 
from the parser
-//@param parser The parser from which we will remove all matching addresses 
that have been selected
-//@discussion Will remove the selected options on a given selectbox from
-//the parser received. The update emails function shoulve been
-//called first.
-//This is used when the remove event is called for the destination boxes.
-//When u hit remove, the next chain of events happen:
-// 1.- The framework turns on the set destination boxes flag, and the remove 
selected flag
-//     and calls the go_triggers function
-// 2.- As a result, the go triggers function tells the frameset to go and 
update the destination
-//     boxes values in the server through the secondary frame
-// 3.- The server invariably returns an array of keys, emails and name of all 
the ppl selected in the destination boxes
-//      and triggers the destination boxes set event
-// 4.- As a result, the frameset updates its emails/keys/names arrays and 
calles the destination boxes set event on the
-//     mainframe.
-// 5.- Since the mainframe has the remove selected flag turned on, the 
destination boxes set event will call this function
-//     for each of the destination boxes right after calling the update_emails 
function.
-// 6.- This function will then remove from the parser all emails matching the 
selections
-//     from the destination boxes as they are being removed
-function
-removeSelectedFromParser(selectfrom,parser)
-{
-       var fromlen;
-       var tolen;
-       var j;
-       var debuggs;
-       var selidx;
-       fromlen=document.forms[this.formname][selectfrom].length;
-       fromlimit=fromlen;
-//     alert("Parser, pre removal"+parser.parse_out());
-//     Look in the selectbox for selected options
-       for (var i = 0; i < fromlimit; i=i+1)
-       {
-                       if(document.forms[this.formname][selectfrom].options[i])
-                       {
-                                       debuggs=debuggs+" 
\n"+document.forms[this.formname][selectfrom].options[i];
-                               //      alert("This is selected 
"+document.forms[this.formname][selectfrom].options[i].text+" "+
-//                                             
document.forms[this.formname][selectfrom].options[i].value);
-                               
if(document.forms[this.formname][selectfrom].options[i].selected)
-                               {
-                                       
selidx=index_of_value(this.email_keys,document.forms[this.formname][selectfrom].options[i].value);
-                                       if(selidx != -2)
-                                       {
-                                               
parser.remove_entry(this.email_values[selidx]);
-
-                                       }
-                               }
-
-                       }
-       }
-       //alert("Parser, post removal"+parser.parse_out());
-
-       return;
-}
-//@function sortSelect A selectbox sorter
-//@param selname The to-be-sorted selectbox's name
-//@Discussion
-//This robbed off the great 
http://www.mattkruse.com/javascript/selectbox/source.html
-//Um... it sorts a selectbox by option.text
-function sortSelect(selname)
-{
-       var o = new Array();
-       var nex;
-       var obj;
-       obj=document.forms[this.formname][selname];
-       if(obj.length < 1)
-       {
-               return 0;
-       }
-       for (var i=0; i<obj.options.length; i++)
-       {
-               o[o.length] = new Option( obj.options[i].text, 
obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;
-       }
-       nex = o.sort(
-                       function(a,b)
-                       {
-                               if ((a.text+"") < (b.text+""))
-                               {
-                               return -1;
-                               }
-                               if ((a.text+"") > (b.text+""))
-                               {
-                                       return 1;
-                               }
-                               return 0;
-                       }
-                 );
-
-       for (var i=0; i<nex.length; i++)
-       {
-               obj.options[i] = new Option(o[i].text, o[i].value, 
o[i].defaultSelected, o[i].selected);
-       }
-}
-//@function moveSelectedOptions
-//@param selectfrom The name of the selectbox from which we are moving options
-//@param selectto The name of the selectbox to which we are moving options
-//@Discussion
-//Will copy the options from one select box to another
-function
-moveSelectedOptions(selectfrom,selectto)
-{
-       var fromlen;
-       var tolen;
-       var j;
-       var debuggs;
-       var selidx;
-       fromlen=document.forms[this.formname][selectfrom].length;
-       tolen=document.forms[this.formname][selectto].length;
-       j=tolen;
-       fromlimit=fromlen;
-       debuggs="Select From "+selectfrom+"  Select To"+selectto;
-
-       for (var i = 0; i < fromlimit; i=i+1)
-       {
-                       if(document.forms[this.formname][selectfrom].options[i])
-                       {
-                               
if(document.forms[this.formname][selectfrom].options[i].selected)
-                               {
-                                       debuggs=debuggs+" 
\n"+document.forms[this.formname][selectfrom].options[i];
-
-                                       
document.forms[this.formname][selectto].options[j]=new 
Option(document.forms[this.formname][selectfrom].options[i].text, 
document.forms[this.formname][selectfrom].options[i].value);
-                                       j++;
-                                       
document.forms[this.formname][selectfrom].options[i].name="";
-                                       
document.forms[this.formname][selectfrom].options[i].value="";
-
-                               }
-                       }
-       }
-       //Important.... we need killleftover every time we attempt to move 
anything out of a selctbox...see bellow
-       this.killLeftOver(document.forms[this.formname][selectfrom]);
-       this.sortSelect(selectfrom);
-       this.sortSelect(selectto);
-       return;
-}
-//function moveOption
-//And THIS IS MINE..... and thus, GPL
-//Will copy the option pointed to by index
-//@param selectfrom is the name of the box from where we copy
-//@param selectto is the name of the box to where we are copying the option
-//@param fromoption depends on indexkind DEPRECATED
-//@param  indexkind is "text", fromoption has the text of the option. 
DEPRECATED
-//As this can be repeated, it will stop at the first
-//if indexkind is "value", fromoption has the value of the option
-//if indexkind is "index". fromoption has the directo position of our option
-//@discussion Actually, the last two arguments where never implemented
-//this moves the given fromoption, which is the array index to the options
-//array int he source box, to the last of the selectto selectbox
-function moveOption(selectfrom,selectto,fromoption,indexkind)
-{
-       var fromlen;
-       var tolen;
-       var j;
-       var debuggs;
-       var selidx;
-       tolen=document.forms[this.formname][selectto].length;
-       document.forms[this.formname][selectto].options[tolen]=new 
Option(document.forms[this.formname][selectfrom].options[fromoption].text, 
document.forms[this.formname][selectfrom].options[fromoption].value);
-       j++;
-       document.forms[this.formname][selectfrom].options[fromoption].name="";
-       document.forms[this.formname][selectfrom].options[fromoption].value="";
-}
-
-//@function moveAll
-//@param selectfrom Name of the selectbox we are moving from
-//@param selectto Name of the selectbox we are moving to
-//@discussion uses moveOption to move option by option all of the options in 
the
-//from selectbox into the to selectbox
-//POSTCONDITION: This function sorts and kills leftover values from both 
selectboxes
-
-function moveAll(selectfrom,selectto)
-{
-       var fromlen;
-       var tolen;
-       var j;
-       var debuggs;
-       var selidx;
-       fromlen=document.forms[this.formname][selectfrom].length;
-       tolen=document.forms[this.formname][selectto].length;
-       j=tolen;
-       fromlimit=fromlen;
-       debuggs="Select From "+selectfrom+"  Select To"+selectto;
-       for (var i = 0; i < fromlimit; i++)
-       {
-                       if(document.forms[this.formname][selectfrom].options[i])
-                       {
-                               this.moveOption(selectfrom,selectto,i,'index');
-                       }
-       }
-       this.killLeftOver(document.forms[this.formname][selectfrom]);
-       this.killLeftOver(document.forms[this.formname][selectto]);
-       this.sortSelect(selectfrom);
-       this.sortSelect(selectto);
-
-
-}
-//@function killLeftOver
-//@param selectbox a selectbox OBJECT... NOT THE NAME
-//@discussion This interesting function removes all options
-//which have a value equal to "" from the selectbox
-//This is important because until we actually call this function
-//All move operations will only set the value of the text of the moved options
-//to "".
-//The problem is that javascript is pretty week in this respect, so this is a
-//recursive function that ensures that we only have valid text values and
-//that the length of the given selectbox is correct....
-
-function killLeftOver(selectbox)
-{
-       for(var i=0; i<selectbox.options.length; i++)
-       {
-               if(selectbox.options[i].value == "")
-               {
-                       for(var j=i; j<selectbox.options.length-1; j++)
-                       {
-                               selectbox.options[j].value = 
selectbox.options[j+1].value;
-                               selectbox.options[j].text = 
selectbox.options[j+1].text;
-                               selectbox.options[j].selected=null;
-
-                       }
-
-                       var ln = i;
-                       break;
-               }
-
-       }
-
-               if(ln < selectbox.options.length)
-               {
-                       selectbox.options.length -= 1;
-                       killLeftOver(selectbox);
-               }
-}
-//@function selectToParser Perhaps should be named another way
-//@param sbox The selectbox that we are going to send into the parser
-//@param keys Array of keys sent by the framework
-//@param names corresponding names to the keys array
-//@param emails corresponding emails to the keys array
-//@param parser the destination parser
-//@discussion This is a very speciffic function, we know destination boxes 
(passed as sbox)
-//have values like 122321 which are the id numbers of the entries of the emails
-//in the contacts backend (no matter if its sql or ldap)
-//Furthermore, our phpcode passes back hidden form fields named email[122321]
-//where the number corresponds to the said uid for the selectboxe's value
-//This means that php is passing us back the corresponding emails in this 
hidden
-//values.
-//BUT, thats not all, there are times where you can have several ppl in the 
destination
-//boxes but u dont have the email info here, in this cases, the js framework 
queries
-//the php backend through the secondary frame and the 
uijsaddressbook.set_destboxes method.
-//In javascript, this happens in the primary frame template whenever the 
trigger_save_destboxes
-//function is called. This function calles the frameset's set_destboxes 
function which, in turn
-//sends the secondary frame (through a location=uri call), the url containing 
the information
-//of what the user has selected in the destination boxes.
-//We convert the destination boxes to GET values to be used on the url that 
gets passed to the secondary
-//frame using the option2get function.
-//The php method gets the sent selectboxes and saves in cache whatever we are 
sending back to it though GET
-//AND gives back the emails,names and ids of this 
missing-in-cache/missing-in-hidden people
-//It does this by outputing three arrays to the secondary frame plus the 
function destboxes_set that
-//tells the frameset it has loaded this arrays for us. The frameset gets those 
arrays into its own
-//variables expresly declared for that and calls the event_destboxes_set 
function on the main frame
-//This function selecetivly calls other functions depending on the state of 
the addressbook
-//the case where this function, selectToString gets called is when the 
addressbook needs to write
-//the destination boxes to a string where the actual comma separated list of 
name and email pairs
-//should go. For example, in the mail app, this would be the To,cc and bcc 
textboxes.
-//The original text of those destination strings is the exclude parameter, in 
which we search
-//if the email we have in the destbox is already there.... that being the 
case, we exclude it
-//from the output. The keys, names and emails parameters are the arrays the 
php framework passes
-//back. They are here so we can contstruct the email addresses even if there 
are no corresponding
-//hidden email[] field for a given selection in the destination boxes.
-function selectToParser(sbox,keys,names,emails,parser)
-{
-       var retstring;
-       var pseudov;
-       var selectbox;
-       var sizeextra;
-       var exlude;
-       var reg_obj;
-       var i;
-       var j;
-       retstring="";
-       if(keys)
-       {
-               sizeextra=keys.length;
-       }
-       else
-       {
-               sizeextra=0;
-       }
-//     alert("CAlle to selectroparser!");
-       selectbox=document.forms[this.formname][sbox];
-       if(selectbox.options.length<1)
-       {
-               return "";
-       }
-       for(var i=0;i<selectbox.options.length;i++)
-       {
-               pseudov="emails["+selectbox.options[i].value+"]";
-               for(var j=0;j<document.forms[this.formname].elements.length;j++)
-               {
-                       //find corresponding mail address
-                       
if(document.forms[this.formname].elements[j].name==pseudov)
-                       {
-//                     alert("document length 
"+document.forms[this.formname].elements.length+" j = "+j+" slectbox ln 
"+selectbox.options.length+
-               //              "selectbox value "+selectbox.options[i].value+" 
i= "+i);
-                               
if(document.forms[this.formname].elements[j].value != "undefined")
-                               {
-                                       
if(document.forms[this.formname].elements[j].value == "")
-                                       {
-                                               alert("Contact 
"+selectbox.options[i].text+" \n has no email field in your addressbook 
record");
-                                       }
-                                       else
-                                       {
-                                               
if(parser.get_index_of(document.forms[this.formname].elements[j].value) == -2)
-                                               {
-                                                       
parser.add_entry(appendmailstring("","",selectbox.options[i].text,document.forms[this.formname].elements[j].value));
-                                               }
-                                       }
-                               }
-                               if(sizeextra > 0)
-                               {
-                                       for(var k=0;k<sizeextra;k++)
-                                       {
-                                               
if(keys[k]==selectbox.options[i].value)
-                                               {
-                                               keys[k]=-33;
-                                               }
-                                       }
-                               }
-
-                       }
-               }
-       }
-       if(sizeextra > 0)//we have extra info to build
-       {
-               for(var k=0;k<sizeextra;k++)
-               {
-                       if(keys[k] != -33)
-                       {
-                               if(parser.get_index_of(emails[k]) == -2)
-                               {
-                                       
parser.add_entry(appendmailstring("","",names[k],emails[k]));
-                               }
-
-                       }
-               }
-       }
-       return parser;
-}
-//@function appendmailstring
-//@param st the appended string
-//@param comma just the separator between the st, and what we are building
-//@param name should be the name as in "name" <email>
-//@param email should be the email as in "name" <email>
-//@discussion Auxiliary to the previous function. This one builds propper 
email addreses
-//as per "name" <email>
-function appendmailstring(st,comma,name,email)
-{
-       return st+comma+'"'+name+'" <'+email+'>';
-
-}
-//@function stringToTextbox
-//@param str The string we are setting
-//@param tbox An input of type textbox object (real form element)
-//@discussion We just kill leftover commas and set the value of the textbox to 
the input string
-function stringToTextbox(str,tbox)
-{
-       var commakill;
-       commakill=/^,(.*)$/;
-       tbox.value=str.replace(commakill,"$1");
-}
-//@function numberSelectedOptions
-//@param selbox The name of the selectbox
-//@discussion We use this to count the number of selected options in the given 
select box
-function numberSelectedOptions(selbox)
-{
-       var len;
-       var sbox;
-       var j;
-       sbox=document.forms[this.formname][selbox];
-       len=sbox.options.length;
-       if(len<1)
-       {
-               return "";
-       }
-       j=0;
-       for(var i=0;i<len;i++)
-       {
-               if(sbox.options[i].selected)
-               {
-                       j++;
-               }
-       }
-       return j;
-}
-//@function option2get
-//@param selbox The name of the selectbox
-//@discussion
-//We use this function to turn all options of a selectbox into GET parameters
-//for the php server backend. For example, the toselectbox[] select box's 
options
-//would reach the server as a toselectbox[] array in HTTP_POST_VAR
-//We turn that into HTTP_GET_VAR variables by building a GET variable style
-//array for the selectbox.
-//ATTENTION: This does NOT discriminate between selected options or not,
-//it takes  all of the options....
-function option2get(selbox)
-{
-       var len;
-       var sbox;
-       var j;
-       var retstr;
-       retstr='';
-       sbox=document.forms[this.formname][selbox];
-       len=sbox.options.length;
-       if(len<1)
-       {
-               return "";
-       }
-       for(var i=0;i<len;i++)
-       {
-               retstr=retstr+"&";
-               
retstr=retstr+selbox+"["+sbox.options[i].value+"]="+sbox.options[i].text;
-       }
-       return retstr;
-}
-//@function selectAll
-//@param selbox the selectboxe's name
-//@discussion It selects all options within a selectbox
-
-function selectAll(selbox)
-{
-       var len;
-       var sbox;
-       var j;
-       sbox=document.forms[this.formname][selbox];
-       len=sbox.options.length;
-       if(len<1)
-       {
-               return "";
-       }
-       for(var i=0;i<len;i++)
-       {
-                       sbox.options[i].selected=1;
-       }
-}
-//@function unselectAll
-//@param selbox the selectbox's name
-//@discussion This function unselects all values on a selectbox
-function unselectAll(selbox)
-{
-       var len;
-       var sbox;
-       var j;
-       sbox=document.forms[this.formname][selbox];
-       len=sbox.options.length;
-       if(len<1)
-       {
-               return "";
-       }
-       for(var i=0;i<len;i++)
-       {
-                       sbox.options[i].selected=0;
-       }
-}
-//@function selectOptionOfValue
-//@param selbox the selectbox's name
-//@param value the value we are looking for
-function selectOptionOfValue(selbox,value)
-{
-       var len;
-       var sbox;
-       var j;
-       sbox=document.forms[this.formname][selbox];
-       len=sbox.options.length;
-       if(len<1)
-       {
-               return "";
-       }
-       for(var i=0;i<len;i++)
-       {
-                       if(sbox.options[i].value==value)
-                       {
-                               sbox.options[i].selected=1;
-                               return true;
-                       }
-       }
-       return false;
-
-}
-//@param selbox the selectbox's name
-//@discussion This function unselects all values on a selectbox
-function unselectAll(selbox)
-{
-       var len;
-       var sbox;
-       var j;
-       sbox=document.forms[this.formname][selbox];
-       len=sbox.options.length;
-       if(len<1)
-       {
-               return "";
-       }
-       for(var i=0;i<len;i++)
-       {
-                       sbox.options[i].selected=0;
-       }
-}
-//@function clearSelectbox
-//@param selbox the selectbox's name
-//@discussion Sets all values of a selectbox to ""
-//POSTCONDITION: U MUST call killLeftOver on the selectbox after calling this
-//if you want NO option elements in the selectbox
-function clearSelectbox(selbox)
-{
-       var len;
-       var sbox;
-       var j;
-       sbox=document.forms[this.formname][selbox];
-       len=sbox.options.length;
-       if(len<1)
-       {
-               return "";
-       }
-       for(var i=0;i<len;i++)
-       {
-               sbox.options[i].value="";
-       }
-
-}
-//@function getSize
-//@param sbox The name of the selectbox
-//@discussion Returns the number of options in the selectbox
-function getSize(sbox)
-{
-       return document.forms[this.formname][sbox].options.length;
-}
-//@function getSelectedIdx
-//@param selbox The name of the selectbox
-//@discussion Returns the selected index as normal js selectedIndex call
-//We only use this because we use funny names for our selectboxes
-function getSelectedIdx(selbox)
-{
-       var len;
-       var sbox;
-       var j;
-       sbox=document.forms[this.formname][selbox];
-       return sbox.selectedIndex;
-}
-//@function optionvalue
-//@param selectbox The name of the selectbox
-//@param selectedidx The index of the selected option
-//@discussion Returns the value of the option pointed to by selectedidx
-function optionvalue(selectbox,selectedidx)
-{
-       var sbox;
-       sbox=document.forms[this.formname][selectbox];
-       return sbox.options[selectedidx].value;
-}

====================================================
Index: email/inc/hook_settings.inc.php
diff -u email/inc/hook_settings.inc.php:1.4 email/inc/hook_settings.inc.php:1.5
--- email/inc/hook_settings.inc.php:1.4 Thu Dec 30 23:13:50 2004
+++ email/inc/hook_settings.inc.php     Sun Mar 13 23:22:44 2005
@@ -17,7 +17,7 @@
        if ($acctnum)
        {
                create_check_box('enable this email 
account','ex_account_enabled',
-                       'THIS PREF CURRENTLY DOES NOTHING<br>Users may have 
more than one email account. In the future it is anticipated that automatic 
actions may be performedon these accounts, such as automatic new mail checks, 
auto filtering, etc... Perhaps the user may want to disable an account so that 
these automatic actions do not occur for that account. This is one possible 
use.<br>Also, an admin may want to disable accounts from time to time.');
+                       'THIS PREF CURRENTLY DOES NOTHING<br />Users may have 
more than one email account. In the future it is anticipated that automatic 
actions may be performedon these accounts, such as automatic new mail checks, 
auto filtering, etc... Perhaps the user may want to disable an account so that 
these automatic actions do not occur for that account. This is one possible 
use.<br />Also, an admin may want to disable accounts from time to time.');
        }
        create_input_box('Account Name','account_name',
                'This is the name that appears in the account combobox. If for 
leave this blank, your accounts will be given a standard name like Account[1]: 
Jane Doe, where Jane Doe is the name you give below as "Your full name". If you 
want to give an account a special name you can fill this in. No matter what, 
this is for your use, your emails will still use "Your full name" as your FROM 
name for email messages. Note that "Your full name" for your email account 0 is 
the name you gave in the phpgroupware setup.');
@@ -77,7 +77,7 @@
                        'ReplyTo' => lang('ReplyTo')
                );
                create_select_box('Show sender\'s email address with 
name','show_addresses',$options,
-                       'This confusing and often misunderstood option is left 
over from this email apps origins as Aeromail by Mark Cushman. When viewing a 
list of emails in a folder, the FROM column may show you<br>a) the senders name 
only, if a name was provided,<br>b) the senders From email address, in addition 
to the senders name, or<br>c) the senders reply to address if it is different 
from the senders<br>from address, in addition to the senders name if it was 
provided. Typically users set this to none, which will show only the senders 
name. If no name was supplied by the sender, then the senders FROM email 
address will be shown, whether a seperate reply to address is provided has no 
effect on this, the FROM address is always used if the senders name is not 
provided.');
+                       'This confusing and often misunderstood option is left 
over from this email apps origins as Aeromail by Mark Cushman. When viewing a 
list of emails in a folder, the FROM column may show you<br />a) the senders 
name only, if a name was provided,<br />b) the senders From email address, in 
addition to the senders name, or<br />c) the senders reply to address if it is 
different from the senders<br />from address, in addition to the senders name 
if it was provided. Typically users set this to none, which will show only the 
senders name. If no name was supplied by the sender, then the senders FROM 
email address will be shown, whether a seperate reply to address is provided 
has no effect on this, the FROM address is always used if the senders name is 
not provided.');

                create_check_box('show new messages on main 
screen','mainscreen_showmail',
                        'Each user has a summary page which can display a 
variety of information. This option will show a small list of email messages in 
the INBOX of the users default email account onthe users summary home page.');
@@ -105,7 +105,7 @@
                'lex' => lang('Javascript')
        );
        create_select_box('Select your style for the addressbook. The 
traditional, simple style. Or the new javascript enabled complex addressbook',
-               'addressbook_choice',$options,'We have recently added this new 
addressbook so that users can choose to have a more complex addressbook that 
features<br>a) Easy, point and click searching,<br>b) Best suited for 
organizations with large central addressbooks with many categories.<br>You can 
choose here which addressbook do you prefer.');
+               'addressbook_choice',$options,'We have recently added this new 
addressbook so that users can choose to have a more complex addressbook that 
features<br />a) Easy, point and click searching,<br />b) Best suited for 
organizations with large central addressbooks with many categories.<br />You 
can choose here which addressbook do you prefer.');

        $options = array(
                '900' =>'1200x1600',

====================================================

====================================================
Index: email/inc/class.bomessage.inc.php
diff -u email/inc/class.bomessage.inc.php:1.15 
email/inc/class.bomessage.inc.php:1.16
--- email/inc/class.bomessage.inc.php:1.15      Thu Dec 30 23:13:50 2004
+++ email/inc/class.bomessage.inc.php   Sun Mar 13 23:22:43 2005
@@ -51,6 +51,8 @@
                //var $show_debug_parts_summary=1;

                var $debug_nav = 0;
+
+               var $flags = array();

                // prefs should fill this in with users preference
                //var $icon_theme='evo';
@@ -73,7 +75,7 @@
                */
                function bomessage()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.bomessage.*constructor*'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.bomessage.*constructor*'.'<br />'; }

                        // should "msg_bootstrap" code go here?

@@ -95,6 +97,7 @@
                        $this->xi['lang_reply_all'] = lang('reply all');
                        $this->xi['lang_forward'] = lang('forward');
                        $this->xi['lang_delete'] = lang('delete');
+                       $this->xi['lang_edit'] = lang('edit');
                        $this->xi['lang_view_headers'] = lang('view headers');
                        $this->xi['lang_view_raw_message'] = lang('raw 
message');
                        $this->xi['lang_message'] = lang('message');
@@ -169,7 +172,7 @@

                        if ($this->debug > 2) { echo 
'class.bomessage.*constructor* ('.__LINE__.'): langs put in $this->xi 
DUMP:<pre>'; print_r($this->xi); echo '</pre>'; }

-                       if ($this->debug > 0) { echo 'LEAVING: 
email.bomessage.*constructor*'.'<br>'; }
+                       if ($this->debug > 0) { echo 'LEAVING: 
email.bomessage.*constructor*'.'<br />'; }

                        // also, this "return" *may* (need to check) effect 
constructor of a a inherit-ee roll thru the constructoes
                        // uncomment the return when we understand implications 
of it geing here.
@@ -194,7 +197,7 @@
                                $this->msg =& $GLOBALS['phpgw']->msg;
                        }
                        // now we can use msg object debug calls
-                       if ($this->debug > 0) { 
$this->msg->dbug->out('ENTERING: 
email.bomessage.message_data('.__LINE__.')'.'<br>'); }
+                       if ($this->debug > 0) { 
$this->msg->dbug->out('ENTERING: 
email.bomessage.message_data('.__LINE__.')'.'<br />'); }


                        // ---- BEGIN BOMESSAGE ----
@@ -333,10 +336,17 @@
                                // expire the cached "phpgw_header" for this 
specific message,
                                // cached data says the message is unseen, yet 
we are about to see it right now!
                                $specific_key = 
(string)$msgball['msgnum'].'_'.$msgball['folder'];
-                               if ($this->debug > 1) { echo 
'email.bomessage.message_data: cached SEEN-UNSEEN "phpgw_header" needs expired 
this specific message we are about to VIEW, $specific_key 
['.$specific_key.']<br>'; }
+                               if ($this->debug > 1) { echo 
'email.bomessage.message_data: cached SEEN-UNSEEN "phpgw_header" needs expired 
this specific message we are about to VIEW, $specific_key 
['.$specific_key.']<br />'; }
                                
$GLOBALS['phpgw']->msg->expire_session_cache_item('phpgw_header', 
$msgball['acctnum'], $specific_key);
                        }
                        */
+
+                       $this->flags = array( //we only grab the important ones 
:)
+                                       'Flagged'       => 
$msg_headers->Flagged == 'F',
+                                       'Answered'      => 
$msg_headers->Answered == 'A',
+                                       'Deleted'       => 
$msg_headers->Deleted == 'D',
+                                       'Draft'         => $msg_headers->Draft 
== 'X'
+                                       );

                        $folder_info = array();
                        $folder_info = 
$GLOBALS['phpgw']->msg->get_folder_status_info();
@@ -356,7 +366,7 @@
                        {
                                $msg_date2 = substr($msg_date2,$comma + 2);
                        }
-                       //echo 'Msg Date : '.$msg_date."<br>\n";
+                       //echo 'Msg Date : '.$msg_date."<br />\n";
                        $dta = array();
                        $ta = array();

@@ -389,11 +399,11 @@
 $new_time2=gmdate("D, d M Y H:m:s",$new_time)." GMT";
 $msg_headers->date = $new_time2;
 $msg_headers->udate = $new_time;
-#echo("<br>Hora cojonuda: $new_time2");
-#echo"udate $msg_headers->udate<br>";
-#echo"date $msg_headers->date<br>";
-#echo"$new_time<br>";
-#echo("estamos en bomessage 589<br>");
+#echo("<br />Hora cojonuda: $new_time2");
+#echo"udate $msg_headers->udate<br />";
+#echo"date $msg_headers->date<br />";
+#echo"$new_time<br />";
+#echo("estamos en bomessage 589<br />");
 # end GMT handling by "acros"
                        */

@@ -502,7 +512,7 @@

                        }

-                       //if ($this->debug > 0) { echo 'messages.php step3 
$nav_data[] $ilnk_prev_msg: '.$ilnk_prev_msg.'<br>'; }
+                       //if ($this->debug > 0) { echo 'messages.php step3 
$nav_data[] $ilnk_prev_msg: '.$ilnk_prev_msg.'<br />'; }

                        // ----  "Go To Next Message" Handling  -----
                        // should be moved to emil / class.svc_nextmatches
@@ -527,7 +537,7 @@
                                $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->img_maketag($GLOBALS['phpgw']->msg->_image_on('email',$this->icon_theme.'/arrow-right-no-24','_on'),$this->xi['lang__no_next_message'],'','','0');
                        }

-                       //if ($this->debug > 0) { echo 'messages.php step4 
$nav_data[] $ilnk_next_msg: '.$ilnk_next_msg.'<br>'; }
+                       //if ($this->debug > 0) { echo 'messages.php step4 
$nav_data[] $ilnk_next_msg: '.$ilnk_next_msg.'<br />'; }

                        // these are HREF clickable text for prev and next text 
navigation
                        $this->xi['href_prev_msg'] = $href_prev_msg;
@@ -946,8 +956,23 @@
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start')
                                        .$this->no_fmt);
+
                        $href_delete= 
$GLOBALS['phpgw']->msg->href_maketag_class($delete_url, 
$this->xi['lang_delete'], 'c_replybar');
                        $ilnk_delete = 
$GLOBALS['phpgw']->msg->href_maketag($delete_url, $delete_img);
+
+                       $edit_img = 
$GLOBALS['phpgw']->msg->img_maketag($GLOBALS['phpgw']->msg->_image_on('email',$this->icon_theme.'/compose-message-'.$this->icon_size,'_on'),$this->xi['lang_edit'],'','','0');
+                       $edit_url =  $GLOBALS['phpgw']->link(
+                                       '/index.php',
+                                        'menuaction=email.uicompose.compose'
+                                       .'&action=edit'
+                                       .'&'.$msgball['uri']
+                                       .$first_presentable
+                                       // preserve these things for when we 
return to the message list after the send
+                                       
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
+                                       
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
+                                       
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
+                       $href_edit = 
$GLOBALS['phpgw']->msg->href_maketag_class($edit_url, $this->xi['lang_edit'], 
'c_replybar');
+                       $ilnk_edit = 
$GLOBALS['phpgw']->msg->href_maketag($edit_url, $edit_img);

                        $this->xi['theme_font'] = 
$GLOBALS['phpgw_info']['theme']['font'];
                        $this->xi['reply_btns_bkcolor'] = 
$GLOBALS['phpgw_info']['theme']['em_folder'];
@@ -958,10 +983,12 @@
                        $this->xi['href_replyall'] = $href_replyall;
                        $this->xi['href_forward'] = $href_forward;
                        $this->xi['href_delete'] = $href_delete;
+                       $this->xi['href_edit'] = $href_edit;
                        $this->xi['ilnk_reply'] = $ilnk_reply;
                        $this->xi['ilnk_replyall'] = $ilnk_replyall;
                        $this->xi['ilnk_forward'] = $ilnk_forward;
                        $this->xi['ilnk_delete'] = $ilnk_delete;
+                       $this->xi['ilnk_edit'] = $ilnk_edit;

                        // ---- DEBUG: Show Information About Each Part  -----
                        if ($this->show_debug_parts_summary > 0)
@@ -1219,7 +1246,7 @@
                        $count_part_nice = count($this->part_nice);
                        for ($i = 0; $i < $count_part_nice; $i++)
                        {
-                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): disp loop: 
'.($i+1).' of '.$count_part_nice.'<br>'); }
+                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): disp loop: 
'.($i+1).' of '.$count_part_nice.'<br />'); }
                                if ($this->debug > 3) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: 
$this->part_nice[$i] DUMP:', $this->part_nice[$i]); }
                                // Do We Break out of this Loop Block
                                if ($done_processing)
@@ -1241,7 +1268,7 @@
                                &&  (($this->part_nice[$i]['m_description'] == 
'container')
                                || ($this->part_nice[$i]['m_description'] == 
'packagelist')) )
                                {
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: 
"Mime-Ignorant Email Server", Num Parts is 1 AND part is a container OR 
packagelist <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: 
"Mime-Ignorant Email Server", Num Parts is 1 AND part is a container OR 
packagelist <br />'); }

                                        // ====  MIME IGNORANT SERVER  ====
                                        $title_text = '&nbsp;Mime-Ignorant 
Email Server: ';
@@ -1269,20 +1296,20 @@
                                        }
                                        $boundary = trim($boundary);
                                        /*
-                                       $dsp = '<br><br> === API STRUCT ==== 
<br><br>'
+                                       $dsp = '<br /><br /> === API STRUCT 
==== <br /><br />'
                                                
.'<pre>'.serialize($msg_struct).'</pre>'
-                                               //.'<br><br> === HEADERS ==== 
<br><br>'
+                                               //.'<br /><br /> === HEADERS 
==== <br /><br />'
                                                
//.'<pre>'.$msg_raw_headers.'</pre>'
-                                               .'<br><br> === 
struct->parameters ==== <br><br>'
+                                               .'<br /><br /> === 
struct->parameters ==== <br /><br />'
                                                
.'<pre>'.serialize($msg_struct->parameters).'</pre>'
-                                               .'<br><br> === BOUNDRY ==== 
<br><br>'
+                                               .'<br /><br /> === BOUNDRY ==== 
<br /><br />'
                                                
.'<pre>'.serialize($boundary).'</pre>'
-                                               .'<br><br> === BODY ==== 
<br><br>';
+                                               .'<br /><br /> === BODY ==== 
<br /><br />';
                                                
.'<pre>'.serialize($msg_body).'</pre>';
                                        */
-                                       $dsp = '<br> === BOUNDRY ==== <br>'
-                                               .'<pre>'.$boundary.'</pre> <br>'
-                                               .'<br> === BODY ==== <br><br>';
+                                       $dsp = '<br /> === BOUNDRY ==== <br />'
+                                               .'<pre>'.$boundary.'</pre> <br 
/>'
+                                               .'<br /> === BODY ==== <br 
/><br />';
                                        $this_msgball = $msgball;
                                        $this_msgball['part_no'] = 
$this->part_nice[$i]['m_part_num_mime'];
                                        $dsp .= 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($this_msgball);
@@ -1303,7 +1330,7 @@
                                && (($this->part_nice[$i]['m_part_num_mime'] == 
1) || ((string)$this->part_nice[$i]['m_part_num_mime'] == '1.1'))
                                && ((int)$this->part_nice[$i]['bytes'] > 
$force_echo_size))
                                {
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: ECHO 
OUT: part meets five criteria <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: ECHO 
OUT: part meets five criteria <br />'); }

                                        $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
                                        $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
@@ -1355,7 +1382,7 @@
                                // enriched = part of APPLE MAIL multipart / 
alternative subpart where the html part usually is
                                // HOWEVER enriched is not complete html so it 
will not render anything special in a browser so we can NOT treat enriched like 
html
                                {
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is HTML, presentable <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is HTML, presentable <br />'); }

                                        // get the body
                                        $this_msgball = $msgball;
@@ -1408,7 +1435,7 @@
                                        //|| 
(stristr($this->part_nice[$parent_idx]['subtype'], 'RELATED')))
                                        )
                                        {
-                                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: * 
part is RELATED, HTML, presentable <br>'); }
+                                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: * 
part is RELATED, HTML, presentable <br />'); }
                                                // typically it's the NEXT mime 
part that should be inserted into this one
                                                for ($rel = $i+1; $rel < 
count($this->part_nice)+1; $rel++)
                                                {
@@ -1423,8 +1450,8 @@
                                                                $part_href = 
$this->part_nice[$rel]['ex_part_href'];
                                                                //$part_href = 
'"'.$this->part_nice[$rel]['ex_part_href'].'"';

-                                                               //echo '<br> 
**replace_id (pre-processing): ' .$replace_id .'<br>';
-                                                               //echo 
'part_href (processed): ' .$part_href .'<br>';
+                                                               //echo '<br /> 
**replace_id (pre-processing): ' .$replace_id .'<br />';
+                                                               //echo 
'part_href (processed): ' .$part_href .'<br />';

                                                                // strip <  and 
 >  from this ID
                                                                $replace_id = 
ereg_replace( '^<','',$replace_id);
@@ -1432,7 +1459,7 @@
                                                                // id 
references are typically preceeded with "cid:"
                                                                $replace_id = 
'cid:' .$replace_id;

-                                                               //echo 
'**replace_id (post-processing): ' .$replace_id .'<br>';
+                                                               //echo 
'**replace_id (post-processing): ' .$replace_id .'<br />';

                                                                // Attempt the 
Search and Replace
                                                                $dsp = 
str_replace($replace_id, $part_href, $dsp);
@@ -1451,7 +1478,7 @@

                                                if 
(preg_match("/<iframe.*>.*<\/iframe>/ismx", $dsp))
                                                {
-                                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
** HAS IFRAME <br>'); }
+                                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
** HAS IFRAME <br />'); }
                                                        
//$this->part_nice[$i]['d_threat_level'] .= 'warn_HAS_IFRAME_maybe_KLEZ ';
                                                        
$this->part_nice[$i]['d_threat_level'] .= 
$this->xi['lang_warn_has_iframe_maybe_klez'].' ';
                                                }
@@ -1567,7 +1594,7 @@
                                        // DETECT IFRAME TRICK
                                        //if (stristr($dsp, '<iframe'))
                                        //{
-                                       //      if ($this->debug > 2) { echo 
'email.bomessage.message_data: d_loop: part ** HAS IFRAME <br>'; }
+                                       //      if ($this->debug > 2) { echo 
'email.bomessage.message_data: d_loop: part ** HAS IFRAME <br />'; }
                                        //      
$this->part_nice[$i]['d_threat_level'] .= 'warn_HAS_IFRAME_maybe_KLEZ ';
                                        //}

@@ -1582,7 +1609,7 @@
                                && ($this->hide_alt_hide == True))
                                {
                                        // is this a multipart alternative set, 
and this is the plain part, and do not want to show it
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable BUT it is alt_hide so we do NOT want to show it <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable BUT it is alt_hide so we do NOT want to show it <br />'); }

                                        // ----  DISPLAY INSTRUCTIONS  ----
                                        $this->part_nice[$i]['d_instructions'] 
= 'skip';
@@ -1593,7 +1620,7 @@
                                }
                                elseif ($this->part_nice[$i]['m_description'] 
== 'presentable')
                                {
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable (non-html) <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable (non-html) <br />'); }

                                        // ----- get the part from the server
                                        $this_msgball = $msgball;
@@ -1618,7 +1645,7 @@
                                        $colon = chr(58);
                                        $dsp = str_replace($colon, " colon ", 
$dsp);

-                                       echo 
'<br>'.$this->part_nice[$i]['m_part_num_mime'].'<br>';
+                                       echo '<br 
/>'.$this->part_nice[$i]['m_part_num_mime'].'<br />';
                                        var_dump($dsp);
                                        */

@@ -1694,10 +1721,10 @@
                                                                //$dsp = 
$GLOBALS['phpgw']->msg->space_to_nbsp($dsp);
                                                        //}
                                                        $dsp = 
$GLOBALS['phpgw']->msg->make_clickable($dsp, 
$GLOBALS['phpgw']->msg->get_arg_value('["msgball"]["folder"]'));
-                                                       // (OPT 2) THIS 
CONVERTS UNFORMATTED TEXT TO *VERY* SIMPLE HTML - adds only <br>
-                                                       $dsp = 
ereg_replace("\r\n","<br>",$dsp);
+                                                       // (OPT 2) THIS 
CONVERTS UNFORMATTED TEXT TO *VERY* SIMPLE HTML - adds only <br />
+                                                       $dsp = 
ereg_replace("\r\n","<br />",$dsp);
                                                        // add a line after the 
last line of the message
-                                                       $dsp = $dsp .'<br><br>';
+                                                       $dsp = $dsp .'<br /><br 
/>';
                                                        // alternate (toggle) 
to view unformatted, for this we add "&no_fmt=1" to the URL
                                                        $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url.'&no_fmt=1', 
$this->xi['lang_view_unformatted']);
                                                        $view_option_ilnk = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url.'&no_fmt=1', 
$view_unformatted_img);
@@ -1744,7 +1771,7 @@
                                && ($this->hide_alt_hide == True))
                                {
                                        // is this a multipart alternative set, 
and this is the plain part, and do not want to show it
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable IMAGE BUT it is alt_hide because it is html related to a parent 
so we do NOT want to show it again<br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable IMAGE BUT it is alt_hide because it is html related to a parent 
so we do NOT want to show it again<br />'); }

                                        // ----  DISPLAY INSTRUCTIONS  ----
                                        $this->part_nice[$i]['d_instructions'] 
= 'skip';
@@ -1755,7 +1782,7 @@
                                }
                                elseif ($this->part_nice[$i]['m_description'] 
== 'presentable/image')
                                {
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable image <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is presentable image <br />'); }

                                        $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
@@ -1777,12 +1804,12 @@
                                }
                                elseif ($this->part_nice[$i]['m_description'] 
== 'attachment')
                                {
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is attachment <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is attachment <br />'); }

                                        // if this is a 1 part message with 
only this attachment, WARN
                                        if (count($this->part_nice) == 1)
                                        {
-                                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: * 
WARN message has only 1 part and it is an attachment <br>'); }
+                                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: * 
WARN message has only 1 part and it is an attachment <br />'); }
                                                
//$this->part_nice[$i]['d_threat_level'] .= 'warn_attachment_only_mail ';
                                                
$this->part_nice[$i]['d_threat_level'] .= 
$this->xi['lang_warn_attachment_only_mail'].' ';
                                        }
@@ -1790,7 +1817,7 @@
                                        // warn for typically BAD attachments 
bat, inf, pif, con, reg, vbs, scr
                                        if 
(preg_match('/^.*\.(bat|inf|pif|com|exe|reg|vbs|scr)$/', 
$this->part_nice[$i]['ex_part_name']))
                                        {
-                                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: * 
WARN attachment has NEFARIOUS filename extension, ex_part_name: 
'.$this->part_nice[$i]['ex_part_name'].'<br>'); }
+                                               if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: * 
WARN attachment has NEFARIOUS filename extension, ex_part_name: 
'.$this->part_nice[$i]['ex_part_name'].'<br />'); }
                                                
//$this->part_nice[$i]['d_threat_level'] .= 'warn_attachment_name_DANGEROUS ';
                                                
$this->part_nice[$i]['d_threat_level'] .= 
$this->xi['lang_warn_attachment_name_dangerous'].' ';
                                        }
@@ -1804,7 +1831,7 @@
                                                .'&nbsp;&nbsp; 
'.$this->part_nice[$i]['ex_part_clickable']
                                                .'&nbsp;&nbsp; 
'.$this->xi['lang_size'].': 
'.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes'])
                                                .'&nbsp;&nbsp; 
'.'<b>'.$this->part_nice[$i]['d_threat_level'].'</b>'
-                                               .'<br><br>';
+                                               .'<br /><br />';

                                        $this->part_nice[$i]['message_body'] = 
$msg_text;

@@ -1820,7 +1847,7 @@
                                elseif (($this->part_nice[$i]['m_description'] 
!= 'container')
                                && ($this->part_nice[$i]['m_description'] != 
'packagelist'))
                                {
-                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is ERROR - unknown <br>'); }
+                                       if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'): d_loop: part 
is ERROR - unknown <br />'); }

                                        // if we get here then we've got some 
kind of error, all things we know about are handle above
                                        $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
@@ -1833,14 +1860,14 @@

                                        $msg_text = '';
                                        // UNKNOWN DATA
-                                       $msg_text = $msg_text 
.'<br><strong>'.$this->xi['lang_error_unknown_message_data'].'</strong><br>';
+                                       $msg_text = $msg_text .'<br 
/><strong>'.$this->xi['lang_error_unknown_message_data'].'</strong><br />';
                                        if ($this->part_nice[$i]['encoding'] == 
'base64')
                                        {
                                                        $this_msgball = 
$msgball;
                                                        
$this_msgball['part_no'] = $this->part_nice[$i]['m_part_num_mime'];
                                                        $dsp = 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($this_msgball);
                                                        //$dsp = 
$GLOBALS['phpgw']->dcom->fetchbody($mailbox, 
$GLOBALS['phpgw']->msg->get_arg_value('msgnum'), 
$this->part_nice[$i]['m_part_num_mime']);
-                                                       //$processed_msg_body = 
$processed_msg_body . base64_decode($dsp) .'<br>' ."\r\n";
+                                                       //$processed_msg_body = 
$processed_msg_body . base64_decode($dsp) .'<br />' ."\r\n";
                                                $msg_text = $msg_text . 'actual 
part size: ' .strlen($dsp);
                                        }
                                        
//$GLOBALS['phpgw']->template->set_var('message_body',$msg_text);
@@ -1886,7 +1913,7 @@
                        // DO NOT end request yet because the "echo_out" part 
(if exists) will require this connection
                        //$GLOBALS['phpgw']->msg->end_request();
                        if ($this->debug > 2) { 
$this->msg->dbug->out('email.bomessage.message_data('.__LINE__.'):  
$this->part_nice (With Instructions) DUMP:', $this->part_nice); }
-
+
                }
        }
 ?>

====================================================
Index: email/inc/class.bopreferences.inc.php
diff -u email/inc/class.bopreferences.inc.php:1.24 
email/inc/class.bopreferences.inc.php:1.25
--- email/inc/class.bopreferences.inc.php:1.24  Thu Dec 30 23:13:50 2004
+++ email/inc/class.bopreferences.inc.php       Sun Mar 13 23:22:43 2005
@@ -57,7 +57,7 @@

                function bopreferences()
                {
-                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences *constructor*: ENTERING <br>'; }
+                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences *constructor*: ENTERING <br />'; }
                        /*!
                        @capability initialize class mail_msg object but do not 
login
                        @abstract we need functions in class mail_msg but we 
not want a login
@@ -72,14 +72,14 @@
                        //$this->msg_bootstrap->set_do_login(False);
                        // USE NEW login instructions, defined in bootstrap 
class
                        $this->msg_bootstrap->set_do_login(BS_LOGIN_NEVER);
-                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences. *constructor*: call 
this->msg_bootstrap->ensure_mail_msg_exists, msg_bootstrap->get_do_login(): 
'.serialize($this->msg_bootstrap->get_do_login()).'<br>'; }
+                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences. *constructor*: call 
this->msg_bootstrap->ensure_mail_msg_exists, msg_bootstrap->get_do_login(): 
'.serialize($this->msg_bootstrap->get_do_login()).'<br />'; }
                        
$this->msg_bootstrap->ensure_mail_msg_exists('email.bopreferences. 
*constructor*', $this->debug_set_prefs);
                        // make the convience reference
                        if ($this->msg == '##NOTHING##')
                        {
                                $this->msg =& $GLOBALS['phpgw']->msg;
                        }
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences. *constructor*: LEAVING<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences. *constructor*: LEAVING<br />'); }
                        //return;
                }

@@ -107,7 +107,7 @@
                */
                function init_available_prefs()
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.init_available_prefs: ENTERING, use 
debug level 4 for a data dump on leaving<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.init_available_prefs: ENTERING, use 
debug level 4 for a data dump on leaving<br />'); }

                        $this->std_prefs = Array();
                        $i = 0;
@@ -363,6 +363,33 @@
                                'values'        => array(),
                                'long_desc' => lang('If &quot; Sent messages 
folder &quot; is checked, a copy of your sent mail will be stored in the folder 
name you type in this box. If this folder does not exist, it will be created 
for you automatically. Default name is &quot;Sent&quot;. This will be your 
&quot;Sent&quot; folder, but it does not have to actually be called 
&quot;Sent&quot;, you can name it anything. Only works with IMAP servers, POP 
servers do not have folders.')
                        );
+                       $i++;
+                       $this->std_prefs[$i] = Array(
+                               'id'            => 'use_draft_folder',
+                               'type'          => 'exists',
+                               'widget'        => 'checkbox',
+                               'accts_usage'   => 'default, extra_accounts',
+                               'write_props'   => '',
+                               //'lang_blurb'  => lang('Sent messages saved to 
folder:'),
+                               //'lang_blurb'  => lang('save Sent messages in 
folder named below'),
+                               'lang_blurb'    => htmlentities(lang('draft 
messages saved in "draft" folder')),
+                               'init_default'  => 'set_or_not,not_set',
+                               'values'        => array(),
+                               'long_desc'     => htmlentities(lang('If 
checked, you will be able to create draft messages and save them in the "draft" 
folder name which you specify in the box for "draft messages folder". Only 
works with IMAP servers, POP servers do not have folders.'))
+                       );
+                       $i++;
+                       $this->std_prefs[$i] = Array(
+                               'id'            => 'draft_folder_name',
+                               'type'          => 'user_string',
+                               'widget'        => 'textbox',
+                               'accts_usage'   => 'default, extra_accounts',
+                               'write_props'   => '',
+                               //'lang_blurb'  => lang('Sent messages folder 
name'),
+                               'lang_blurb'    => lang('Sent messages folder'),
+                               'init_default'  => 'string,Drafts',
+                               'values'        => array(),
+                               'long_desc'     => htmlentities(lang('If "draft 
messages folder" is checked, copies of your draft messages will be stored in 
the folder name you type in this box. If this folder does not exist, it will be 
created for you automatically, when you first save a draft message. Default 
name is "drafts". This will be your "drafts" folder, but it does not have to 
actually be called "drafts", you can name it anything. Only works with IMAP 
servers, POP servers do not have folders.'))
+                       );
                        /*
                        $i++;
                        $this->std_prefs[$i] = Array(
@@ -599,8 +626,8 @@
                                'values'        => array(),
                                'long_desc' => lang('Only needed with the 
University of Washington &quot;UWash&quot; IMAP server. The default value is 
&quot;mail&quot; which means your mail folders, other then INBOX, are located 
in a directory called &quot;mail&quot; directly under your &quot;HOME&quot; 
directory. This box may be left empty, which means your mail folders are 
located in your &quot;HOME&quot; directory, not a subdirectory. If your mail 
folders are located in a subdirectory of &quot;HOME&quot; then put the name of 
that subdirectory here. Generally, it is not necessary to use any special 
slashes or tildes, &quot;HOME&quot; is always considered the base directory, 
and the slash bewteen &quot;HOME&quot; and the subdirectory will be added for 
you automatically, do not put the slash in this box.')
                        );
-                       if ($this->debug_set_prefs > 3) { 
$this->msg->dbug->out('email.bopreferences.init_available_prefs: data dump: 
calling debug_dump_prefs<br>');  $this->debug_dump_prefs(); }
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.init_available_prefs: LEAVING<br>'); 
}
+                       if ($this->debug_set_prefs > 3) { 
$this->msg->dbug->out('email.bopreferences.init_available_prefs: data dump: 
calling debug_dump_prefs<br />');  $this->debug_dump_prefs(); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.init_available_prefs: LEAVING<br 
/>'); }
                }


@@ -608,7 +635,7 @@
                function debug_dump_prefs()
                {
                        // DEBUG begin
-                       //$this->msg->dbug->out('<br><br>');
+                       //$this->msg->dbug->out('<br /><br />');
                        
$this->msg->dbug->out('email.bopreferences.debug_dump_prefs: std_prefs var 
DUMP:', $this->std_prefs);
                        
$this->msg->dbug->out('email.bopreferences.debug_dump_prefs: cust_prefs var 
DUMP:', $this->cust_prefs);
                        //Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php'));
@@ -657,7 +684,7 @@
                */
                function grab_set_prefs()
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences: call to grab_set_prefs<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences: call to grab_set_prefs<br />'); }
                        // better make sure we have created the available prefs 
schema
                        $this->init_available_prefs();

@@ -671,8 +698,8 @@
                        }
                        else
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences: call to grab_set_prefs CALLER 
UNKNOWN<br>'); }
-                               $this->pref_errors .= 'email: bopreferences: 
grab_set_prefs: unsupported "caller" variable<br>';
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences: call to grab_set_prefs CALLER 
UNKNOWN<br />'); }
+                               $this->pref_errors .= 'email: bopreferences: 
grab_set_prefs: unsupported "caller" variable<br />';
                        }
                }

@@ -697,7 +724,7 @@
                */
                function grab_set_prefs_args_gpc()
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences: call to 
grab_set_prefs_args_gpc<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences: call to grab_set_prefs_args_gpc<br 
/>'); }
                        // ----  HANDLE GRABBING PREFERENCE GPC HTTP_POST_VARS 
ARGS  -------
                        // for abstraction from phpgw UI and from PHP's GPC 
data, put the submitted GPC data
                        // into a class var $this->args[] array. This array is 
then used to represent the submitted
@@ -707,7 +734,7 @@
                        // ----  DEFAULT EMAIL ACCOUNT  ----
                        if 
(isset($GLOBALS['phpgw']->msg->ref_POST[$this->submit_token]))
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences: INSIDE grab_set_prefs_args_gpc for 
Default Email Account data<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences: INSIDE grab_set_prefs_args_gpc for 
Default Email Account data<br />'); }

                                // EXPIRE stuff that may get stale by changing 
prefs
                                $this->expire_related_cached_items(0);
@@ -723,14 +750,14 @@
                                        // existence of $this->submit_token 
indicates this data is intended for the default email account
                                        if 
(!stristr($this->std_prefs[$i]['accts_usage'], 'default'))
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) _SKIP_ this item 
['.$this->std_prefs[$i]['id'].'], it does not apply to the default email 
account<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) _SKIP_ this item 
['.$this->std_prefs[$i]['id'].'], it does not apply to the default email 
account<br />'); }
                                        }
                                        else
                                        {
                                                // ok, we have a pref item that 
applies to the default email account
                                                $this_pref_name = 
$this->std_prefs[$i]['id'];
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) $this_pref_name: 
'.$this_pref_name.'<br>'); }
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) 
$GLOBALS[HTTP_POST_VARS][$this_pref_name]: 
'.$GLOBALS['phpgw']->msg->ref_POST[$this_pref_name].'<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) $this_pref_name: 
'.$this_pref_name.'<br />'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) 
$GLOBALS[HTTP_POST_VARS][$this_pref_name]: 
'.$GLOBALS['phpgw']->msg->ref_POST[$this_pref_name].'<br />'); }
                                                if 
(isset($GLOBALS['phpgw']->msg->ref_POST[$this_pref_name]))
                                                {
                                                        
$this->args[$this_pref_name] = 
$GLOBALS['phpgw']->msg->ref_POST[$this_pref_name];
@@ -746,14 +773,14 @@
                                        // existence of $this->submit_token 
indicates this data is intended for the default email account
                                        if 
(!stristr($this->cust_prefs[$i]['accts_usage'], 'default'))
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) _SKIP_ this item 
['.$this->cust_prefs[$i]['id'].'], it does not apply to the default email 
account<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) _SKIP_ this item 
['.$this->cust_prefs[$i]['id'].'], it does not apply to the default email 
account<br />'); }
                                        }
                                        else
                                        {
                                                // ok, we have a pref item that 
applies to the default email account
                                                $this_pref_name = 
$this->cust_prefs[$i]['id'];
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) $this_pref_name: 
'.$this_pref_name.'<br>'); }
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) 
$GLOBALS[HTTP_POST_VARS][$this_pref_name]: 
'.$GLOBALS['phpgw']->msg->ref_POST[$this_pref_name].'<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) $this_pref_name: 
'.$this_pref_name.'<br />'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) 
$GLOBALS[HTTP_POST_VARS][$this_pref_name]: 
'.$GLOBALS['phpgw']->msg->ref_POST[$this_pref_name].'<br />'); }
                                                if 
(isset($GLOBALS['phpgw']->msg->ref_POST[$this_pref_name]))
                                                {
                                                        
$this->args[$this_pref_name] = 
$GLOBALS['phpgw']->msg->ref_POST[$this_pref_name];
@@ -764,7 +791,7 @@
                        // ----  EXTRA EMAIL ACCOUNTS  ----
                        elseif 
(isset($GLOBALS['phpgw']->msg->ref_POST[$this->submit_token_extra_accounts]))
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences: INSIDE grab_set_prefs_args_gpc for 
EXTRA EMAIL ACCOUNTS data<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences: INSIDE grab_set_prefs_args_gpc for 
EXTRA EMAIL ACCOUNTS data<br />'); }

                                //$this->args['submit_prefs'] = 
$GLOBALS['phpgw']->msg->ref_POST['submit_prefs'];
                                $this->args[$this->submit_token_extra_accounts] 
= $GLOBALS['phpgw']->msg->ref_POST[$this->submit_token_extra_accounts];
@@ -789,14 +816,14 @@
                                        // extra email accounts
                                        if 
(!stristr($this->std_prefs[$i]['accts_usage'], 'extra_accounts'))
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) _SKIP_ this item 
['.$this->std_prefs[$i]['id'].'], it does not apply to extra email 
accounts<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) _SKIP_ this item 
['.$this->std_prefs[$i]['id'].'], it does not apply to extra email accounts<br 
/>'); }
                                        }
                                        else
                                        {
                                                // ok, we have a pref item that 
applies to the default email account
                                                $this_pref_name = 
$this->std_prefs[$i]['id'];
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) $this_pref_name: 
'.$this_pref_name.'<br>'); }
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) 
$GLOBALS[HTTP_POST_VARS][$this->acctnum('.$this->acctnum.')][$this_pref_name('.$this_pref_name.')]:
 ['.$GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name].']<br>'); 
}
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) $this_pref_name: 
'.$this_pref_name.'<br />'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (std pref) 
$GLOBALS[HTTP_POST_VARS][$this->acctnum('.$this->acctnum.')][$this_pref_name('.$this_pref_name.')]:
 ['.$GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name].']<br 
/>'); }
                                                if 
(isset($GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name]))
                                                {
                                                        
$this->args[$this->acctnum][$this_pref_name] = 
$GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name];
@@ -813,14 +840,14 @@
                                        // extra email accounts
                                        if 
(!stristr($this->cust_prefs[$i]['accts_usage'], 'extra_accounts'))
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) _SKIP_ this item 
['.$this->cust_prefs[$i]['id'].'], it does not apply to extra email 
accounts<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) _SKIP_ this item 
['.$this->cust_prefs[$i]['id'].'], it does not apply to extra email accounts<br 
/>'); }
                                        }
                                        else
                                        {
                                                // ok, we have a pref item that 
applies to extra email accounts
                                                $this_pref_name = 
$this->cust_prefs[$i]['id'];
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) $this_pref_name: 
'.$this_pref_name.'<br>'); }
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) 
$GLOBALS[HTTP_POST_VARS][$this->acctnum('.$this->acctnum.')][$this_pref_name('.$this_pref_name.')]:
 ['.$GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name].']<br>'); 
}
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) $this_pref_name: 
'.$this_pref_name.'<br />'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out(' * * (cust pref) 
$GLOBALS[HTTP_POST_VARS][$this->acctnum('.$this->acctnum.')][$this_pref_name('.$this_pref_name.')]:
 ['.$GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name].']<br 
/>'); }
                                                if 
(isset($GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name]))
                                                {
                                                        
$this->args[$this->acctnum][$this_pref_name] = 
$GLOBALS['phpgw']->msg->ref_POST[$this->acctnum][$this_pref_name];
@@ -845,7 +872,7 @@
                function grab_set_prefs_args_xmlrpc()
                {
                        // STUB, for future use
-                       $this->msg->dbug->out('email boprefs: call to 
un-implemented function grab_set_prefs_args_xmlrpc<br>');
+                       $this->msg->dbug->out('email boprefs: call to 
un-implemented function grab_set_prefs_args_xmlrpc<br />');
                }

                /*!
@@ -868,13 +895,13 @@
                        $c_prefs = count($prefs_set);
                        if ($c_prefs == 0)
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: empty 
array, no prefs set supplied, exiting<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: empty 
array, no prefs set supplied, exiting<br />'); }
                                return False;
                        }

                        for($i=0;$i<$c_prefs;$i++)
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: inside 
preferences loop ['.$i.']<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: inside 
preferences loop ['.$i.']<br />'); }

                                $this_pref = $prefs_set[$i];

@@ -886,7 +913,7 @@
                                        // we are not supposed to show this 
item for the default account, skip this pref item
                                        // continue is used within looping 
structures to skip the rest of the current loop
                                        // iteration and continue execution at 
the beginning of the next iteration
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: _SKIP_ 
this item ["'.$this_pref['id'].'"], it does not apply to the default email 
account<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: _SKIP_ 
this item ["'.$this_pref['id'].'"], it does not apply to the default email 
account<br />'); }
                                        continue;
                                }

@@ -898,7 +925,7 @@
                                        // ----  OR an empty string was 
submitted for this pref item  ----

                                        // so how do we handle this, for this 
pref...
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: 
submitted_pref for ["'.$this_pref['id'].'"] not set or empty string<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: process_submitted_prefs: 
submitted_pref for ["'.$this_pref['id'].'"] not set or empty string<br />'); }
                                        if (stristr($this_pref['write_props'], 
'empty_no_delete'))
                                        {
                                                // DO NOT DELETE
@@ -906,7 +933,7 @@
                                                // note there may or may not 
actually be an existing value in the prefs table
                                                // but it does not matter here, 
because we do not touch this items value at all.
                                                // Typical Usage: passwords
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: no change to repository for 
empty or blank ["'.$this_pref['id'].'"] because of "empty_no_delete"<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: no change to repository for 
empty or blank ["'.$this_pref['id'].'"] because of "empty_no_delete"<br />'); }
                                        }
                                        elseif 
(stristr($this_pref['write_props'], 'empty_string_ok'))
                                        {
@@ -914,7 +941,7 @@
                                                // i.e. this pref can take an 
empty string as a valid value
                                                // whereas most other prefs are 
simply deleted from the repository if value is empty
                                                // Typical Usage: email sig, 
UWash Mail Folder
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: save empty string to repository 
for ["'.$this_pref['id'].'"] because of "empty_string_ok"<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: save empty string to repository 
for ["'.$this_pref['id'].'"] because of "empty_string_ok"<br />'); }
                                                // a) as always, delete the 
pref before we assign a value
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this_pref['id']);
                                                // b) now assign a blank string 
value
@@ -923,7 +950,7 @@
                                        else
                                        {
                                                // just delete it from the 
preferences repository
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: deleting empty or blank pref 
["'.$this_pref['id'].'"] from the repository<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: deleting empty or blank pref 
["'.$this_pref['id'].'"] from the repository<br />'); }
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this_pref['id']);
                                        }
                                }
@@ -935,7 +962,7 @@
                                        $submitted_pref = 
$this->args[$this_pref['id']];
                                        // init a var to hold the processed 
submitted_pref
                                        $processed_pref = '';
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('* * ** email: bopreferences: process_submitted_prefs:  
submitted_pref: ['.$submitted_pref.']<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('* * ** email: bopreferences: process_submitted_prefs:  
submitted_pref: ['.$submitted_pref.']<br />'); }

                                        // most "user_string"s need special 
processing before they can go into the repository
                                        if ($this_pref['type'] == 'user_string')
@@ -1007,13 +1034,13 @@
                */
                function preferences()
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.preferences(): ENTERING<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.preferences(): ENTERING<br />'); }
                        // establish all available prefs for email
-                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences(): about to call 
$this->init_available_prefs()<br>'); }
+                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences(): about to call 
$this->init_available_prefs()<br />'); }
                        $this->init_available_prefs();

                        // this will fill $this->args[] array with any 
submitted prefs args
-                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences(): about to call 
$this->grab_set_prefs()<br>'); }
+                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences(): about to call 
$this->grab_set_prefs()<br />'); }
                        $this->grab_set_prefs();

                        // ----  HANDLE SETING PREFERENCE   -------
@@ -1025,25 +1052,25 @@
                                // constructor will initialize 
$GLOBALS['phpgw']->msg

                                // ---  Process Standard Prefs  ---
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: about to process 
Standard Prefs<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: about to process 
Standard Prefs<br />'); }
                                
$this->process_submitted_prefs($this->std_prefs);

                                // ---  Process Custom Prefs  ---
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: about to process Custom 
Prefs<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: about to process Custom 
Prefs<br />'); }
                                if (isset($this->args['use_custom_settings']))
                                {
                                        // custom settings are in use, process 
them
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: custom prefs are in 
use, calling $this->process_submitted_prefs($this->cust_prefs)<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: custom prefs are in 
use, calling $this->process_submitted_prefs($this->cust_prefs)<br />'); }
                                        
$this->process_submitted_prefs($this->cust_prefs);
                                }
                                else
                                {
                                        // custom settings are NOT being used, 
DELETE them from the repository
                                        $c_prefs = count($this->cust_prefs);
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: custom prefs NOT in 
use, deleting them<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences: custom prefs NOT in 
use, deleting them<br />'); }
                                        for($i=0;$i<$c_prefs;$i++)
                                        {
-                                               if ($this->debug_set_prefs > 2) 
{ $this->msg->dbug->out(' *(loop)* email.bopreferences: preferences: deleting 
custom pref $this->cust_prefs['.$i.'][id] : 
['.$this->cust_prefs[$i]['id'].']<br>'); }
+                                               if ($this->debug_set_prefs > 2) 
{ $this->msg->dbug->out(' *(loop)* email.bopreferences: preferences: deleting 
custom pref $this->cust_prefs['.$i.'][id] : 
['.$this->cust_prefs[$i]['id'].']<br />'); }
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this->cust_prefs[$i]['id']);
                                        }
                                }
@@ -1051,11 +1078,11 @@
                                // DONE processing prefs, SAVE to the Repository
                                if ($this->debug_set_prefs > 1)
                                {
-                                       
$this->msg->dbug->out('email.bopreferences.preferences(): *debug* at 
['.$this->debug_set_prefs.'] so skipping save_repository<br>');
+                                       
$this->msg->dbug->out('email.bopreferences.preferences(): *debug* at 
['.$this->debug_set_prefs.'] so skipping save_repository<br />');
                                }
                                else
                                {
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences(): SAVING 
REPOSITORY<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.preferences(): SAVING REPOSITORY<br 
/>'); }
                                        
$GLOBALS['phpgw']->preferences->save_repository();
                                }
                                // end the email session
@@ -1065,14 +1092,14 @@
                                $take_me_to_url = $GLOBALS['phpgw']->link(
                                                                                
        '/preferences/index.php');

-                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.preferences(): almost LEAVING, about 
to issue a redirect to:<br>'.$take_me_to_url.'<br>'); }
+                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.preferences(): almost LEAVING, about 
to issue a redirect to:<br />'.$take_me_to_url.'<br />'); }
                                if ($this->debug_set_prefs > 1)
                                {
-                                       
$this->msg->dbug->out('email.bopreferences.preferences(): LEAVING, *debug* at 
['.$this->debug_set_prefs.'] so skipping Header redirection to: 
['.$take_me_to_url.']<br>');
+                                       
$this->msg->dbug->out('email.bopreferences.preferences(): LEAVING, *debug* at 
['.$this->debug_set_prefs.'] so skipping Header redirection to: 
['.$take_me_to_url.']<br />');
                                }
                                else
                                {
-                                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.preferences: LEAVING with redirect 
to: <br>'.$take_me_to_url.'<br>'); }
+                                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.preferences: LEAVING with redirect 
to: <br />'.$take_me_to_url.'<br />'); }
                                        Header('Location: ' . $take_me_to_url);
                                }
                        }
@@ -1212,7 +1239,7 @@
                                }
                                if ($this->debug_set_prefs > 1)
                                {
-                                       echo 'email.bopreferences: *debug* 
skipping save_repository<br>';
+                                       echo 'email.bopreferences: *debug* 
skipping save_repository<br />';
                                }
                                else
                                {
@@ -1222,7 +1249,7 @@
                        }
                        if ($this->debug_set_prefs > 1)
                        {
-                               echo 'email.bopreferences: *debug* skipping 
Header redirection<br>';
+                               echo 'email.bopreferences: *debug* skipping 
Header redirection<br />';
                        }
                        else
                        {
@@ -1240,7 +1267,7 @@
                */
                function process_ex_accounts_submitted_prefs($prefs_set='')
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: ENTERING<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: ENTERING<br />'); }
                        // basicly, copy and paste the real 
"process_submitted_prefs" and tweak for extra_accounts applicablility
                        if(!$prefs_set)
                        {
@@ -1249,22 +1276,22 @@
                        $c_prefs = count($prefs_set);
                        if ($c_prefs == 0)
                        {
-                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: LEAVING, empty array, no prefs set 
supplied<br>'); }
+                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: LEAVING, empty array, no prefs set 
supplied<br />'); }
                                return False;
                        }

                        // ==== ACCTNUM ====
-                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: pre discovery $this->acctnum : 
['.serialize($this->acctnum).']<br>'); }
+                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: pre discovery $this->acctnum : 
['.serialize($this->acctnum).']<br />'); }
                        if ((!isset($this->acctnum))
                        || ((string)$this->acctnum == ''))
                        {
                                $this->acctnum = $this->obtain_ex_acctnum();
                        }
-                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: post discovery $this->acctnum : 
['.serialize($this->acctnum).']<br>'); }
+                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: post discovery $this->acctnum : 
['.serialize($this->acctnum).']<br />'); }

                        for($i=0;$i<$c_prefs;$i++)
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out(' <b>* (next loop) *</b> email: bopreferences: 
process_ex_accounts_submitted_prefs: inside preferences loop ['.$i.']<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out(' <b>* (next loop) *</b> email: bopreferences: 
process_ex_accounts_submitted_prefs: inside preferences loop ['.$i.']<br />'); }

                                $this_pref = $prefs_set[$i];
                                if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: $this_pref = $prefs_set['.$i.'] : 
$this_pref DUMP:', $prefs_set[$i]); }
@@ -1276,7 +1303,7 @@
                                        // we are not supposed to handle this 
item for the extra email accounts, skip this pref item
                                        // continue is used within looping 
structures to skip the rest of the current loop
                                        // iteration and continue execution at 
the beginning of the next iteration
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: _SKIP_ this item ["'.$this_pref['id'].'"], 
it does not apply to Extra Email Accounts <br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: _SKIP_ this item ["'.$this_pref['id'].'"], 
it does not apply to Extra Email Accounts <br />'); }
                                        continue;
                                }

@@ -1286,7 +1313,7 @@
                                {
                                        // nothing submitted for this 
preference item
                                        // OR an empty string was submitted for 
this pref item
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: submitted_pref for 
["'.$this_pref['id'].'"] not set or empty string<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: submitted_pref for 
["'.$this_pref['id'].'"] not set or empty string<br />'); }
                                        if (stristr($this_pref['write_props'], 
'empty_no_delete'))
                                        {
                                                // DO NOT DELETE
@@ -1294,7 +1321,7 @@
                                                // note there may or may not 
actually be an existing value in the prefs table
                                                // but it does not matter here, 
because we do not touch this items value at all.
                                                // Typical Usage: passwords
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: no change to repository for empty or blank 
["'.$this_pref['id'].'"] because of "empty_no_delete"<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: no change to repository for empty or blank 
["'.$this_pref['id'].'"] because of "empty_no_delete"<br />'); }
                                        }
                                        elseif 
(stristr($this_pref['write_props'], 'empty_string_ok'))
                                        {
@@ -1302,21 +1329,21 @@
                                                // i.e. this pref can take an 
empty string as a valid value
                                                // whereas most other prefs are 
simply deleted from the repository if value is empty
                                                // Typical Usage: email sig, 
UWash Mail Folder
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences 
process_ex_accounts_submitted_prefs: save empty string to repository for 
["'.$this_pref['id'].'"] because of "empty_string_ok"<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences 
process_ex_accounts_submitted_prefs: save empty string to repository for 
["'.$this_pref['id'].'"] because of "empty_string_ok"<br />'); }
                                                // a) as always, delete the 
pref before we assign a value
                                                $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this_pref['id'].'"]';
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences 
process_ex_accounts_submitted_prefs: using preferences->delete_struct("email", 
$pref_struct_str) which will eval $pref_struct_str='.$pref_struct_str.'<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences 
process_ex_accounts_submitted_prefs: using preferences->delete_struct("email", 
$pref_struct_str) which will eval $pref_struct_str='.$pref_struct_str.'<br 
/>'); }
                                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
                                                // b) now assign a blank string 
value
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: using preferences->add_struct("email", 
$pref_struct_str, \'\') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: using preferences->add_struct("email", 
$pref_struct_str, \'\') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'); }
                                                
$GLOBALS['phpgw']->preferences->add_struct('email',$pref_struct_str,'');
                                        }
                                        else
                                        {
                                                // just delete it from the 
preferences repository
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs deleting empty or blank pref 
["'.$this_pref['id'].'"] from the repository<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs deleting empty or blank pref 
["'.$this_pref['id'].'"] from the repository<br />'); }
                                                $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this_pref['id'].'"]';
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: using preferences->delete_struct("email", 
$pref_struct_str) which will eval $pref_struct_str='.$pref_struct_str.'<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: using preferences->delete_struct("email", 
$pref_struct_str) which will eval $pref_struct_str='.$pref_struct_str.'<br 
/>'); }
                                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
                                        }
                                }
@@ -1326,7 +1353,7 @@
                                        $submitted_pref = 
$this->args[$this->acctnum][$this_pref['id']];
                                        // init a var to hold the processed 
submitted_pref
                                        $processed_pref = '';
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('* * email: bopreferences: 
process_ex_accounts_submitted_prefs:  submitted_pref: 
['.$submitted_pref.']<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('* * email: bopreferences: 
process_ex_accounts_submitted_prefs:  submitted_pref: ['.$submitted_pref.']<br 
/>'); }

                                        // most "user_string"s need special 
processing before they can go into the repository
                                        if ($this_pref['type'] == 'user_string')
@@ -1370,10 +1397,10 @@

                                        // a) as always, delete the pref before 
we assign a value
                                        $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this_pref['id'].'"]';
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences 
process_ex_accounts_submitted_prefs: using preferences->delete_struct("email", 
$pref_struct_str) which will eval $pref_struct_str='.$pref_struct_str.'<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences 
process_ex_accounts_submitted_prefs: using preferences->delete_struct("email", 
$pref_struct_str) which will eval $pref_struct_str='.$pref_struct_str.'<br 
/>'); }
                                        
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
                                        // b) now assign that processed data to 
this pref item in the repository
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: using preferences->add_struct("email", 
$pref_struct_str, $processed_pref) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences: 
process_ex_accounts_submitted_prefs: using preferences->add_struct("email", 
$pref_struct_str, $processed_pref) which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'); }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$processed_pref);
                                        // SORT THAT ARRAY by key, so the 
integer array heys go from lowest to hightest
                                        
ksort($GLOBALS['phpgw']->preferences->data['email']['ex_accounts']);
@@ -1393,7 +1420,7 @@
                */
                function ex_accounts_delete($acctnum='')
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete ENTERING feed 
acctnum: ['.serialize($acctnum).']<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete ENTERING feed 
acctnum: ['.serialize($acctnum).']<br />'); }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_delete: 
$GLOBALS[HTTP_POST_VARS] DUMP:', $GLOBALS['phpgw']->msg->ref_POST); }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_delete: 
$GLOBALS[HTTP_GET_VARS] DUMP:', $GLOBALS['phpgw']->msg->ref_GET); }

@@ -1413,16 +1440,16 @@
                        }

                        $actually_did_something = False;
-                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete obtained acctnum 
['.$this->acctnum.']<br>'); }
+                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete obtained acctnum 
['.$this->acctnum.']<br />'); }

                        if ((isset($this->acctnum))
                        && ((string)$this->acctnum != ''))
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete obtained VALID 
acctnum ['.$this->acctnum.'], proceed...<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete obtained VALID 
acctnum ['.$this->acctnum.'], proceed...<br />'); }

                                // delete the extra account pref item
                                $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']';
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_delete: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_delete: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'); }
                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);

                                if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_delete: 
$GLOBALS[phpgw]->preferences->data DUMP:', 
$GLOBALS['phpgw']->preferences->data); }
@@ -1434,12 +1461,12 @@
                        if (!$actually_did_something)
                        {
                                // nothing happened above that requires saving 
the repository
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: nothing happened 
that requires save_repository, 
$actually_did_something='.serialize($actually_did_something).'<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: nothing happened 
that requires save_repository, 
$actually_did_something='.serialize($actually_did_something).'<br />'); }
                        }
                        elseif ($this->debug_set_prefs > 2)
                        {
                                // we actually did something that requires 
saving repository, but are we in debug mode
-                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: *debug* skipping 
save_repository<br>');
+                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: *debug* skipping 
save_repository<br />');
                        }
                        else
                        {
@@ -1454,7 +1481,7 @@
                        // redirect user back to main preferences page
                        if ($this->debug_set_prefs > 2)
                        {
-                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: *debug* skipping 
Header redirection<br>');
+                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: *debug* skipping 
Header redirection<br />');
                        }
                        else
                        {
@@ -1462,7 +1489,7 @@
                                                                                
        '/index.php',
                                                                                
        'menuaction=email.uipreferences.ex_accounts_list');

-                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: LEAVING with 
redirect to: ['.$take_me_to_url.']<br>'); }
+                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_delete: LEAVING with 
redirect to: ['.$take_me_to_url.']<br />'); }
                                Header('Location: ' . $take_me_to_url);
                        }
                }
@@ -1476,7 +1503,7 @@
                */
                function ex_accounts_edit($acctnum='')
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit ENTERING <br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit ENTERING <br />'); }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_edit: 
$GLOBALS[HTTP_POST_VARS] DUMP:', $GLOBALS['phpgw']->msg->ref_POST); }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_edit: 
$GLOBALS[HTTP_GET_VARS] DUMP:', $GLOBALS['phpgw']->msg->ref_GET); }

@@ -1504,7 +1531,7 @@
                        // this will fill $this->args[] array with any 
submitted prefs args
                        $this->grab_set_prefs();

-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): just passed 
this->grab_set_prefs<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): just passed 
this->grab_set_prefs<br />'); }

                        // ----  HANDLE SETING PREFERENCE   -------
                        if 
(isset($this->args[$this->submit_token_extra_accounts]))
@@ -1518,39 +1545,39 @@
                                // constructor will (has taken care of) 
initialize $GLOBALS['phpgw']->msg

                                // ---  Process Standard Prefs  ---
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): about to 
process_ex_accounts_submitted_prefs Standard Prefs<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): about to 
process_ex_accounts_submitted_prefs Standard Prefs<br />'); }
                                
$this->process_ex_accounts_submitted_prefs($this->std_prefs);

                                // ---  Process Custom Prefs  ---
                                // CUSTOM PREFS ARE MANDATORY! FOR EXTRA 
ACCOUNTS
                                // first, delete whatever value was there for 
"use custom settings" (during pre-release, at times this actually was an 
option, make sure it's gone grom the db)
                                $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this->cust_prefs[0]['id'].'"]';
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_edit(): 
"use_custom_settings" pref, delete it, reference it by 
["ex_accounts"][$this->acctnum]["$this->cust_prefs[0][id]"]<br>'); }
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_edit(): using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_edit(): 
"use_custom_settings" pref, delete it, reference it by 
["ex_accounts"][$this->acctnum]["$this->cust_prefs[0][id]"]<br />'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email: bopreferences.ex_accounts_edit(): using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'); }
                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);

-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): about to 
process_ex_accounts_submitted_prefs Custom Prefs, which are MANDATORY for extra 
email accounts<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): about to 
process_ex_accounts_submitted_prefs Custom Prefs, which are MANDATORY for extra 
email accounts<br />'); }
                                
$this->process_ex_accounts_submitted_prefs($this->cust_prefs);

                                /*
                                // ---  Process Custom Prefs  ---
                                // if they were not mandatory, but that does 
not work
-                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): about to process Custom Prefs<br>'; }
+                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): about to process Custom Prefs<br />'; }
                                if (isset($this->args['use_custom_settings']))
                                {
                                        // custom settings are in use, process 
them
-                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): custom prefs are in use<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): custom prefs are in use<br />'; }
                                        
$this->process_ex_accounts_submitted_prefs($this->cust_prefs);
                                }
                                else
                                {
                                        // custom settings are NOT being used, 
DELETE them from the repository
                                        $c_prefs = count($this->cust_prefs);
-                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): custom prefs NOT in use, deleting 
them<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): custom prefs NOT in use, deleting 
them<br />'; }
                                        for($i=0;$i<$c_prefs;$i++)
                                        {
                                                $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this->cust_prefs[$i]['id'].'"]';
-                                               if ($this->debug_set_prefs > 1) 
{ echo ' ** (looping) email: bopreferences.ex_accounts_edit(): using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo ' ** (looping) email: bopreferences.ex_accounts_edit(): using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
                                        }
                                }
@@ -1563,17 +1590,17 @@
                        if (!$actually_did_something)
                        {
                                // nothing happened above that requires saving 
the repository
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): nothing happened 
that requires save_repository, 
$actually_did_something='.serialize($actually_did_something).'<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): nothing happened 
that requires save_repository, 
$actually_did_something='.serialize($actually_did_something).'<br />'); }
                        }
                        elseif ($this->debug_set_prefs > 1)
                        {
                                // we actually did something that requires 
saving repository, but are we in debug mode
-                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): *debug* at 
['.$this->debug_set_prefs.'] so skipping save_repository<br>');
+                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): *debug* at 
['.$this->debug_set_prefs.'] so skipping save_repository<br />');
                        }
                        else
                        {
                                // we actually did something that requires 
saving repository, and we have the go-ahead
-                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): SAVING 
REPOSITORY<br>'); }
+                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): SAVING 
REPOSITORY<br />'); }
                                
$GLOBALS['phpgw']->preferences->save_repository();
                        }

@@ -1588,14 +1615,14 @@
                                                                                
'/index.php',
                                                                                
'menuaction=email.uipreferences.ex_accounts_list');

-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): almost LEAVING, 
about to issue a redirect to:<br>'.$take_me_to_url.'<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): almost LEAVING, 
about to issue a redirect to:<br />'.$take_me_to_url.'<br />'); }
                        if ($this->debug_set_prefs > 1)
                        {
-                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): LEAVING, *debug* 
at ['.$this->debug_set_prefs.'] so skipping Header redirection to: 
['.$take_me_to_url.']<br>');
+                               
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit(): LEAVING, *debug* 
at ['.$this->debug_set_prefs.'] so skipping Header redirection to: 
['.$take_me_to_url.']<br />');
                        }
                        else
                        {
-                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit: LEAVING with 
redirect to: <br>'.$take_me_to_url.'<br>'); }
+                               if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_edit: LEAVING with 
redirect to: <br />'.$take_me_to_url.'<br />'); }
                                Header('Location: ' . $take_me_to_url);
                        }
                }
@@ -1608,7 +1635,7 @@
                */
                function ex_accounts_list()
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: ENTERING<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: ENTERING<br />'); }

                        // list accounts, except "empty" ones (show "enabled" 
and "disabled"
                        $return_list = array();
@@ -1618,14 +1645,14 @@
                                $this_acctnum = 
$GLOBALS['phpgw']->msg->extra_accounts[$i]['acctnum'];
                                $this_status = 
$GLOBALS['phpgw']->msg->extra_accounts[$i]['status'];

-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: 
$GLOBALS[phpgw]->msg->extra_accounts['.$i.'][acctnum]=['.$this_acctnum.'] ;  
[status]=['.$this->extra_accounts[$i]['status'].'] <br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: 
$GLOBALS[phpgw]->msg->extra_accounts['.$i.'][acctnum]=['.$this_acctnum.'] ;  
[status]=['.$this->extra_accounts[$i]['status'].'] <br />'); }
                                if ($this_status == 'empty')
                                {
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: 
$GLOBALS[phpgw]->msg->extra_accounts['.$i.'][status] == empty <br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: 
$GLOBALS[phpgw]->msg->extra_accounts['.$i.'][status] == empty <br />'); }
                                }
                                else
                                {
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: 
$GLOBALS[phpgw]->msg->extra_accounts['.$i.'][status] != empty <br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: 
$GLOBALS[phpgw]->msg->extra_accounts['.$i.'][status] != empty <br />'); }
                                        $next_pos = count($return_list);
                                        //$next_pos = $this_acctnum - 1;
                                        $return_list[$next_pos]['acctnum'] = 
$this_acctnum;
@@ -1694,11 +1721,11 @@
                                        }
                                        // NEXT: html encode the acctname string
                                        // html encode entities on the fullname 
so it's safe to display in the browser, and prefix with the acctnum
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: fullname raw: 
<code>'.serialize($accountname).'</code><br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: fullname raw: 
<code>'.serialize($accountname).'</code><br />'); }
                                        $accountname = 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($accountname);
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: fullname B: 
<code>'.serialize($accountname).'</code><br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: fullname B: 
<code>'.serialize($accountname).'</code><br />'); }
                                        $accountname = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($accountname);
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: fullname C: 
<code>'.serialize($accountname).'</code><br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: fullname C: 
<code>'.serialize($accountname).'</code><br />'); }
                                        // FINALLY we have a string we are 
going to display to the user that is the name of the account
                                        
$return_list[$next_pos]['display_string'] = '['.$this_acctnum.'] '.$accountname;

@@ -1716,7 +1743,7 @@
                                }
                        }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: returning 
$return_list[] DUMP:', $return_list); }
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: LEAVING, returning 
$return_list <br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.ex_accounts_list: LEAVING, returning 
$return_list <br />'); }
                        return $return_list;
                }

@@ -1728,12 +1755,12 @@
                */
                function get_first_empty_ex_acctnum()
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: 
ENTERING<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: 
ENTERING<br />'); }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email: bopreferences.get_first_empty_ex_acctnum: 
$GLOBALS[phpgw]->msg->extra_accounts DUMP:', 
$GLOBALS['phpgw']->msg->extra_accounts); }
                        $loops = count($GLOBALS['phpgw']->msg->extra_accounts);
                        if ($loops == 0)
                        {
-                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: 
count($GLOBALS[phpgw]->msg->extra_accounts 
=['.serialize(count($GLOBALS['phpgw']->msg->extra_accounts)).']<br>'); }
+                               if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: 
count($GLOBALS[phpgw]->msg->extra_accounts 
=['.serialize(count($GLOBALS['phpgw']->msg->extra_accounts)).']<br />'); }
                                $first_empty_ex_acctnum = 1;
                        }
                        else
@@ -1744,10 +1771,10 @@
                                        $this_acctnum = 
$GLOBALS['phpgw']->msg->extra_accounts[$i]['acctnum'];
                                        $this_status = 
$GLOBALS['phpgw']->msg->extra_accounts[$i]['status'];
                                        // loop =0 *would* = acctnum 1 *if* 
acctnum slots are filled in order, they'd always be 1 apart
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: in loop 
['.$i.'] : status: ['.$this_status.'] ; acctnum: ['.$this_acctnum.']<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: in loop 
['.$i.'] : status: ['.$this_status.'] ; acctnum: ['.$this_acctnum.']<br />'); }
                                        if ($this_status == 'empty')
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: 
[status] == empty for acctnum ['.$this_acctnum.']<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: 
[status] == empty for acctnum ['.$this_acctnum.']<br />'); }
                                                $first_empty_ex_acctnum = 
(int)$this_acctnum;
                                                $did_get_acctnum = True;
                                                break;
@@ -1755,7 +1782,7 @@
                                        elseif ((int)($i+1) != 
(int)$this_acctnum)
                                        {
                                                $first_empty_ex_acctnum = 
(int)($i+1);
-                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: slots 
have an empty spot, unused $acctnum is ['.$first_empty_ex_acctnum.']<br>'); }
+                                               if ($this->debug_set_prefs > 1) 
{ $this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: slots 
have an empty spot, unused $acctnum is ['.$first_empty_ex_acctnum.']<br />'); }
                                                $did_get_acctnum = True;
                                                break;
                                        }
@@ -1766,10 +1793,10 @@
                                        $first_empty_ex_acctnum = 
count($GLOBALS['phpgw']->msg->extra_accounts);
                                        // since extra accounts are not zero 
based, add one to that count to get real next available
                                        $first_empty_ex_acctnum++;
-                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: no empty 
spaces extra_accounts[], advance to next int: $first_empty_ex_acctnum 
['.$first_empty_ex_acctnum.']<br>'); }
+                                       if ($this->debug_set_prefs > 1) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: no empty 
spaces extra_accounts[], advance to next int: $first_empty_ex_acctnum 
['.$first_empty_ex_acctnum.']<br />'); }
                                }
                        }
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: LEAVING, 
returning $first_empty_ex_acctnum 
['.serialize($first_empty_ex_acctnum).']<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.get_first_empty_ex_acctnum: LEAVING, 
returning $first_empty_ex_acctnum ['.serialize($first_empty_ex_acctnum).']<br 
/>'); }
                        return $first_empty_ex_acctnum;
                }

@@ -1781,7 +1808,7 @@
                */
                function obtain_ex_acctnum()
                {
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email: bopreferences.obtain_ex_acctnum: ENTERING<br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email: bopreferences.obtain_ex_acctnum: ENTERING<br 
/>'); }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email: bopreferences.obtain_ex_acctnum: 
$GLOBALS[HTTP_POST_VARS] DUMP:', $GLOBALS['phpgw']->msg->ref_POST); }
                        if ($this->debug_set_prefs > 2) { 
$this->msg->dbug->out('email: bopreferences.obtain_ex_acctnum: 
$GLOBALS[HTTP_GET_VARS] DUMP:', $GLOBALS['phpgw']->msg->ref_GET); }
                        // get fromPOST or GET
@@ -1812,7 +1839,7 @@
                        {
                                $final_acctnum = $prelim_acctnum;
                        }
-                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.obtain_ex_acctnum: LEAVING, 
returning $final_acctnum: ['.serialize($final_acctnum).'] <br>'); }
+                       if ($this->debug_set_prefs > 0) { 
$this->msg->dbug->out('email.bopreferences.obtain_ex_acctnum: LEAVING, 
returning $final_acctnum: ['.serialize($final_acctnum).'] <br />'); }
                        return $final_acctnum;
                }


====================================================
Index: email/inc/class.bosend.inc.php
diff -u email/inc/class.bosend.inc.php:1.12 email/inc/class.bosend.inc.php:1.13
--- email/inc/class.bosend.inc.php:1.12 Thu Dec 30 23:13:50 2004
+++ email/inc/class.bosend.inc.php      Sun Mar 13 23:22:44 2005
@@ -1,35 +1,35 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - email send non-SMTP functions                          
        *
-       * http://www.phpgroupware.org                                           
                        *
-       * Written by Angelo (Angles) Puglisi <address@hidden>           *
-       * --------------------------------------------                          
                        *
-       *  This program is free software; you can redistribute it and/or modify 
it              *
-       *  under the terms of the GNU General Public License as published by 
the        *
-       *  Free Software Foundation; either version 2 of the License, or (at 
your               *
-       *  option) any later version.                                           
                *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - email send non-SMTP functions
+       * @author Angelo (Angles) Puglisi <address@hidden>
+       * @author Dave Hall - skwashd at phpgroupware.org
+       * @copyright Portions Copyright (C) 2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @package email
+       * @version $Id$
+       */

-       /* $Id$ */
-
-       /*!
-       @class bosend
-       @abstract bo class for assembling messages for sending via class send
-       @author Angles, server side attachment storage technique borrowed from 
Squirrelmail,

+       /**
+       * class bosend
+       *
+       * bo class for assembling messages for sending via class send
+       * @internal server side attachment storage technique borrowed from 
Squirrelmail
        */
        class bosend
        {
                var $public_functions = array(
                        'sendorspell'   => True,
                        'spellcheck'    => True,
-                       'send'  => True
+                       'send'          => True,
+                       'save_draft'    => True,
                );
                var $mail_spell;
                var $msg_bootstrap;
                var $nextmatchs;
                var $not_set='-1';
                var $mail_out = array();
+               var $smtp;
                var $xi;

                // debug level between 0 to 3
@@ -43,7 +43,7 @@

                function bosend()
                {
-                       if ($this->debug_constructor > 0) { echo 'email.bosend 
*constructor*: ENTERING<br>'; }
+                       if ($this->debug_constructor > 0) { echo 'email.bosend 
*constructor*: ENTERING<br />'; }

                        // May 9, 2003 Ryan Bonham adds company disclaimer code
                        // This Disclaimer will be added to any out going mail
@@ -53,15 +53,17 @@
                        
$this->msg_bootstrap->ensure_mail_msg_exists('email.bosend.constructor', 
$this->debug_send);

                        $this->not_set = $GLOBALS['phpgw']->msg->not_set;
-                       if ($this->debug_constructor > 0) { echo 'email.bosend 
*constructor*: LEAVING<br>'; }
+                       if ($this->debug_constructor > 0) { echo 'email.bosend 
*constructor*: LEAVING<br />'; }
                }

-               /*!
-               @function get_originating_ip
-               @abstract the client IP for this phpgw user at the time the 
send button was clicked
-               @discussion Gets the value for the "X-Originating-IP" header. 
That header  is used
-               by hotmail, for example, it looked like a "good thing" and was 
a feature request, so we
-               use it here too. Even if the IP private (such as on a LAN), 
this can still be useful for the admin.
+               /**
+               * Get the IP address of the client sending this message
+               *
+               * Gets the value for the "X-Originating-IP" header, which is 
used by hotmail,
+               * for example, it looked like a "good thing" so it here too.
+               * Even if the IP private (such as on a LAN), this can still be 
useful for the admin.
+               * @author Angles
+               * @returns string client IP address
                */
                function get_originating_ip()
                {
@@ -70,9 +72,9 @@
                        {
                                $got_ip = 
$GLOBALS['phpgw']->session->getuser_ip();
                        }
-                       elseif 
(isset($GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR']))
+                       elseif (isset($_SERVER['REMOTE_ADDR']))
                        {
-                               $got_ip = 
$GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR'];
+                               $got_ip = $_SERVER['REMOTE_ADDR'];
                        }

                        // did we get anything useful ?
@@ -85,28 +87,30 @@



-               /*!
-               @function copy_to_sent_folder
-               @abstract Put a message in "Sent" Folder, if Applicable. This 
MUST be a message that has been sent already!
-               @result Boolean
-               @author Angles
-               @discussion If a message has already been sent, and IF the user 
has set the pref enabling the use of the sent folder,
-               only then should this function be used. If a message has not 
actually been sent, it should NOT be copied to the "Sent"
-               folder because that misrepresents to the user the history of 
the message. Mostly this is an issue with automated
-               messages sent from other apps. My .02 cents is that if a user 
did not send a message by pressing the "Send" button,
-               then the message does not belong in the Sent messages folder. 
Other people may have a different opinion, so
-               this function will not zap your keyboard if you think 
differently. Nonetheless, if the user has not enabled
-               the preference "Sent mail copied to Sent Folder", then noting 
gets copied there no matter what. Note that we
-               obtain these preference settings as shown in the example for 
this function. If the folder does not already exist,
-               class mail_msg has code to make every reasonable attempt to 
create the folder automatically. Some servers
-               just do things differently enough (unusual namespaces, sub 
folder trees) that the auto create may not work,
-               but it is nost likly that it can be created, and even more 
likely that it already exists. NOTE: this particular class
-               should be made availabllle to public use without the brain 
damage that is the current learning curve for this
-               code. BUT for now, this is a private function unless you really 
know what you are doing. Even then, code
-               in this class is subject to change.
-               @access private - NEEDS TO BE MADE AVAILABLE FOR PUBLIC USE
+               /**
+               * Put a message in "Sent" Folder, if Applicable. This MUST be a 
message that has been sent already!
+               *
+               * If a message has already been sent, and IF the user has set 
the pref enabling the use of the sent folder,
+               * only then should this function be used. If a message has not 
actually been sent, it should NOT be copied to the "Sent"
+               * folder because that misrepresents to the user the history of 
the message. Mostly this is an issue with automated
+               * messages sent from other apps. My .02 cents is that if a user 
did not send a message by pressing the "Send" button,
+               * then the message does not belong in the Sent messages folder. 
Other people may have a different opinion, so
+               * this function will not zap your keyboard if you think 
differently. Nonetheless, if the user has not enabled
+               * the preference "Sent mail copied to Sent Folder", then noting 
gets copied there no matter what. Note that we
+               * obtain these preference settings as shown in the example for 
this function. If the folder does not already exist,
+               * class mail_msg has code to make every reasonable attempt to 
create the folder automatically. Some servers
+               * just do things differently enough (unusual namespaces, sub 
folder trees) that the auto create may not work,
+               * but it is nost likly that it can be created, and even more 
likely that it already exists. NOTE: this particular class
+               * should be made availabllle to public use without the brain 
damage that is the current learning curve for this
+               * code. BUT for now, this is a private function unless you 
really know what you are doing. Even then, code
+               * in this class is subject to change.
+               *
+               * @author Angles
+               * @access private
+               * @internal NEEDS TO BE MADE AVAILABLE FOR PUBLIC USE
+               * @returns bool was the message saved?
                */
-               function copy_to_sent_folder()
+               function copy_to_sent_folder($message)
                {
                        /*!
                        @capability (FUTURE CODE) append to sent folder without 
a pre-existing mailsvr_stream.
@@ -127,78 +131,135 @@
                                // ERROR, THIS ACCT DOES NOT WANT SENT FOLDER 
USED
                                return False;
                        }
-
-
-                       // note: what format should these folder name options 
(sent and trash) be held in
-                       // i.e. long or short name form, in the prefs database
-                       $sent_folder_name = 
$GLOBALS['phpgw']->msg->get_pref_value('sent_folder_name');
-
-                       // NOTE: append will open the stream automatically IF 
it is not open
-                       //if 
((($GLOBALS['phpgw']->msg->get_isset_arg('mailsvr_stream')))
-                       //&& 
($GLOBALS['phpgw']->msg->get_arg_value('mailsvr_stream') != ''))
-                       //{
-                               // note: "append" will CHECK  to make sure this 
folder exists, and try to create it if it does not
-                               // also note, make sure there is a \r\n CRLF 
empty last line sequence so Cyrus will be happy
-                               $success = 
$GLOBALS['phpgw']->msg->phpgw_append($sent_folder_name,
-                                                               
$GLOBALS['phpgw']->mail_send->assembled_copy."\r\n",
-                                                               "\\Seen");
-                               //if ($success) { echo 'append to sent OK<br>'; 
} else { echo 'append to sent FAILED<br>'; echo 'imap_last_error: 
'.imap_last_error().'<br>'; }
-                       //}
-                       //else
-                       //{
-                               //echo 'NO STREAM available for sent folder 
append<br>';
-                       //      return False;
-                       //}
-
-                       return $success;
+
+                       return $this->save_message($message, 
$GLOBALS['phpgw']->msg->get_pref_value('sent_folder_name'));
+               }
+
+               /**
+               * Save a message to the nominated folder
+               *
+               * @author skwashd
+               * @param string $msg the mail message
+               * @param string $folder the folder the message is to be saved in
+               * @param string $extra_flags any additional flags for message?
+               * @return bool was the message saved?
+               */
+               function save_message($msg, $folder, $extra_flags = '')
+               {
+                       if(! ($msg && $folder) )
+                       {
+                               return False; //invalid args
+                       }
+
+                       /*
+                       NOTES:  "append" will CHECK  to make sure this folder 
exists, and try to create it if it does not
+                               make sure there is a \r\n CRLF empty last line 
sequence so Cyrus will be happy
+                       */
+                       return $GLOBALS['phpgw']->msg->phpgw_append($folder,
+                                                       $msg . "\r\n",
+                                                       "\\Seen 
{$extra_flags}");
+               }
+
+               /**
+               * Marks a message as being replied to - like most other MUAs do
+               *
+               * @param array $msgball the message info
+               */
+               function mark_as_replied($msgball)
+               {
+                       $GLOBALS['phpgw']->msg->phpgw_set_flag($msgball, 
"\\Answered");
                }

-               //  -------  This will be called just before leaving this page, 
to clear / unset variables / objects -----------
+               /**
+               * This is called just before leaving this page, to clear / 
unset variables / objects
+               */
                function send_message_cleanup()
                {
                        //echo 'send_message cleanup';
                        $GLOBALS['phpgw']->msg->end_request();
-                       // note: the next lines can be removed since php takes 
care of memory management
-                       $this->mail_out = '';
-                       unset($this->mail_out);
-                       $GLOBALS['phpgw']->mail_send = '';
-                       unset($GLOBALS['phpgw']->mail_send);
+
+                       $upload_dir = $GLOBALS['phpgw']->msg->att_files_dir;
+                       if (file_exists($upload_dir))
+                       {
+                               $dh = dir($upload_dir);
+                               while ( ($file = $dh->read() ) !== false )
+                               {
+                                       if( $file != '.' && $file != '..' )
+                                       {
+                                               unlink($upload_dir . SEP . 
$file);
+                                       }
+                               }
+                               $dh->close();
+                               rmdir($upload_dir);
+                       }
                }

-               /*!
-               @function sendorspell
-               @abstract detects whether the compose page was submitted as a 
send or spellcheck, and acts accordingly
-               @params none, uses GET and POST vars
-               @author Angles
-               @discussion Compose form submit action target is bosend, 
naturally, however the spell check button submit is identical
-               EXCEPT "btn_spellcheck" POST var will be set, which requires we 
handoff the handling to the spell class.
+               /**
+               * Detects whether the compose page was submitted as a send or 
spellcheck, and acts accordingly
+               *
+               * Compose form submit action target is bosend, naturally, 
however the spell check button submit is identical
+               * EXCEPT "btn_spellcheck" POST var will be set, which requires 
we handoff the handling to the spell class.
+               * @author Angles
                */
                function sendorspell()
                {
-                       if ($this->debug_sendorspell > 0) { echo 'ENTERING: 
email.bosend.sendorspell'.'<br>'; }
+                       if ($this->debug_sendorspell > 0)
+                       {
+                               echo 'ENTERING: email.bosend.sendorspell'.'<br 
/>';
+                       }

-                       if ($this->debug_sendorspell > 2) {     echo 
'email.bosend.sendorspell: data dump: $GLOBALS[HTTP_POST_VARS]<pre>'; 
print_r($GLOBALS['phpgw']->msg->ref_POST); echo '</pre>'."\r\n";
-                                                                       echo 
'email.bosend.sendorspell: data dump: $GLOBALS[HTTP_GET_VARS]<pre>'; 
print_r($GLOBALS['phpgw']->msg->ref_GET); echo '</pre>'."\r\n"; }
+                       if ($this->debug_sendorspell > 2)
+                       {
+                               echo 'email.bosend.sendorspell: data dump: 
$GLOBALS[HTTP_POST_VARS]<pre>';
+                               print_r($GLOBALS['phpgw']->msg->ref_POST);
+                               echo '</pre>'."\r\n";
+
+                               echo 'email.bosend.sendorspell: data dump: 
$GLOBALS[HTTP_GET_VARS]<pre>';
+                               print_r($GLOBALS['phpgw']->msg->ref_GET);
+                               echo '</pre>'."\r\n";
+                       }
+
+                       if ((isset($GLOBALS['phpgw']->msg->ref_POST['draft']))
+                       && ($GLOBALS['phpgw']->msg->ref_POST['draft'] == 
'save'))
+                       {
+                               if ($this->debug_sendorspell > 1)
+                               {
+                                       echo 'email.bosend.sendorspell: "draft" 
is set && == save; calling $this->save_draftk()'.'<br />';
+                               }
+                               $this->save_draft();
+                       }

                        if 
((isset($GLOBALS['phpgw']->msg->ref_POST['btn_spellcheck']))
                        && ($GLOBALS['phpgw']->msg->ref_POST['btn_spellcheck'] 
!= ''))
                        {
-                               if ($this->debug_sendorspell > 1) { echo 
'email.bosend.sendorspell: "btn_spellcheck" is set; calling 
$this->spellcheck()'.'<br>'; }
+                               if ($this->debug_sendorspell > 1)
+                               {
+                                       echo 'email.bosend.sendorspell: 
"btn_spellcheck" is set; calling $this->spellcheck()'.'<br />';
+                               }
                                $this->spellcheck();
                        }
                        elseif 
((isset($GLOBALS['phpgw']->msg->ref_POST['btn_send']))
                        && ($GLOBALS['phpgw']->msg->ref_POST['btn_send'] != ''))
                        {
-                               if ($this->debug_sendorspell > 1) { echo 
'email.bosend.sendorspell: "btn_send" is set; calling $this->send()'.'<br>'; }
+                               if ($this->debug_sendorspell > 1)
+                               {
+                                       echo 'email.bosend.sendorspell: 
"btn_send" is set; calling $this->send()'.'<br />';
+                               }
                                $this->send();
                        }
                        else
                        {
-                               if ($this->debug_sendorspell > 1) { echo ': 
email.bosend.sendorspell: ERROR: neither "btn_spellcheck" not "btn_send" is 
set; fallback action $this->send()'.'<br>'; }
+                               if ($this->debug_sendorspell > 1)
+                               {
+                                       echo ': email.bosend.sendorspell: 
ERROR: neither "btn_spellcheck" not "btn_send" is set; fallback action 
$this->send()'.'<br />';
+                               }
                                $this->send();
                        }

-                       if ($this->debug_sendorspell > 0) { echo 'LEAVING: 
email.bosend.sendorspell'.'<br>'; }
+                       if ($this->debug_sendorspell > 0)
+                       {
+                               echo 'LEAVING: email.bosend.sendorspell'.'<br 
/>';
+                       }
                }


@@ -211,7 +272,7 @@
                */
                function spellcheck()
                {
-                       if ($this->debug_spellcheck > 0) { echo 'ENTERING: 
email.bosend.spellcheck'.'<br>'; }
+                       if ($this->debug_spellcheck > 0) { echo 'ENTERING: 
email.bosend.spellcheck'.'<br />'; }

                        if ($this->debug_spellcheck > 2) {      echo 
'email.bosend.spellcheck: data dump: $GLOBALS[HTTP_POST_VARS]<pre>'; 
print_r($GLOBALS['phpgw']->msg->ref_POST); echo '</pre>'."\r\n";
                                                                        echo 
'email.bosend.spellcheck: data dump: $GLOBALS[HTTP_GET_VARS]<pre>'; 
print_r($GLOBALS['phpgw']->msg->ref_GET); echo '</pre>'."\r\n"; }
@@ -252,203 +313,160 @@



-                       if ($this->debug_spellcheck > 0) { echo 'LEAVING: 
email.bosend.spellcheck'.'<br>'; }
+                       if ($this->debug_spellcheck > 0) { echo 'LEAVING: 
email.bosend.spellcheck'.'<br />'; }
                }

-               /*!
-               @function send
-               @abstract if the compose page was submitted as a pellcheck, 
this function is called
-               @params none, uses GET and POST vars, however this will be OOPd 
for API use
-               @discussion advanced function to send mail with all the 
complexities of modern MIME usage.
-               Currently handles forwarding as an "encapsulated" MIME part, 
thus prewserving the original
-               messages structure, including any attachments the original 
message had.
-               Of course the user can attach files, this includes attaching 
additional files to a forwarded message which
-               itself alsready has attachments.
+               /**
+               * Send a mail message.
+               *
+               * @internal a lot of this functionality is now in 
prepare_message
+               * @author Angles
                */
                function send()
                {
-                       if ($this->debug_send> 0) { echo 'ENTERING: 
email.bosend.send'.'<br>'; }
-
-                       if ($this->debug_send> 2) {     echo 
'email.bosend.send: data dump: $GLOBALS[HTTP_POST_VARS]<pre>'; 
print_r($GLOBALS['phpgw']->msg->ref_POST); echo '</pre>'."\r\n";
-                                                                       echo 
'email.bosend.send: data dump: $GLOBALS[HTTP_GET_VARS]<pre>'; 
print_r($GLOBALS['phpgw']->msg->ref_GET); echo '</pre>'."\r\n";
-                                                                       return; 
}
-
-
-                       // ---- BEGIN BO SEND LOGIC

-                       $not_set = $GLOBALS['phpgw']->msg->not_set;
-                       $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
+                       $this->smtp = createObject('email.mail_smtp');

-                       //  -------  Init Array Structure For Outgoing Mail  
-----------
-                       $this->mail_out = Array();
-                       $this->mail_out['to'] = Array();
-                       $this->mail_out['cc'] = Array();
-                       $this->mail_out['bcc'] = Array();
-                       $this->mail_out['mta_to'] = Array();
-                       $this->mail_out['mta_from'] = 
'<'.trim($GLOBALS['phpgw']->msg->get_pref_value('address')).'>';
-                       $this->mail_out['mta_elho_domain'] = '';
-                       $this->mail_out['message_id'] = 
$GLOBALS['phpgw']->msg->make_message_id();
-                       $this->mail_out['boundary'] = 
$GLOBALS['phpgw']->msg->make_boundary();
-                       $this->mail_out['date'] = '';
-                       $this->mail_out['originating_ip'] = 
'['.$this->get_originating_ip().']';
-                       $this->mail_out['main_headers'] = Array();
-                       $this->mail_out['body'] = Array();
-                       $this->mail_out['is_multipart'] = False;
-                       $this->mail_out['num_attachments'] = 0;
-                       $this->mail_out['whitespace'] = chr(9);
-                       $this->mail_out['is_forward'] = False;
-                       $this->mail_out['fwd_proc'] = '';
-                       $this->mail_out['from'] = array();
-                       $this->mail_out['sender'] = '';
-                       $this->mail_out['charset'] = '';
-                       $this->mail_out['msgtype'] = '';
-
-                       //  -------  Start Filling Array Structure For Outgoing 
Mail  -----------
-
-                       // -----  X-PHPGW flag (msgtype)  ------
-                       /*!
-                       @var msgtype
-                       @abstract obsoleted way phpgw apps used to inter-operate
-                       @discussion NOTE  this is a vestigal way for phpgw apps 
to inter-operate,
-                       I *think* this is being obsoleted via n-tiering and 
xml-rpc / soap methods.
-                       RARELY USED, maybe NEVER used, most email code for this 
is now commented out
-                       "back in the day..." the "x-phpgw" header was specified 
by a phpgw app *other* than the email app
-                       which was used to include special phpgw related 
handling instructions in the message which
-                       to the message intentended to be noticed and processed 
by the phpgw email app when the
-                       user open the mail for viewing, at which time the phpgw 
email app would issue the
-                       special handling instructions contained in the 
"x-phpgw" header.
-                       even before n-tiering of the phpgw apps and api begain, 
I (angles) considered this a possible
-                       area of abuse and I commented out the code in the email 
app that would notice, process and issue
-                       those instructions.
-                       */
-                       if (($GLOBALS['phpgw']->msg->get_isset_arg('msgtype'))
-                       && ($GLOBALS['phpgw']->msg->get_arg_value('msgtype') != 
''))
+                       $this->prepare_message();
+
+                       $returnccode = $this->smtp->Send();
+
+                       if( !$this->smtp->ErrorInfo && !$returncode)//need to 
work out why it does this sometimes!
                        {
-                               // convert script GPC args into useful mail_out 
structure information
-                               $this->mail_out['msgtype'] = 
$GLOBALS['phpgw']->msg->get_arg_value('msgtype');
-                               // after this, ONLY USE $this->mail_out 
structure for this
+                               $returncode = 1;
                        }

-                       // -----  CHARSET  -----
-                       /*!
-                       @property charset
-                       @abstract not user specified, not a user var, not an 
argument, not a paramater.
-                       @discussion charset could take up a lot of notes here, 
suffice to say that email began life as a
-                       US-ASCII thing and still us-ascii chars are strictly 
required for some headers, while other headers
-                       and the body have various alternative ways to deal with 
other charsets, ways that are well documented
-                       in email and other RFC's and other literature. In the 
rare event that the phpgw api is unable
-                       to provide us with a charset value, we use the RFC 
specified default value of "US-ASCII"
+                       /*
+                       // ===== DEBUG =====
+                       echo '<br />';
+                       echo 'retain_copy: 
'.serialize($GLOBALS['phpgw']->mail_send->retain_copy);
+                       echo '<br />=== POST SEND ===<br />';
+                       echo 
'<pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($GLOBALS['phpgw']->mail_send->assembled_copy).'</pre>';
+                       echo '<br />';
+                       // ===== DEBUG =====
                        */
-                       if (lang('charset') != '')
+
+                       if( $returnccode && 
$GLOBALS['phpgw']->msg->get_isset_pref('use_sent_folder') )
                        {
-                               $this->mail_out['charset'] = lang('charset');
+                               $success = 
$this->copy_to_sent_folder($this->smtp->getHeader() . "\n" . 
$this->smtp->getBody());
                        }
-                       else
+
+                       if( $is_reply && $returncode )
                        {
-                               // RFC default charset, if none is specified, 
is US-ASCII
-                               $this->mail_out['charset'] = 'US-ASCII';
+                               $this->mark_as_replied($msgball);
                        }

-                       // -----  FROM  -----
-                       /*!
-                       @var from
-                       @abstract the mail's author, OPTIONAL, usually no need 
to specify this as an arg passed to the script.
-                       @discussion Generally this var does not need to be 
specified. When the mail is being sent from the
-                       user's default email account (or mail on behalf of the 
user, like automated email notifications),
-                       we generate the "from" header for the user, hence no 
custom "from" arg is necessary.
-                       This is the most common scenario, in which case we 
generate the "from" value as follows:
-                       (1) the user's "fullname" (a.k.a. the "personal" part 
of the address) is always picked up
-                       from the phpgw api's value that contains the users 
name, and
-                       (2) the user's email address is either (2a) the default 
value from the phpgw api which was
-                       passed into the user's preferences because the user 
specified no custom email address preference, or
-                       (2b) the user specified a custom email address in the 
email preferences in which case the aformentioned
-                       phpgw api default email address is not used in the 
user's preferences array, this user supplied
-                       value is used instead.
-                       Providing a "from" arg is usually for extra email 
accounts and/or alternative email profiles,
-                       where the user wants other than the "from" info 
otherwise defaultly associated with this email acccount.
-                       NOTE: from != sender
-                       from is who the mail came from assuming that person is 
also the mail's author.
-                       this is by far the most common scenario, "from" and 
"author" are usually one in the same
-                       (see below for info on when to *also* use "sender" - 
VERY rare)
-                       */
-                       if (($GLOBALS['phpgw']->msg->get_isset_arg('from'))
-                       && ($GLOBALS['phpgw']->msg->get_arg_value('from') != 
''))
-                       {
-                               $from_assembled = 
$GLOBALS['phpgw']->msg->get_arg_value('sender');
-                       }
-                       else
-                       {
-                               $from_name = 
$GLOBALS['phpgw']->msg->get_pref_value('fullname');
-                               //$from_name = 
$GLOBALS['phpgw_info']['user']['fullname'];
-                               $from_address = 
$GLOBALS['phpgw']->msg->get_pref_value('address');
-                               $from_assembled = '"'.$from_name.'" 
<'.$from_address.'>';
-                       }
-                       // this array gets filled with functiuon 
"make_rfc_addy_array", but it will have only 1 numbered array, 
$this->mail_out['from'][0]
-                       // note that sending it through make_rfc_addy_array 
will ensure correct formatting of non us-ascii chars (if any) in the use's 
fullname
-                       $this->mail_out['from'] = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($from_assembled);
+                       $return_to_folder_href = $this->get_return_to();

-                       // -----  SENDER  -----
-                       /*!
-                       @var sender
-                       @abstract OPTIONAL only used in the rare event that the 
person sending the email
-                       is NOT that email's author.
-                       @discussion RFC2822 makes clear that the Sender header 
is ONLY used if some one
-                       NOT the author (ex. the author's secretary) is sending 
the author's email.
-                       RFC2822 considers that "From" = the author and the 
"Sender" = the person who clicked the
-                       send button. Generally they are one in the same and 
generally the Sender header (and hence this
-                       "sender" var) is NOT needed, not used, not included in 
the email's headers.
-                       */
-                       if (($GLOBALS['phpgw']->msg->get_isset_arg('sender'))
-                       && ($GLOBALS['phpgw']->msg->get_arg_value('sender') != 
''))
+                       if ($returnccode)
                        {
-                               // clean data of magic_quotes escaping (if any)
-                               $this->mail_out['sender'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('sender'));
-                               // convert general address string into 
structured data array of addresses, each has properties [plain] and [personal]
-                               // this array gets filled with functiuon 
"make_rfc_addy_array", but it will have only 1 numbered array, 
$this->mail_out['sender'][0]
-                               $sender_array = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($this->mail_out['sender']);
-                               // realistically sender array should have no 
more than one member (can there really be more than 1 sender?)
-                               if (count($sender_array) > 0)
+                               // Success
+                               if ($GLOBALS['phpgw']->mail_send->trace_flag > 
0)
                                {
-                                       $this->mail_out['sender'] = 
$GLOBALS['phpgw']->msg->addy_array_to_str($sender_array);
-                                       // bogus data check
-                                       if (trim($this->mail_out['sender']) == 
'')
-                                       {
-                                               $this->mail_out['sender'] = '';
-                                       }
+                                       // for debugging
+                                       echo '<html><body>'."\r\n";
+                                       echo '<h2>Here is the communication 
from the MUA(phpgw) <--> MTA(smtp server) trace data dump</h2>'."\r\n";
+                                       echo '<h3>trace data flag set to 
['.(string)$GLOBALS['phpgw']->mail_send->trace_flag.']</h3>'."\r\n";
+                                       echo '<pre>'."\r\n";
+                                       $this->smtp->ErrorInfo;
+                                       echo '</pre>'."\r\n";
+                                       echo '<p>&nbsp;<br /></p>'."\r\n";
+                                       echo '<p>To go back to the msg list, 
click <a href="'.$return_to_folder_href.'">here</a></p><br />';
+                                       echo '</body></html>';
+                                       $this->send_message_cleanup();
                                }
                                else
                                {
-                                       $this->mail_out['sender'] = '';
+                                       // unset some vars (is this necessary?)
+                                       $this->send_message_cleanup();
+                                       // redirect the browser to the index 
page for the appropriate folder
+                                       //header('Location: 
'.$return_to_folder_href);
+                                       
$GLOBALS['phpgw']->redirect($return_to_folder_href);
+                                       // kill the rest of this script
+                                       if (is_object($GLOBALS['phpgw']->msg))
+                                       {
+                                               // close down ALL mailserver 
streams
+                                               
$GLOBALS['phpgw']->msg->end_request();
+                                               // destroy the object
+                                               $GLOBALS['phpgw']->msg = '';
+                                               unset($GLOBALS['phpgw']->msg);
+                                       }
+                                       // shut down this transaction
+                                       
$GLOBALS['phpgw']->common->phpgw_exit(False);
                                }
-                               // after this, ONLY USE $this->mail_out[] 
structure for this
-                               // it will either be blank string OR a string 
which should be 1 email address
                        }
-                       // -----  DATE  -----
-                       /*!
-                       @property date
-                       @abstract not user specified, not a user var, not an 
argument, not a paramater.
-                       @discussion According to RFC2822 the Date header 
*should* be the local time with the correct
-                       timezone offset relative to GMT, however this is 
problematic on many Linux boxen, and
-                       in general I have found that reliably extracting this 
data from the host OS can be tricky,
-                       so instead we use a fallback value which is simply GMT 
time, which is allowed under RFC2822
-                       but not preferred.
-                       FUTURE: figure out a host independant way of getting 
the correct rfc time and TZ offset
-                       */
-                       $this->mail_out['date'] = gmdate('D, d M Y H:i:s').' 
+0000';
+                       else
+                       {
+                               // ERROR - mail NOT sent
+                               echo '<html><body>'."\r\n";
+                               echo '<h2>Your message could <b>not</b> be 
sent!</h2>'."\r\n";
+                               echo '<h3>The mail server 
returned:</h3>'."\r\n";
+                               echo '<pre>';
+                               $this->smtp->ErrorInfo;
+                               echo '</pre>'."\r\n";
+                               echo '<p>To go back to the msg list, click <a 
href="'.$return_to_folder_href.'">here</a> </p>'."\r\n";
+                               echo '</body></html>';
+                               $this->send_message_cleanup();
+                       }
+               }
+
+               /**
+               * Prepare a RFC 2822 Message
+               *
+               * @author skwashd
+               * @internal remnants of Angles' code remains
+               * @internal the old send code has been rewritten to use 
phpmailer.sf.net - which makes our life so much easier
+               */
+               function prepare_message()
+               {

-                       // -----  MYMACHINE - The MTA HELO/ELHO DOMAIN ARG  
-----
-                       /*!
-                       @property elho SMTP handshake domain value
-                       @abstract not user specified, not a user var, not an 
argument, not a paramater.
-                       @discussion when class.msg_send conducts the handshake 
with the SMTP server, this
-                       will be the required domain value that we supply to the 
SMTP server. Phpgw is considered
-                       the client to the SMTP server.
-                       RFC2821 sect 4.1.1.1 specifies this value is almost 
always the Fully Qualified Domain Name
-                       of the SMTP client machine, but rarely, when said 
client machine has dynamic FQDN or no reverse
-                       mapping is available, this value *should* be "address 
leteral" (see sect 4.1.3).
-                       Refer to the documentation for BIND for further reading 
on reverse lookup issues.
-                       */
-                       $this->mail_out['mta_elho_mymachine'] = 
trim($GLOBALS['phpgw_info']['server']['hostname']);
+                       if ($this->debug_send > 0)
+                       {
+                               echo 'ENTERING: email.bosend.send'.'<br />';
+                       }
+
+                       if ($this->debug_send > 2)
+                       {
+                               echo 'email.bosend.send: data dump: 
$GLOBALS[HTTP_POST_VARS]<pre>';
+                               print_r($GLOBALS['phpgw']->msg->ref_POST);
+                               echo '</pre>'."\r\n";
+
+                               echo 'email.bosend.send: data dump: 
$GLOBALS[HTTP_GET_VARS]<pre>';
+                               print_r($GLOBALS['phpgw']->msg->ref_GET);
+                               echo '</pre>'."\r\n";
+                               return;
+                       }
+
+                       // ---- BEGIN BO SEND LOGIC
+
+                       $not_set = $GLOBALS['phpgw']->msg->not_set;
+                       $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
+
+                       //  -------  Init Array Structure For Outgoing Mail  
-----------
+                       $this->mail_out = Array();
+                       $this->mail_out['whitespace'] = chr(9);
+                       $this->mail_out['is_forward'] = False;
+                       $this->mail_out['fwd_proc'] = '';
+
+                       $is_reply = False;
+
+                       $this->smtp->CharSet = (lang('charset') != 'charset*') 
? lang('charset') : 'US-ASCII';
+
+                       $this->smtp->Sender = ( 
$GLOBALS['phpgw']->msg->get_isset_arg('sender')
+                                               ? 
$GLOBALS['phpgw']->msg->get_arg_value('sender')
+                                               : '');
+
+                       $this->smtp->FromName = 
$GLOBALS['phpgw']->msg->get_pref_value('fullname');
+
+                       $this->smtp->From = 
$GLOBALS['phpgw']->msg->get_pref_value('address');
+
+                       $this->smtp->Subject = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('subject'));
+
+                       $this->smtp->Helo = 
trim($GLOBALS['phpgw_info']['server']['hostname']);
+
+                       $this->smtp->Body = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->get_arg_value('body')));
+
+                       $this->smtp->AddCustomHeader('X-Originating-IP: ' . 
$this->get_originating_ip() );

                        // ----  Forwarding Detection  -----
                        if (($GLOBALS['phpgw']->msg->get_isset_arg('action'))
@@ -466,49 +484,20 @@
                                // after this, ONLY USE $this->mail_out[] 
structure for this
                        }

-                       // ----  Attachment Detection  -----
-                       // some of this attachment uploading and handling code 
is from squirrelmail (www.squirrelmail.org)
-                       $upload_dir = $GLOBALS['phpgw']->msg->att_files_dir;
-                       if (file_exists($upload_dir))
-                       {
-                               // DO WE REALLY need to set_time_limit here?
-                               //@set_time_limit(0);
-                               // how many attachments do we need to process?
-                               $dh = opendir($upload_dir);
-                               $num_expected = 0;
-                               while ($file = readdir($dh))
-                               {
-                                       if (($file != '.')
-                                       && ($file != '..')
-                                       && (ereg("\.info",$file)))
-                                       {
-                                               $num_expected++;
-                                       }
-                               }
-                               closedir($dh);
-                               if ($num_expected > 0)
-                               {
-                                       $this->mail_out['num_attachments'] = 
$num_expected;
-                                       $this->mail_out['is_multipart'] = True;
-                               }
-                       }
-
                        //  ------  get rid of the escape \ that magic_quotes 
(if enabled) HTTP POST will add, " becomes \" and  '  becomes  \'
                        // convert script GPC args into useful mail_out 
structure information
                        $to = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('to'));
                        $cc = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('cc'));
                        $bcc = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('bcc'));
-                       $body = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->get_arg_value('body')));
-                       $subject = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('subject'));
                        // after this,  do NOT use ->msg->get_arg_value() for 
these anymore

                        // since arg "body" *may* be huge (and is now in local 
var $body), lets clear it now
                        $GLOBALS['phpgw']->msg->set_arg_value('body', '');

-                       // ----  DE-code HTML SpecialChars in the body   -----
-                       // THIS NEEDS TO BE CHANGED WHEN MULTIPLE PART FORWARDS 
ARE ENABLED
-                       // BECAUSE WE CAN ONLY ALTER THE 1ST PART, I.E. THE 
PART THE USER JUST TYPED IN
-                       /*  email needs to be sent out as if it were PLAIN text 
(at least the part we are handling here)
+                       /* ----  DE-code HTML SpecialChars in the body   -----
+                       THIS NEEDS TO BE CHANGED WHEN MULTIPLE PART FORWARDS 
ARE ENABLED
+                       BECAUSE WE CAN ONLY ALTER THE 1ST PART, I.E. THE PART 
THE USER JUST TYPED IN
+                       email needs to be sent out as if it were PLAIN text (at 
least the part we are handling here)
                        i.e. with NO ENCODED HTML ENTITIES, so use > instead of 
$rt; and " instead of &quot; . etc...
                        it's up to the endusers MUA to handle any 
htmlspecialchars, whether to encode them or leave as it, the MUA should decide
                        */
@@ -531,41 +520,39 @@
                                                .'-- '."\r\n"
                                                .$user_sig ."\r\n";
                        }
+
                        if ($this->company_disclaimer)
                        {
-                               $body = $body .$this->company_disclaimer;
+                               $this->smtp->Body = $this->smtp->Body . 
$this->company_disclaimer;
                        }

-                       // LINE LENGTH for "new" and our text of a forwarded 
text are 78 chars,
-                       // which is SHORTER than for reply quoted bodies that 
have ">" chars
-                       // this is only for text WE have written, not any other 
part of the body
-                       // html textbox no longer adds hard wrap on submit, so 
we handle it here now
-                       // NOTE reply bodies have already been handled as to 
length when we quoted the text
-                       //if 
(($GLOBALS['phpgw']->msg->get_isset_arg('orig_action'))
-                       //&& (
-                       //      
($GLOBALS['phpgw']->msg->get_arg_value('orig_action') == 'new')
-                       //      || 
($GLOBALS['phpgw']->msg->get_arg_value('orig_action') == 'forward')
-                       //      )
-                       //)
+                       /*
+                       LINE LENGTH for "new" and our text of a forwarded text 
are 78 chars,
+                       which is SHORTER than for reply quoted bodies that have 
">" chars
+                       this is only for text WE have written, not any other 
part of the body
+                       html textbox no longer adds hard wrap on submit, so we 
handle it here now
+                       NOTE reply bodies have already been handled as to 
length when we quoted the text
+                       */
                        if (($GLOBALS['phpgw']->msg->recall_desired_action()== 
'new')
                        || ($GLOBALS['phpgw']->msg->recall_desired_action() == 
'forward'))
                        {
                                // WRAP BODY to lines of 78 chars then CRLF
                                // IS THIS TOO SHORT? what about code snippets 
and stuff?or long URLs
-                               $body = 
$GLOBALS['phpgw']->msg->body_hard_wrap($body, 78);
+                               $this->smtp->Body = 
$GLOBALS['phpgw']->msg->body_hard_wrap($this->smtp->Body, 78);
                        }
-                       elseif 
(($GLOBALS['phpgw']->msg->recall_desired_action()== 'reply')
-                       || ($GLOBALS['phpgw']->msg->recall_desired_action()== 
'replyall'))
+                       elseif 
(($GLOBALS['phpgw']->msg->recall_desired_action() == 'reply')
+                       || ($GLOBALS['phpgw']->msg->recall_desired_action() == 
'replyall'))
                        {
+                               $is_reply = True;
                                //echo 'entering recall_desired_action == reply 
line length handling'."\r\n";
                                // ok we have already quoted the text of the 
message we are replying to
                                // BUT we have yet to standardize line length 
for the text WE just typed
                                // in this message, our own text,
                                // BUT we really should skip doing linebreaking 
it _again_ for the quoted text, though
                                $body_array = array();
-                               $body_array = explode("\r\n", $body);
+                               $body_array = explode("\r\n", 
$this->smtp->Body);
                                // we do not use this again till we put 
$new_body into it, so clear the memory
-                               $body = '';
+                               $this->smtp->Body = '';
                                // process only our unquoted text
                                $body_array_count = count($body_array);
                                $in_unquoted_block = False;
@@ -631,61 +618,67 @@
                                                $unquoted_text .= $this_line . 
"\r\n";
                                        }
                                }
+
+                               //My new body :)
+                               $this->smtp->Body = $new_body;
+
                                // cleanup
                                $body_array = array();
-                               // ok we have gone through the whole message, 
put it in the bldy var
-                               $body = '';
-                               $body = $new_body;
                                $new_body = '';
                                $unquoted_text = '';
                                // end reply body line length landling block
                        }

-                       // Step One Addition
+                       // Step One Addition - fixed by skwashd :P
                        // ---- Request Delivery Notification in Headers ----
                        if 
(($GLOBALS['phpgw']->msg->get_isset_arg('req_notify'))
                        && ($GLOBALS['phpgw']->msg->get_arg_value('req_notify') 
!= ''))
-                       //cant imagine another check here, feel free to add 
something
                        {
-                       //cant imagine another place to flag this....its a 
yes/no thing
-                               $notify=true;
+                               $this->smtp->ConfirmReadingTo = 
$this->smtp->Sender;
                        }
+
                        // ----  Ensure To: and CC:  and BCC: are properly 
formatted   -----
                        if ($to)
                        {
                                // mail_out[to] is an array of addresses, each 
has properties [plain] and [personal]
-                               $this->mail_out['to'] = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($to);
-                               // this will make a simple comma seperated 
string of the plain addresses (False sets the "include_personal" arg)
-                               $mta_to = 
$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['to'], False);
+                               $to_array = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($to);
+                               if( $to_array && is_array($to_array) )
+                               {
+                                       foreach( $to_array as $recip )
+                                       {
+                                               
$this->smtp->AddAddress($recip['plain'], $recip['personal']);
+                                       }
+                               }
+                               unset($to_array);
                        }
                        if ($cc)
                        {
-                               $this->mail_out['cc'] = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($cc);
-                               $mta_to .= ',' 
.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['cc'], False);
+                               $cc_array = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($cc);
+                               if( $cc_array && is_array($to_array) )
+                               {
+                                       foreach( $cc_array as $recip )
+                                       {
+                                               
$this->smtp->AddCC($recip['plain'], $recip['personal']);
+                                       }
+                               }
+                               unset($cc_array);
                        }
                        if ($bcc)
                        {
-                               // here we will add bcc addresses to the list 
of adresses we will feed the MTA via the "RCPT TO" command
-                               // *however* this bcc data NEVER actually gets 
put in the message headers
-                               $this->mail_out['bcc'] = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($bcc);
-                               $mta_to .= ',' 
.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['bcc'], False);
-                       }
-                       // now make mta_to an array because we will loop 
through it in class mail_send
-                       $this->mail_out['mta_to'] = explode(',', $mta_to);
-
-                       // RFC2821 - RCPT TO: args (email addresses) should be 
enclosed in brackets
-                       // when we constructed the $this->mail_out['mta_to'] 
var, we set "include_personal" to False, so this array has only "plain" email 
addys
-                       for ($i=0; $i<count($this->mail_out['mta_to']); $i++)
-                       {
-                               if (!preg_match('/^<.*>$/', 
$this->mail_out['mta_to'][$i]))
+                               $bcc_array = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($bcc);
+                               if( $bcc_array && is_array($to_array) )
                                {
-                                       $this->mail_out['mta_to'][$i] = 
'<'.$this->mail_out['mta_to'][$i].'>';
+                                       foreach( $bcc_array as $recip )
+                                       {
+                                               
$this->smtp->AddCC($recip['plain'], $recip['personal']);
+                                       }
                                }
+                               unset($bcc_array);
                        }

                        /*
                        // ===== DEBUG =====
-                       echo '<br>';
+                       echo '<br />';
                        //$dubug_info = $to;
                        //$dubug_info = ereg_replace("\r\n.", "CRLF_WSP", 
$dubug_info);
                        //$dubug_info = ereg_replace("\r\n", "CRLF", 
$dubug_info);
@@ -694,202 +687,51 @@
                        //echo serialize($dubug_info);

                        //$to = $GLOBALS['phpgw']->msg->addy_array_to_str($to, 
True);
-                       //echo 'to including personal: 
'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($to).'<br>';
+                       //echo 'to including personal: 
'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($to).'<br />';

-                       echo '<br> var dump mail_out <br>';
+                       echo '<br /> var dump mail_out <br />';
                        var_dump($this->mail_out);
-                       //echo '<br> var dump cc <br>';
+                       //echo '<br /> var dump cc <br />';
                        //var_dump($cc);
-                       echo '<br>';
+                       echo '<br />';

                        $GLOBALS['phpgw']->common->phpgw_footer();
                        exit;
                        // ===== DEBUG =====
                        */

-                       // ----  Send The Email  ==  via CLASS MAIL SEND 2822  
== -----
-                       // USE CLASS MAIL SEND 2822
-                       $GLOBALS['phpgw']->mail_send = 
CreateObject("email.mail_send");
-                       $GLOBALS['phpgw']->mail_send->send_init();
                        // do we need to retain a copy of the sent message for 
the "Sent" folder?
                        
if($GLOBALS['phpgw']->msg->get_isset_pref('use_sent_folder'))
                        {
                                $GLOBALS['phpgw']->mail_send->retain_copy = 
True;
                        }
-
-                       // initialize structure for 1st part
-                       $body_part_num = 0;
-                       $this->mail_out['body'][$body_part_num]['mime_headers'] 
= Array();
-                       $this->mail_out['body'][$body_part_num]['mime_body'] = 
Array();
-
-                       // -----  ADD 1st PART's MIME HEADERS  (if necessary)  
-------
-                       if (($this->mail_out['is_multipart'] == True)
-                       || ($this->mail_out['is_forward'] == True))
-                       {
-                               // --- Add Mime Part Header to the First Body 
Part
-                               // this part _should_ be text
-                               $m_line = 0;
-                               
$this->mail_out['body'][0]['mime_headers'][$m_line] = 'This is a multipart 
message in MIME format';
-                               $m_line++;
-                               
$this->mail_out['body'][0]['mime_headers'][$m_line] = "\r\n";
-                               $m_line++;
-                               
$this->mail_out['body'][0]['mime_headers'][$m_line] = '--' 
.$this->mail_out['boundary'];
-                               $m_line++;
-                               
$this->mail_out['body'][0]['mime_headers'][$m_line] = 'Content-Type: 
text/plain; charset="'.$this->mail_out['charset'].'"';
-                               $m_line++;
-                               if ($this->mail_out['msgtype'] != '')
-                               {
-                                       // "folded header" opens with a 
"whitespace"
-                                       
$this->mail_out['body'][0]['mime_headers'][$m_line] = '  
phpgw-type="'.$this->mail_out['msgtype'].'"';
-                                       $m_line++;
-                               }
-                               // 7 BIT vs. 8 BIT Content-Transfer-Encoding
-                               // 7 bit means that no chars > 127 can be in 
the email, or else MTA's will get confused
-                               // if you really want to enforce 7 bit you 
should qprint encode the email body
-                               // however, if you are forwarding via MIME 
encapsulation then I do not believe it's cool to alter
-                               // the original message's content by qprinting 
it if it was not already qprinted
-                               // in which case you should send it 8 bit 
instead.
-                               // ALSO, the top most level encoding can not be 
less restrictive than any embedded part's encoding
-                               // 7bit is more restrictive than 8 bit
-                               // OPTIONS:
-                               // 1) send it out with no encoding header - 
against RFC's but the MTA will probably put it there for you
-                               // 2) do a scan for chars > 127, if so, send 8 
bit and hope the MTA can handle 8 bit
-                               // 3) scan for > 127 then qprint what we can 
(not embeded) then send out 7 bit
-                               // 4) listen to the initial string from the MTA 
indicating if it can handle MIME8BIT
-                               // 5) just send it out 8 bit and hope for the 
best (for now do this)
-                               
//$this->mail_out['body'][0]['mime_headers'][$m_line] = 
'Content-Transfer-Encoding: 7bit';
-                               //$m_line++;
-                               
$this->mail_out['body'][0]['mime_headers'][$m_line] = 
'Content-Transfer-Encoding: 8bit';
-                               $m_line++;
-                               
$this->mail_out['body'][0]['mime_headers'][$m_line] = 'Content-Disposition: 
inline';
-                               $m_line++;
-                       }
-
-                       // -----  MAIN BODY PART (1st Part)  ------
-                       // Explode Body into Array of strings
-                       $body = $GLOBALS['phpgw']->msg->normalize_crlf($body);
-                       $this->mail_out['body'][$body_part_num]['mime_body'] = 
explode ("\r\n",$body);
-                       //$this->mail_out['body'][$body_part_num]['mime_body'] 
= $GLOBALS['phpgw']->msg->explode_linebreaks(trim($body));
-                       // for no real reason, I add a CRLF to the end of the 
body
-                       
//$this->mail_out['body'][$body_part_num]['mime_body'][count($this->mail_out['body'][$body_part_num]['mime_body'])]
 = " \r\n";
-                       // since var $body *may* be huge, lets clear it now
-                       $body = '';
-
-                       // -----  FORWARD HANDLING  ------
-                       // Sanity Check - we can not "pushdown" a 
multipart/mixed original mail, it must be encaposulated
-                       if (($this->mail_out['is_forward'] == True)
-                       && ($this->mail_out['fwd_proc'] == 'pushdown'))
+
+                       // ----  Attachment Detection  -----
+                       // some of this attachment uploading and handling code 
is from squirrelmail (www.squirrelmail.org)
+                       $upload_dir = $GLOBALS['phpgw']->msg->att_files_dir;
+                       if (file_exists($upload_dir))
                        {
-                               $msg_headers = 
$GLOBALS['phpgw']->msg->phpgw_header('');
-                               $msg_struct = 
$GLOBALS['phpgw']->msg->phpgw_fetchstructure('');
-
-                               $this->mail_out['fwd_info'] = 
$GLOBALS['phpgw']->msg->pgw_msg_struct($msg_struct, $not_set, '1', 1, 1, 1);
-                               if (($this->mail_out['fwd_info']['type'] == 
'multipart')
-                               || ($this->mail_out['fwd_info']['subtype'] == 
'mixed'))
-                               {
-                                       $this->mail_out['fwd_proc'] = 
'encapsulate';
-                               }
-                       }
-
-                       // Add Forwarded Mail as An Additional Encapsulated 
"message/rfc822" MIME Part
-                       if (($this->mail_out['is_forward'] == True)
-                       && ($this->mail_out['fwd_proc'] == 'pushdown'))
-                       {
-                               // -----   INCOMPLETE CODE HERE  --------
-                               // -----   INCOMPLETE CODE HERE  --------
-                               // -----   INCOMPLETE CODE HERE  --------
-                               $body_part_num++;
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'] = Array();
-                               
$this->mail_out['body'][$body_part_num]['mime_body'] = Array();
-
-                               // ----  General Information about The Original 
Message  -----
-                               $msg_headers = 
$GLOBALS['phpgw']->msg->phpgw_header('');
-                               $msg_struct = 
$GLOBALS['phpgw']->msg->phpgw_fetchstructure('');
-
-                               // use the "pgw_msg_struct" function to get the 
orig message main header info
-                               $this->mail_out['fwd_info'] = 
$GLOBALS['phpgw']->msg->pgw_msg_struct($msg_struct, $not_set, '1', 1, 1, 1);
-                               // add some more info
-                               $this->mail_out['fwd_info']['from'] = 
$GLOBALS['phpgw']->msg->make_rfc2822_address($msg_headers->from[0]);
-                               $this->mail_out['fwd_info']['date'] = 
$GLOBALS['phpgw']->common->show_date($msg_headers->udate);
-                               $this->mail_out['fwd_info']['subject'] = 
$GLOBALS['phpgw']->msg->get_subject($msg_headers,'');
-
-                               // normalize data to rfc2046 defaults, in the 
event data is not provided
-                               if ($this->mail_out['fwd_info']['type'] == 
$not_set)
+                               $dh = dir($upload_dir);
+                               while ( ($file = $dh->read()) !== false)
                                {
-                                       $this->mail_out['fwd_info']['type'] = 
'text';
-                               }
-                               if ($this->mail_out['fwd_info']['subtype'] == 
$not_set)
-                               {
-                                       $this->mail_out['fwd_info']['subtype'] 
= 'plain';
-                               }
-                               if ($this->mail_out['fwd_info']['disposition'] 
== $not_set)
-                               {
-                                       
$this->mail_out['fwd_info']['disposition'] = 'inline';
-                               }
-
-                               $this->mail_out['fwd_info']['boundary'] = 
$not_set;
-                               for ($p = 0; $p < 
$part_nice['ex_num_param_pairs']; $p++)
-                               {
-                                       //echo '<br>params['.$p.']: 
'.$part_nice['params'][$p]['attribute'].'='.$part_nice['params'][$p]['value'] 
.'<br>';
-                                       if 
(($part_nice['params'][$p]['attribute'] == 'boundary')
-                                         && ($part_nice['params'][$p]['value'] 
!= $not_set))
+                                       if( ($file != '.' )
+                                       && ( $file != '..' )
+                                       && ( strpos($file, '.info') )
+                                       )
                                        {
-                                               
$this->mail_out['fwd_info']['boundary'] = $part_nice['params'][$p]['value'];
-                                               break;
+                                               $meta_data = explode("\n", 
file_get_contents($upload_dir . SEP . $file) );
+                                               $real_file = substr($file, 0, 
strpos($file, '.info'));
+                                               $this->smtp->AddAttachment( 
$upload_dir .SEP. $real_file,
+                                                               
trim($meta_data[1]),
+                                                               'base64',
+                                                               
trim($meta_data[0]) );
                                        }
                                }
-                               if ($this->mail_out['fwd_info']['boundary'] != 
$not_set)
-                               {
-                                       // original email ALREADY HAS a 
boundary., so use it!
-                                       $this->mail_out['boundary'] = 
$this->mail_out['fwd_info']['boundary'];
-                               }
-                               //echo '<br>part_nice[boundary] ' 
.$this->mail_out['fwd_info']['boundary'] .'<br>';
-                               //echo '<br>part_nice: <br>' 
.$GLOBALS['phpgw']->msg->htmlspecialchars_encode(serialize($this->mail_out)) 
.'<br>';
-
-                               // prepare the mime part headers
-                               // original body gets pushed down one part, 
i.e. was part 1, now is part 2
-                               $m_line = 0;
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = '--' 
.$this->mail_out['boundary'];
-                               $m_line++;
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = 
'Content-Type: 
'.$this->mail_out['fwd_info']['type'].'/'.$this->mail_out['fwd_info']['subtype'].';';
-                               $m_line++;
-                               if ($this->mail_out['fwd_info']['encoding'] != 
'other')
-                               {
-                                       
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = 
'Content-Transfer-Encoding: '.$this->mail_out['fwd_info']['encoding'];
-                                       $m_line++;
-                               }
-                               for ($p = 0; $p < 
$part_nice['ex_num_param_pairs']; $p++)
-                               {
-                                       //echo '<br>params['.$p.']: 
'.$part_nice['params'][$p]['attribute'].'='.$part_nice['params'][$p]['value'] 
.'<br>';
-                                       if 
($part_nice['params'][$p]['attribute'] != 'boundary')
-                                       {
-                                               
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = '  
'.$part_nice['params'][$p]['attribute'].'="'.$part_nice['params'][$p]['value'].'"';
-                                               $m_line++;
-                                       }
-                               }
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = 
'Content-Disposition: '.$this->mail_out['fwd_info']['disposition'];
-                               $m_line++;
-
-                               // dump the original BODY (with out its 
headers) here
-                               $fwd_this = 
$GLOBALS['phpgw']->msg->phpgw_body();
-                               // Explode Body into Array of strings
-                               
$this->mail_out['body'][$body_part_num]['mime_body'] = 
$GLOBALS['phpgw']->msg->explode_linebreaks(trim($fwd_this));
-                               $fwd_this = '';
-                       }
-                       elseif (($this->mail_out['is_forward'] == True)
-                       && ($this->mail_out['fwd_proc'] == 'encapsulate'))
-                       {
-                               // generate the message/rfc822 part that is the 
container for the forwarded mail
-                               $body_part_num++;
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'] = Array();
-                               
$this->mail_out['body'][$body_part_num]['mime_body'] = Array();
-
-                               // mime headers define this as a message/rfc822 
part
-                               // following RFC2046 recommendations
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'][0] = '--' 
.$this->mail_out['boundary'];
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'][1] = 'Content-Type: 
message/rfc822'.';';
-                               
$this->mail_out['body'][$body_part_num]['mime_headers'][2] = 
'Content-Disposition: inline';
-
+                               $dh->close();
+                       }
+
+                       if ($this->mail_out['is_forward'] == True)
+                       {
                                // DUMP the original message verbatim into this 
part's "body" - i.e. encapsulate the original mail
                                $fwd_this['sub_header'] = 
trim($GLOBALS['phpgw']->msg->phpgw_fetchheader());
                                $fwd_this['sub_header'] = 
$GLOBALS['phpgw']->msg->normalize_crlf($fwd_this['sub_header']);
@@ -917,10 +759,6 @@
                                        $fwd_this['boundaries'] = 
str_replace('boundary=', '', $fwd_this['boundaries']);
                                        $fwd_this['boundaries'] = 
str_replace('"', '', $fwd_this['boundaries']);
                                        $this_boundary = 
$fwd_this['boundaries'];
-                                       //$fwd_this['sub_body'] = 
preg_replace("/(?<!(\r\n\r\n))[-]{2}$this_boundary/m", 
"\r\n\r\n".'DASHDASH'.$this_boundary, $fwd_this['sub_body']);
-                                       //$fwd_this['sub_body'] = 
preg_replace("/(?<!(\r\n\r\n))[-]{2}$this_boundary/m", 
"\r\n\r\n".'DASHDASH'.$this_boundary, $fwd_this['sub_body']);
-                                       //$fwd_this['sub_body'] = 
preg_replace("/(?<!(\r\n\r\n))[-]{2}".$this_boundary."[-]{0,2}/m", 
"\r\n\r\n".'DASHDASH'.$this_boundary, $fwd_this['sub_body']);
-                                       //$fwd_this['sub_body'] = 
preg_replace("/(?<!(\r\n\r\n))[-]{2}$this_boundary/m", 
"\r\n\r\n".'DASHDASH'.$this_boundary, $fwd_this['sub_body']);
                                        $fwd_this['sub_body'] = 
preg_replace("/(?<!(\r\n\r\n))[-]{2}".$this_boundary."/m", 
"\r\n\r\n".'--'.$this_boundary, $fwd_this['sub_body']);
                                        $dash_dash = '--';
                                        $fwd_this['sub_body'] = 
preg_replace("/(?<!(\r\n\r\n))[-]{2}$dash_dash$this_boundary$dash_dash/", 
"\r\n\r\n".'--'.$this_boundary.'--', $fwd_this['sub_body']);
@@ -933,22 +771,19 @@


                                /*
-                               //echo 'fwd_this[sub_header]: 
<br><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fwd_this['sub_header']).'</pre><br>';
-                               //echo 'fwd_this[matches]: 
<br><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode(serialize($fwd_this['matches'])).'</pre><br>';
-                               //echo 'fwd_this[boundaries]: 
<br><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fwd_this['boundaries']).'</pre><br>';
-                               //echo '=== var dump    fwd_this <br><pre>';
+                               //echo 'fwd_this[sub_header]: <br 
/><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fwd_this['sub_header']).'</pre><br
 />';
+                               //echo 'fwd_this[matches]: <br 
/><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode(serialize($fwd_this['matches'])).'</pre><br
 />';
+                               //echo 'fwd_this[boundaries]: <br 
/><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fwd_this['boundaries']).'</pre><br
 />';
+                               //echo '=== var dump    fwd_this <br /><pre>';
                                //var_dump($fwd_this);
-                               //echo '</pre><br>';
-                               echo 'fwd_this[processed]: 
<br><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fwd_this['processed']).'</pre><br>';
+                               //echo '</pre><br />';
+                               echo 'fwd_this[processed]: <br 
/><pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fwd_this['processed']).'</pre><br
 />';
                                unset($fwd_this);
                                exit;
                                */


-                               // Explode Body into Array of strings
-                               //$fwd_this['processed'] = 
$GLOBALS['phpgw']->msg->normalize_crlf($fwd_this['processed']);
-                               
//$this->mail_out['body'][$body_part_num]['mime_body'] = explode("\r\n", 
$fwd_this['processed']);
-                               
$this->mail_out['body'][$body_part_num]['mime_body'] = 
$GLOBALS['phpgw']->msg->explode_linebreaks(trim($fwd_this['processed']));
+                               
$this->smtp->AddStringAttachment($fwd_this['processed'], 
lang('forwarded_message'), '7bit', 'message/rfc822');
                                // clear this no longer needed var
                                $fwd_this = '';
                                unset($fwd_this);
@@ -956,12 +791,12 @@

                        /*
                        // ===== DEBUG =====
-                       echo '<br>';
-                       echo '<br>=== mail_out ===<br>';
+                       echo '<br />';
+                       echo '<br />=== mail_out ===<br />';
                        $dubug_info = serialize($this->mail_out);
                        $dubug_info = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($dubug_info);
                        echo $dubug_info;
-                       echo '<br>';
+                       echo '<br />';

                        $GLOBALS['phpgw']->common->phpgw_footer();
                        exit;
@@ -969,256 +804,20 @@
                        */


-                       // ---  ATTACHMENTS -- Add each of them as an 
additional mime part ---
-                       if ($this->mail_out['num_attachments'] > 0)
-                       {
-                               // DO WE REALLY need to set_time_limit here?
-                               //@set_time_limit(0);
-                               // process (encode) attachments and add to the 
email body
-                               $total_files = 0;
-                               $dh = opendir($upload_dir);
-                               while ($file = readdir($dh))
-                               {
-                                       if (($file != '.')
-                                       && ($file != '..'))
-                                       {
-                                               if (! ereg("\.info",$file))
-                                               {
-                                                       $total_files++;
-                                                       $size = 
filesize($upload_dir.SEP.$file);
-
-                                                       $info_file = 
$upload_dir.SEP.$file.'.info';
-                                                       $file_info = 
file($info_file);
-                                                       if ($this->debug_struct 
> 2) { echo 'FILE INFO: '.htmlspecialchars(serialize($file_info)).'<br>'; }
-                                                       $content_type = 
trim($file_info[0]);
-                                                       $content_name = 
trim($file_info[1]);
-
-                                                       $body_part_num++;
-                                                       
$this->mail_out['body'][$body_part_num]['mime_headers'] = Array();
-                                                       
$this->mail_out['body'][$body_part_num]['mime_body'] = Array();
-
-                                                       $m_line = 0;
-                                                       
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = '--' 
.$this->mail_out['boundary'];
-                                                       $m_line++;
-                                                       
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = 
'Content-Type: '.$content_type.'; name="'.$content_name.'"';
-                                                       $m_line++;
-                                                       
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = 
'Content-Transfer-Encoding: base64';
-                                                       $m_line++;
-                                                       
$this->mail_out['body'][$body_part_num]['mime_headers'][$m_line] = 
'Content-Disposition: attachment; filename="'.$content_name.'"';
-
-                                                       /*
-                                                       // BASE64 ENCODE method 
1 - entire file loaded into memory
-                                                       // get the file and 
base 64 encode it
-                                                       $fh = 
fopen($upload_dir.SEP.$file,'rb');
-                                                       // $rawfile = 
fread($fh,$size);
-                                                       $b64_part = 
chunk_split(base64_encode(fread($fh,$size)));
-                                                       
$this->mail_out['body'][$body_part_num]['mime_body'] = explode("\r\n", 
$b64_part);
-                                                       $b64_part = '';
-                                                       fclose($fh);
-                                                       */
-
-                                                       // BASE64 ENCODE method 
2 - small chunks of file limit memory usage during encoding
-                                                       // base64 encoded data 
should be split into lines of 76 chars for the outgoing message (not including 
the CRLF)
-                                                       // reading 3 bytes from 
the file makes 4 bytes of encoded data
-                                                       // 76 encoded chars = 
(19 x 4 byte groups) per line
-                                                       // data must be fed in 
[bytes div 3] chunks (i.e. 30 bytes is divisible by 3 so is good) to avoid 
string padding
-                                                       // reading 19 x 3 bytes 
(57 chars) from source file produces the 76 char encoded single line of data
-                                                       // 57 is, of course, 
divisible by 3, so the resulting encoded line will not be padded with "=" chars 
(good)
-                                                       // for initial testing, 
it may be inefficient but do the file reading in 57 byte chunks
-                                                       $fh = 
fopen($upload_dir.SEP.$file,'rb');
-                                                       $next_pos = 0;
-                                                       while ($datachunk = 
fread($fh, 57))
-                                                       {
-                                                               if 
($this->debug_struct > 2) { echo '$next_pos ['.$next_pos.'] :: string 
['.$datachunk.'] :: b64 version ['.base64_encode($datachunk).']<br>'."\r\n"; }
-                                                               
$this->mail_out['body'][$body_part_num]['mime_body'][$next_pos] = 
base64_encode($datachunk);
-                                                               $next_pos++;
-                                                       }
-                                                       $b64_part = '';
-                                                       fclose($fh);
-
-
-                                                       /*
-                                                       / /  * * * * MOVE THIS 
INTO MAIL SEND 2822 PROC * * * * *
-                                                       // IF LAST PART - GIVE 
THE "FINAL" boundary
-                                                       if ($total_files >= 
$num_expected)
-                                                       {
-                                                               // attachments 
(parts) have their own boundary preceeding them (see below)
-                                                               // this is: 
"--"boundary
-                                                               // all boundary 
strings are have 2 dashes "--" added to their begining
-                                                               // and the 
FINAL boundary string (after all other parts) ALSO has
-                                                               // 2 dashes 
"--" tacked on tho the end of it, very important !!
-                                                               // the next 
available array number
-                                                               $m_line = 
count($this->mail_out['body'][$body_part_num]['mime_body']);
-                                                               
$this->mail_out['body'][$body_part_num]['mime_body'][$m_line] = '--' 
.$this->mail_out['boundary'].'--';
-                                                       }
-                                                       //echo 'tot: 
'.$total_files .' expext: '.$num_expected; // for debugging
-                                                       */
-
-                                                       // delete the temp file 
(the attachment)
-                                                       
unlink($upload_dir.SEP.$file);
-                                                       // delete the other 
temp file (the .info file)
-                                                       
unlink($upload_dir.SEP.$file.'.info');
-                                               }
-                                       }
-                               }
-                               // get rid of the temp dir we used for the above
-                               rmdir($upload_dir);
-                       }
-
-                       // --- MAIN HEADERS  -------
-                       $hdr_line = 0;
-                       $this->mail_out['main_headers'][$hdr_line] =            
'X-Originating-IP: '.$this->mail_out['originating_ip'];
-                       $hdr_line++;
-                       $this->mail_out['main_headers'][$hdr_line] =            
'From: '.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['from']);
-                       $hdr_line++;
-                       if ($this->mail_out['sender'] != '')
-                       {
-                               // rfc2822 - sender is only used if some one 
NOT the author (ex. the author's secretary) is sending the authors email
-                               // $this->mail_out['sender'] is initialized as 
an empty array in the begining of this file
-                               // then, it will be filled if the 
->msg->args['sender'] was passed to the script,
-                               // where it would have been converted to the 
appropriate format and put in the $this->mail_out['sender'] array
-                               $this->mail_out['main_headers'][$hdr_line] =    
'Sender: '.$this->mail_out['sender'];
-                               $hdr_line++;
-                       }
-                       //$this->mail_out['main_headers'][$hdr_line] =          
'Reply-To: '.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['from']);
-                       //$hdr_line++;
-                       $this->mail_out['main_headers'][$hdr_line] =            
'To: '.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['to']);
-                       $hdr_line++;
-                       if (count($this->mail_out['cc']) > 0)
-                       {
-                               $this->mail_out['main_headers'][$hdr_line] =    
'Cc: '.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['cc']);
-                               $hdr_line++;
-                       }
-                       $this->mail_out['main_headers'][$hdr_line] =            
'Subject: '.$subject;
-                       $hdr_line++;
-                       $this->mail_out['main_headers'][$hdr_line] =            
'Date: '.$this->mail_out['date'];
-                       $hdr_line++;
-                       $this->mail_out['main_headers'][$hdr_line] =            
'Message-ID: '.$this->mail_out['message_id'];
-                       $hdr_line++;
-                       //Step One Addition
-                       //There is no other way to put this headers for request 
notify, so here we go
-                       //Qmail servers use Notice-Requested-Upon-Delivery-To: 
so thats what we are going to use now
-                       //its the correct and nice way to support it
-                       //AFAIK, sendmail servers use Return-Receipt-To: which 
suck but are widly supported so....here goes as weelll
-                       if($notify)
-                       {
-                               $this->mail_out['main_headers'][$hdr_line] = 
'Notice-Requested-Upon-Delivery-To: 
'.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['to']);
-                               $hdr_line++;
-                               $this->mail_out['main_headers'][$hdr_line] = 
'Return-Receipt-To: '.$this->mail_out['sender'];
-                               $hdr_line++;
-
-                       }
-
-                       // RFC2045 REQUIRES this header in even if no embedded 
mime parts are in the body
-                       // MTA's, MUA's *should* assume the following as 
default (RFC2045) if not included
-                       $this->mail_out['main_headers'][$hdr_line] =            
'MIME-Version: 1.0';
-                       $hdr_line++;
-
-                       if (($this->mail_out['is_multipart'] == True)
-                       || ($this->mail_out['is_forward'] == True))
-                       {
-                               // THIS MAIL INCLUDES EMBEDED MIME PARTS
-                               $this->mail_out['main_headers'][$hdr_line] =    
'Content-Type: multipart/mixed;';
-                               $hdr_line++;
-                               $this->mail_out['main_headers'][$hdr_line] =    
$this->mail_out['whitespace'].'boundary="'.$this->mail_out['boundary'].'"';
-                               $hdr_line++;
-                       }
-                       else
-                       {
-                               // NO MIME SUBPARTS - SIMPLE 1 PART MAIL
-                               // headers = mime part 0 and  body = mime part 1
-                               $this->mail_out['main_headers'][$hdr_line] =    
'Content-Type: text/plain;';
-                               $hdr_line++;
-                               $this->mail_out['main_headers'][$hdr_line] =    
$this->mail_out['whitespace'].'charset="'.$this->mail_out['charset'].'"';
-                               $hdr_line++;
-                               // RFC2045 - the next line is *assumed* as 
default 7bit if it is not included
-                               // FUTURE: Content-Transfer-Encoding:  Needs To 
Match What is In the Body, i.e. may be qprint
-                               //$this->mail_out['main_headers'][$hdr_line] =  
'Content-Transfer-Encoding: 7bit';
-                               //$hdr_line++;
-                               /*!
-                               @concept 7bit vs. 8bit encoding value in top 
level headers
-                               @discussion top level 7bit requires qprinting 
the body if the body has 8bit chars in it
-                               ISSUE 1: "it's unnecessary"
-                               nowdays, most all MTAs and IMAP/POP servers can 
handle 8bit
-                               by todays usage, 7bit is quite restrictive, 
when considering the variety of
-                               things that may be attached to or carried in a 
message (and growing)
-                               [begin digression]
-                               However, stuffing RFC822 email thru a X500 (?) 
gateway requires 7bit body,
-                               which we could do here, at the MUA level, and 
may possibly require other
-                               alterations of the message that occur at the 
gateway, some of which may actually drop
-                               portions of the message, indeed it's 
complicated, but rare in terms of total mail volume (?)
-                               [end digression]
-                               ISSUE 2: "risks violating RFCs and confusing 
MTAs"
-                               setting top level encoding to 7bit when the 
body actually has 8bit chars is "TOTALLY BAD"
-                               MTA's will be totally confused by that 
mis-match, and it violates RFCs
-                               **More Importantly** this is a coding and 
functionality issue involved in forwarding:
-                               in general, when you forward a message you 
should not alter that message
-                               if that forwarded message has 8bit chars, I 
don't think that can be altered
-                               even to quote-print that forwarded part (i.e. 
to convert it to 7bit) would be altering it
-                               I suppose you could base64 encode it, on the 
theory that it decodes exactly back into
-                               it's original form, but the practice of base64 
encoding non-attachments (i.e. text parts)
-                               is EXTREMELY rare in my experience (Angles) and 
still problematic in coding for this.
-                               I suppose this assumes qprint is possible 
"lossy" in that the exact original may not be
-                               exactly the same as said pre-encoded forwarded 
part, and, after all, it's still altering the part.
-                               CONCLUSION: Set Top Level Header 
"Content-Transfer-Encoding" to "8bit"
-                               because it's easier to code for and less likely 
to violate RFCs.
-                               for now send out as 8bit and hope for the best.
-                               */
-                               $this->mail_out['main_headers'][$hdr_line] =    
'Content-Transfer-Encoding: 8bit';
-                               $hdr_line++;
-
-                               $this->mail_out['main_headers'][$hdr_line] =    
'Content-Disposition: inline';
-                               $hdr_line++;
-                               // Content-Description: this is not really a 
"technical" header
-                               // it can be used to inform the person reading 
some summary info
-                               //$header .= 'Content-description: Mail message 
body'."\r\n";
-                       }
-
-                       // finish off the main headers
-                       if ($this->mail_out['msgtype'] != '')
-                       {
-                               $this->mail_out['main_headers'][$hdr_line] =    
'X-phpGW-Type: '.$this->mail_out['msgtype'];
-                               $hdr_line++;
-                       }
-                       $this->mail_out['main_headers'][$hdr_line] =    
'X-Mailer: AngleMail for phpGroupWare (http://www.phpgroupware.org) v 
'.$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'];
-                       $hdr_line++;
-
                        /*
                        // ===== DEBUG =====
-                       echo '<br>';
-                       echo '<br>=== mail_out ===<br>';
+                       echo '<br />';
+                       echo '<br />=== mail_out ===<br />';
                        $dubug_info = serialize($this->mail_out);
                        $dubug_info = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($dubug_info);
                        echo $dubug_info;
-                       echo '<br>';
+                       echo '<br />';
                        // ===== DEBUG =====
                        */
-
-                       // ----  Send It   -----
-                       $returnccode = 
$GLOBALS['phpgw']->mail_send->smail_2822($this->mail_out);
-
-                       /*
-                       // ===== DEBUG =====
-                       echo '<br>';
-                       echo 'retain_copy: 
'.serialize($GLOBALS['phpgw']->mail_send->retain_copy);
-                       echo '<br>=== POST SEND ===<br>';
-                       echo 
'<pre>'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($GLOBALS['phpgw']->mail_send->assembled_copy).'</pre>';
-                       echo '<br>';
-                       // ===== DEBUG =====
-                       */
-
-
-                       //  -------  Put in "Sent" Folder, if Applicable  
-------
-                       $skip_this = False;
-                       //$skip_this = True;
-
-                       if (($skip_this == False)
-                       && ($returnccode)
-                       && 
($GLOBALS['phpgw']->msg->get_isset_pref('use_sent_folder')))
-                       {
-                                       $success = $this->copy_to_sent_folder();
-                       }
-
+               }
+
+               function get_return_to()
+               {
                        // ----  Redirect on Success, else show Error Report   
-----
                        // what folder to go back to (the one we came from)
                        // Personally, I think people should go back to the 
INBOX after sending an email
@@ -1246,7 +845,7 @@
                                $fldball_candidate['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_out('INBOX');
                                $fldball_candidate['acctnum'] = 
(int)$GLOBALS['phpgw']->msg->get_acctnum();
                        }
-                       $return_to_folder_href = $GLOBALS['phpgw']->link(
+                       return $GLOBALS['phpgw']->link(
                                                '/index.php',
                                                'menuaction=email.uiindex.index'
                                                
.'&fldball[folder]='.$fldball_candidate['folder']
@@ -1254,58 +853,19 @@
                                                
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
                                                
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                                
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
+               }
+
+
+               function save_draft()
+               {
+                       $this->prepare_message();
+                       $this->smtp->Mailer = 'draft-dodger'; //a needed hack - 
skwashd
+                       $this->smtp->Send();
+                       $this->save_message($this->smtp->getHeader() . "\n" . 
$this->smtp->getBody() . "\r\n",
+                                       'INBOX.Drafts', "\\Draft");

-                       if ($returnccode)
-                       {
-                               // Success
-                               if ($GLOBALS['phpgw']->mail_send->trace_flag > 
0)
-                               {
-                                       // for debugging
-                                       echo '<html><body>'."\r\n";
-                                       echo '<h2>Here is the communication 
from the MUA(phpgw) <--> MTA(smtp server) trace data dump</h2>'."\r\n";
-                                       echo '<h3>trace data flag set to 
['.(string)$GLOBALS['phpgw']->mail_send->trace_flag.']</h3>'."\r\n";
-                                       echo '<pre>'."\r\n";
-                                       
print_r($GLOBALS['phpgw']->mail_send->trace_data);
-                                       echo '</pre>'."\r\n";
-                                       echo '<p>&nbsp;<br></p>'."\r\n";
-                                       echo '<p>To go back to the msg list, 
click <a href="'.$return_to_folder_href.'">here</a></p><br>';
-                                       echo '</body></html>';
-                                       $this->send_message_cleanup();
-                               }
-                               else
-                               {
-                                       // unset some vars (is this necessary?)
-                                       $this->send_message_cleanup();
-                                       // redirect the browser to the index 
page for the appropriate folder
-                                       //header('Location: 
'.$return_to_folder_href);
-                                       
$GLOBALS['phpgw']->redirect($return_to_folder_href);
-                                       // kill the rest of this script
-                                       if (is_object($GLOBALS['phpgw']->msg))
-                                       {
-                                               // close down ALL mailserver 
streams
-                                               
$GLOBALS['phpgw']->msg->end_request();
-                                               // destroy the object
-                                               $GLOBALS['phpgw']->msg = '';
-                                               unset($GLOBALS['phpgw']->msg);
-                                       }
-                                       // shut down this transaction
-                                       
$GLOBALS['phpgw']->common->phpgw_exit(False);
-                               }
-                       }
-                       else
-                       {
-                               // ERROR - mail NOT sent
-                               echo '<html><body>'."\r\n";
-                               echo '<h2>Your message could <b>not</b> be 
sent!</h2>'."\r\n";
-                               echo '<h3>The mail server 
returned:</h3>'."\r\n";
-                               echo '<pre>';
-                               print_r($GLOBALS['phpgw']->mail_send->err);
-                               echo '</pre>'."\r\n";
-                               echo '<p>To go back to the msg list, click <a 
href="'.$return_to_folder_href.'">here</a> </p>'."\r\n";
-                               echo '</body></html>';
-                               $this->send_message_cleanup();
-                       }
+                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/email/index.php') ); // . $this->get_return_to() );
+                       exit;
                }
-
        }
 ?>

====================================================
Index: email/inc/class.bojsaddressbook.inc.php
diff -u email/inc/class.bojsaddressbook.inc.php:1.2 
email/inc/class.bojsaddressbook.inc.php:1.3
--- email/inc/class.bojsaddressbook.inc.php:1.2 Fri Mar 14 04:00:10 2003
+++ email/inc/class.bojsaddressbook.inc.php     Sun Mar 13 23:22:43 2005
@@ -210,7 +210,7 @@

                                }//end switch
                        }//end while
-//                     print "<BR> built query";
+//                     print "<br /> built query";
 //                     print_r($this->contactquery);
                }//end function

@@ -310,7 +310,7 @@
                function set_destboxes($aryboxes,$deleted='')
                {
                        //print_r($aryboxes);
-//                     print "<br> SAVed DESTBOXES <br>";
+//                     print "<br /> SAVed DESTBOXES <br />";
                        //We get our own destboxes from the cache
                        $saveddestboxes=$this->get_destboxes();
                //      print_r($saveddestboxes);
@@ -318,9 +318,9 @@
                        //We iterate into each box
                        while(list($ak,$li)=each($aryboxes))
                        {
-//                             print $ak." ".$li."<BR>";
+//                             print $ak." ".$li."<br />";
 //                             print_r($li);
-//                             print "<br>";
+//                             print "<br />";
                                //We make shure this box has an array in it
                                if($aryboxes[$ak])
                                {
@@ -328,7 +328,7 @@
                                        //for its values in the cache
                                        
while(list($numary,$ary)=each($aryboxes[$ak]))
                                        {
-//                                             print "<br> Iterating aryboxes 
$numary";
+//                                             print "<br /> Iterating 
aryboxes $numary";
 //                                             print_r($ary);
                                                list($id,$name)=each($ary);
                                                //Look for this record in the 
cached destboxes
@@ -342,12 +342,12 @@
                                                                //out of the 
cached destbox
                                                                
list($sid,$sname)=each($arysave);

-//                                                             print "<br> 
Iterating destboxes $id -> $name / $sid $sname";
+//                                                             print "<br /> 
Iterating destboxes $id -> $name / $sid $sname";
                                                                //So we can 
compare it and set the email field in it
                                                                if($id==$sid)
                                                                {
-//                                                                     print 
"<br> found $id in $ak";
-//                                                                     print 
"<br> seting mail to $arysave[email]";
+//                                                                     print 
"<br /> found $id in $ak";
+//                                                                     print 
"<br /> seting mail to $arysave[email]";
                                                                        
$ary['email']=$arysave['email'];
                                                                        
$aryboxes[$ak][$numary]=$ary;

@@ -365,12 +365,12 @@
                                                //We iterate into the query 
cache
                                                
while(list($num,$record)=each($this->result))
                                                {
-//                                                     print "<br> Iterating 
results $id   ---> $name <br>$record[id]---> $record[email]";
+//                                                     print "<br /> Iterating 
results $id   ---> $name <br />$record[id]---> $record[email]";
                                                        //Found what we are 
looking for
                                                        if($id == $record["id"])
                                                        {
                                                                //Set the mail 
record to what it should be
-//                                                             print "<br> 
seting mail to $record[email] <br>";
+//                                                             print "<br /> 
seting mail to $record[email] <br />";
                                                                
$ary['email']=($record["email"] ? $record["email"] : $record["home_email"]);
                                                                
$aryboxes[$ak][$numary]=$ary;
                                                                
$retboxes[$ak][$id]['email']= $ary['email'];
@@ -385,13 +385,13 @@
                                }
                                elseif(!$deleted[$ak])
                                {
-//                                     print "<br>Saving $ak from destination 
data $deleted[$ak]<br>";
+//                                     print "<br />Saving $ak from 
destination data $deleted[$ak]<br />";
 //                                     print_r($deleted);
                                        //Delete the destboxes that need 
deletion
                                        $aryboxes[$ak]=$saveddestboxes[$ak];
                                }
                        }
-//                     print "<br>modified<br>";
+//                     print "<br />modified<br />";
 //                             print_r($aryboxes);
                                reset($aryboxes);
                        //Save the resulting destboxes
@@ -418,7 +418,7 @@
                        }
                        if($this->debug)
                        {
-                               echo '<br>Saving: ';
+                               echo '<br />Saving: ';
                                _debug_array($data);
                        }
                }
@@ -433,7 +433,7 @@
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','jsbook_data'.($location 
? '_'.$location :""));
                        if($this->debug)
                        {
-                               echo '<br>Read: ';
+                               echo '<br />Read: ';
                                _debug_array($data);
                        }
                        return $data;

====================================================
Index: email/inc/class.boindex.inc.php
diff -u email/inc/class.boindex.inc.php:1.31 
email/inc/class.boindex.inc.php:1.32
--- email/inc/class.boindex.inc.php:1.31        Thu Dec 30 23:13:50 2004
+++ email/inc/class.boindex.inc.php     Sun Mar 13 23:22:43 2005
@@ -64,21 +64,21 @@
                                'lang_sort_by'          => lang('Sort By'),
                                'lang_email_date'       => lang('Email Date'),
                                'lang_arrival_date'     => lang('Arrival Date'),
-                               'lang_from'                     => lang('From'),
+                               'lang_from'             => lang('From'),
                                'lang_subject'          => lang('Subject'),
-                               'lang_size'                     => lang('Size'),
+                               'lang_size'             => lang('Size'),
                                // folder stats Information bar
-                               'lang_new'                      => lang('New'),
-                               'lang_new2'                     => lang('New 
Messages'),
+                               'lang_new'              => lang('New'),
+                               'lang_new2'             => lang('New Messages'),
                                'lang_total'            => lang('Total'),
                                'lang_total2'           => lang('Total 
Messages'),
                                'lang_size2'            => lang('Folder Size'),
-                               //'stats_to_txt'                => lang('to'),
+                               //'stats_to_txt'        => lang('to'),
                                // ralfbecker: this is not the word in other 
lang's as the other lang('to')'s
                                'stats_to_txt'          => '-',
-                               'lang_to'                       => lang('to'),
+                               'lang_to'               => lang('to'),
                                'lang_get_size'         => lang('get size'),
-                               'lang_date'                     => lang('date'),
+                               'lang_date'             => lang('date'),
                                'lang_lines'            => lang('lines'),
                                'lang_counld_not_open'  => lang('Could not open 
this mailbox'),
                                'lang_empty_folder'     => lang('this folder is 
empty'),
@@ -89,7 +89,11 @@
                                'lang_answered'         => lang('answered'),
                                'lang_draft'            => lang('draft'),
                                'lang_deleted'          => lang('deleted'),
-                               'lang_important'                => 
lang('important')
+                               'lang_important'        => lang('important'),
+
+                               //Empty Trash added by skwashd
+                               'lang_empty_trash'      => lang('empty trash'),
+                               'lang_empty_trash_warn' => lang('Are you sure 
you want to empty the trash?')

                        );
                        // put these into $this->xi[] array
@@ -342,7 +346,7 @@
                */
                function index_data()
                {
-                       if ($this->debug_index_data == True) { echo 'ENTERING: 
email.boindex.index_data'.'<br>'; }
+                       if ($this->debug_index_data == True) { echo 'ENTERING: 
email.boindex.index_data'.'<br />'; }
                        // create class objects
                        $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
                        // this svc_nextmatches handles email only stuff
@@ -385,7 +389,14 @@
                        $this->xi['hdr_font_size'] = '2';
                        $this->xi['hdr_font_size_sm'] = '1';
                        $this->xi['ftr_font']   = 
$GLOBALS['phpgw_info']['theme']['font'];
-
+
+                       //Empty Trash added by skwashd - move it if you want
+                       $this->xi['empty_trash_link'] = 
$GLOBALS['phpgw']->link('/index.php',
+                                                               array(
+                                                                       
'menuaction'    => 'email.boaction.empty_trash',
+                                                                       
'acctnum'       => $GLOBALS['phpgw']->msg->get_acctnum()
+                                                               )
+                                                       );

                        // establish all manner of important data
                        // can not put acctnum=X here because any single piece 
of data may apply to a different account
@@ -399,7 +410,7 @@
                        $this->xi['show_num_new'] = False;
                        $this->icon_theme = 
$GLOBALS['phpgw']->msg->get_pref_value('icon_theme',$acctnum);
                        $this->icon_size = 
$GLOBALS['phpgw']->msg->get_pref_value('icon_size',$acctnum);
-                       //echo "icon size is ".$this->icon_size."<br>\r\n";
+                       //echo "icon size is ".$this->icon_size."<br />\r\n";

                        /* MOVED TO FUNCTION ABOVE
                        // ---- account switchbox  ----
@@ -805,7 +816,7 @@
                        $this->xi['mlist_new_msg'] = '<font 
color="'.$this->xi['mlist_newmsg_color'].'">'.$this->xi['mlist_newmsg_char'].'</font>';
                        //$this->xi['mlist_checkbox_name'] = 
'delmov_list_fake_uri[]';
                        $this->xi['mlist_checkbox_name'] = 'delmov_list[]';
-                       //$this->xi['attach_img'] = 
$this->xi['svr_image_dir'].'/attach.gif';
+                       //$this->xi['attach_img'] = 
$this->xi['svr_image_dir'].'/attach.png';
                        $this->xi['attach_img'] = 
$GLOBALS['phpgw']->common->image_on('email','attach','_on');
                        $this->xi['check_image'] = 
$GLOBALS['phpgw']->common->image_on('email','check','_on');
                        //$this->xi['mlist_attach'] = '<div 
align="right">'.'<img src="'.$this->xi['attach_img'].'" 
alt="'.$this->xi['mlist_attach_txt'].'">'.'</div>';
@@ -914,7 +925,7 @@
                        }
                        $this->xi['delmov_image'] = 
$GLOBALS['phpgw']->msg->img_maketag($GLOBALS['phpgw']->msg->_image_on('email',$this->icon_theme.'/trash-'.$this->icon_size,'_on'),$this->xi['lang_delete'],'','','0');
                        //$this->xi['delmov_image'] = 
$GLOBALS['phpgw']->msg->img_maketag($GLOBALS['phpgw']->common->image_on('email',$icon_theme.'-trash-'.$icon_size,'_on'),$this->xi['lang_delete'],'','','0');
-                       //$this->xi['delmov_image'] = 
$GLOBALS['phpgw']->msg->img_maketag($this->xi['image_dir'].'/'.$this->icon_theme.'-trash-'.$this->icon_size.'.gif',$this->xi['lang_delete'],'','','0');
+                       //$this->xi['delmov_image'] = 
$GLOBALS['phpgw']->msg->img_maketag($this->xi['image_dir'].'/'.$this->icon_theme.'-trash-'.$this->icon_size.'.png',$this->xi['lang_delete'],'','','0');
                        $delmov_onclick = "javascript:do_action('delall')";
                        switch 
($GLOBALS['phpgw']->msg->get_pref_value('button_type',$acctnum)){
                                case 'text':
@@ -946,18 +957,18 @@
                {
                        // DISPLAY SEARCH RESULTS

-                       if ($this->debug_index_data == True) { echo 'ENTERING: 
email.boindex: mlist_data'.'<br>'; }
+                       if ($this->debug_index_data == True) { echo 'ENTERING: 
email.boindex: mlist_data'.'<br />'; }
                        if ($this->debug_index_data == True) { echo 
'email.boindex.mlist_data: local var 
attempt_reuse=['.serialize($attempt_reuse).'] ; reuse_feed_args[] dump<pre>'; 
print_r($reuse_feed_args); echo '</pre>'; }
                        // create class objects
                        $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');

                        if (is_object($GLOBALS['phpgw']->msg))
                        {
-                               if ($this->debug_index_data) { echo 
'email.boindex.mlist_data: is_object test: $GLOBALS[phpgw]->msg is already set, 
do not create again<br>'; }
+                               if ($this->debug_index_data) { echo 
'email.boindex.mlist_data: is_object test: $GLOBALS[phpgw]->msg is already set, 
do not create again<br />'; }
                        }
                        else
                        {
-                               if ($this->debug_index_data) { echo 
'email.boindex.mlist_data: is_object: $GLOBALS[phpgw]->msg is NOT set, creating 
mail_msg object<br>'; }
+                               if ($this->debug_index_data) { echo 
'email.boindex.mlist_data: is_object: $GLOBALS[phpgw]->msg is NOT set, creating 
mail_msg object<br />'; }
                                $GLOBALS['phpgw']->msg = 
CreateObject("email.mail_msg");
                        }

@@ -1230,7 +1241,7 @@
                        $this->xi['mlist_new_msg'] = '<font 
color="'.$this->xi['mlist_newmsg_color'].'">'.$this->xi['mlist_newmsg_char'].'</font>';
                        $this->xi['mlist_attach'] =
                                '<div align="right">'
-                                       .'<img 
src="'.$this->xi['svr_image_dir'].'/attach.gif" 
alt="'.$this->xi['mlist_attach_txt'].'">'
+                                       .'<img 
src="'.$this->xi['svr_image_dir'].'/attach.png" 
alt="'.$this->xi['mlist_attach_txt'].'">'
                                .'</div>';
                        // loop thru the messages and get the data that the UI 
will display
                        if ($this->xi['folder_info']['number_all'] == 0)
@@ -1289,7 +1300,7 @@
                        }
                        $this->xi['ftr_backcolor'] = 
$GLOBALS['phpgw_info']['theme']['th_bg'];
                        $this->xi['ftr_backcolor_class'] = 'th';
-                       if ($this->debug_index_data == True) { echo 'LEAVING: 
email.boindex: mlist_data'.'<br>'; }
+                       if ($this->debug_index_data == True) { echo 'LEAVING: 
email.boindex: mlist_data'.'<br />'; }
                }



====================================================
Index: email/inc/class.bofilters.inc.php
diff -u email/inc/class.bofilters.inc.php:1.15 
email/inc/class.bofilters.inc.php:1.16
--- email/inc/class.bofilters.inc.php:1.15      Thu Dec 30 23:13:50 2004
+++ email/inc/class.bofilters.inc.php   Sun Mar 13 23:22:43 2005
@@ -84,7 +84,7 @@
                */
                function bofilters()
                {
-                       if ($this->debug > 0) { echo 'email.bofilters 
*constructor*: ENTERING <br>'; }
+                       if ($this->debug > 0) { echo 'email.bofilters 
*constructor*: ENTERING <br />'; }

                        define('F_ROW_0_MATCH',1);
                        define('F_ROW_1_MATCH',2);
@@ -140,22 +140,22 @@
                        {
                                $my_menuaction = 'error: none found';
                        }
-                       if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*('.__LINE__.'): $my_menuaction ['.$my_menuaction.']<br>'; }
+                       if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*('.__LINE__.'): $my_menuaction ['.$my_menuaction.']<br />'; }

                        if (stristr($my_menuaction, 'email.uifilter'))
                        {
-                               if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*('.__LINE__.'): GPC menuaction indicates this is a UI call, NOT 
applying filters, so do NOT html decode pref filter data<br>'; }
+                               if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*('.__LINE__.'): GPC menuaction indicates this is a UI call, NOT 
applying filters, so do NOT html decode pref filter data<br />'; }
                                $also_undo_defang = False;
                        }
                        else
                        {
-                               if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*('.__LINE__.'): GPC menuaction indicates this is NOT simply a UI 
call, so DO html decode (defang) pref filter data<br>'; }
+                               if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*('.__LINE__.'): GPC menuaction indicates this is NOT simply a UI 
call, so DO html decode (defang) pref filter data<br />'; }
                                $also_undo_defang = True;
                        }

-                       if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*: calling 
$this->read_filter_data_from_prefs('.serialize($also_undo_defang).')<br>'; }
+                       if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*: calling 
$this->read_filter_data_from_prefs('.serialize($also_undo_defang).')<br />'; }
                        $this->read_filter_data_from_prefs($also_undo_defang);
-                       if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*: LEAVING<br>'; }
+                       if ($this->debug > 0) { echo 'email.bofilters. 
*constructor*: LEAVING<br />'; }
                        //return;
                }

@@ -177,7 +177,7 @@
                */
                function read_filter_data_from_prefs($also_undo_defang='')
                {
-                       if ($this->debug > 0) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): ENTERING, param 
$also_undo_defang ['.serialize($also_undo_defang).']<br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): ENTERING, param 
$also_undo_defang ['.serialize($also_undo_defang).']<br />'."\r\n"; }
                        /*
                        $this->all_filters = array();
                        // read sublevel data from prefs
@@ -209,15 +209,15 @@
                        // UNDO the DATABASE DEFANG if instructions specified 
this
                        if ($also_undo_defang)
                        {
-                               if ($this->debug > 1) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): about to call 
$this->all_filters_bulk_undo_defang because param $also_undo_defang is 
['.serialize($also_undo_defang).']<br>'."\r\n"; }
+                               if ($this->debug > 1) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): about to call 
$this->all_filters_bulk_undo_defang because param $also_undo_defang is 
['.serialize($also_undo_defang).']<br />'."\r\n"; }
                                $this->all_filters_bulk_undo_defang();
                        }
                        else
                        {
-                               if ($this->debug > 1) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): leaving html encoded 
chars AS-IS because param $also_undo_defang is 
['.serialize($also_undo_defang).']<br>'."\r\n"; }
+                               if ($this->debug > 1) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): leaving html encoded 
chars AS-IS because param $also_undo_defang is 
['.serialize($also_undo_defang).']<br />'."\r\n"; }
                        }
                        if ($this->debug > 2) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): obtained 
$this->all_filters DUMP:<pre>'; print_r($this->all_filters); echo 
'</pre>'."\r\n"; }
-                       if ($this->debug > 0) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): LEAVING <br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 
'bofilters.read_filter_data_from_prefs('.__LINE__.'): LEAVING <br />'."\r\n"; }
                        return $this->all_filters;
                }

@@ -229,7 +229,7 @@
                */
                function obtain_filer_num($get_next_avail_if_none=True)
                {
-                       if ($this->debug > 0) { echo 
'bofilters.obtain_filer_num: ENTERING ; $get_next_avail_if_none : 
[<code>'.serialize($get_next_avail_if_none).'</code>]<br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 
'bofilters.obtain_filer_num: ENTERING ; $get_next_avail_if_none : 
[<code>'.serialize($get_next_avail_if_none).'</code>]<br />'."\r\n"; }
                        if 
(isset($GLOBALS['phpgw']->msg->ref_POST['filter_num']))
                        {
                                if 
($GLOBALS['phpgw']->msg->ref_POST['filter_num'] == $this->add_new_filter_token)
@@ -262,7 +262,7 @@
                        {
                                $filter_num = $this->not_set;
                        }
-                       if ($this->debug > 0) { echo 
'bofilters.obtain_filer_num: LEAVING ; returning $filter_num : 
[<code>'.serialize($filter_num).'</code>]<br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 
'bofilters.obtain_filer_num: LEAVING ; returning $filter_num : 
[<code>'.serialize($filter_num).'</code>]<br />'."\r\n"; }
                        return $filter_num;
                }

@@ -328,21 +328,21 @@
                {
                        // "False" means  return $this->not_set  if no filter 
number was found anywhere
                        $found_filter_num = $this->obtain_filer_num(False);
-                       if ($this->debug > 1) { echo 'bofilters.move_up: 
$found_filter_num : 
[<code>'.serialize($found_filter_num).'</code>]<br>'."\r\n"; }
+                       if ($this->debug > 1) { echo 'bofilters.move_up: 
$found_filter_num : [<code>'.serialize($found_filter_num).'</code>]<br 
/>'."\r\n"; }

                        if ($found_filter_num == $this->not_set)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.move_up: LEAVING with error, no filter num was found<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 
'bofilters.move_up: LEAVING with error, no filter num was found<br />'."\r\n"; }
                                return False;
                        }
                        elseif($this->filter_exists($found_filter_num) == False)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.move_up: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] does not exist<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 
'bofilters.move_up: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] does not exist<br />'."\r\n"; }
                                return False;
                        }
                        elseif((string)$found_filter_num == '0')
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.move_up: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] can not be moved 
up<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 
'bofilters.move_up: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] can not be moved up<br 
/>'."\r\n"; }
                                return False;
                        }
                        // if we get here we need to move up this filter
@@ -357,7 +357,7 @@
                        $take_me_to_url = $GLOBALS['phpgw']->link(
                                                                                
'/index.php',
                                                                                
'menuaction=email.uifilters.filters_list');
-                       if ($this->debug > 0 || $this->debug_set_prefs > 0 ) { 
echo 'bofilters.move_up: LEAVING with redirect to: 
<br>'.$take_me_to_url.'<br>'; }
+                       if ($this->debug > 0 || $this->debug_set_prefs > 0 ) { 
echo 'bofilters.move_up: LEAVING with redirect to: <br />'.$take_me_to_url.'<br 
/>'; }
                        Header('Location: ' . $take_me_to_url);
                }

@@ -370,21 +370,21 @@
                {
                        // "False" means  return $this->not_set  if no filter 
number was found anywhere
                        $found_filter_num = $this->obtain_filer_num(False);
-                       if ($this->debug > 1) { echo 'bofilters.move_down: 
$found_filter_num : 
[<code>'.serialize($found_filter_num).'</code>]<br>'."\r\n"; }
+                       if ($this->debug > 1) { echo 'bofilters.move_down: 
$found_filter_num : [<code>'.serialize($found_filter_num).'</code>]<br 
/>'."\r\n"; }

                        if ($found_filter_num == $this->not_set)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.move_down: LEAVING with error, no filter num was found<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 
'bofilters.move_down: LEAVING with error, no filter num was found<br 
/>'."\r\n"; }
                                return False;
                        }
                        elseif($this->filter_exists($found_filter_num) == False)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.move_down: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] does not exist<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 
'bofilters.move_down: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] does not exist<br />'."\r\n"; }
                                return False;
                        }
                        elseif($found_filter_num == 
(count($this->all_filters)-1))
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.move_down: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] can not be moved 
down<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 
'bofilters.move_down: LEAVING with error, filter $found_filter_num 
[<code>'.serialize($found_filter_num).'</code>] can not be moved down<br 
/>'."\r\n"; }
                                return False;
                        }
                        // if we get here we need to move up this filter
@@ -399,7 +399,7 @@
                        $take_me_to_url = $GLOBALS['phpgw']->link(
                                                                                
'/index.php',
                                                                                
'menuaction=email.uifilters.filters_list');
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.move_down: LEAVING with redirect to: <br>'.$take_me_to_url.'<br>'; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.move_down: LEAVING with redirect to: <br />'.$take_me_to_url.'<br 
/>'; }
                        Header('Location: ' . $take_me_to_url);
                }

@@ -418,22 +418,22 @@
                */
                function all_filters_bulk_undo_defang()
                {
-                       if ($this->debug > 0) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): ENTERING<br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): ENTERING<br />'."\r\n"; }
                        $did_decode = False;
                        if (!$this->all_filters)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): LEAVING early, nothing 
to process, $this->all_filters is empty, returning $did_decode 
['.serialize($did_decode).']<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): LEAVING early, nothing 
to process, $this->all_filters is empty, returning $did_decode 
['.serialize($did_decode).']<br />'."\r\n"; }
                                return $did_decode;
                        }
                        // UNDO the DATABASE DEFANG,
-                       if ($this->debug > 1) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): about to UNDO the pref 
friendly defanged chars, so the the html encoding of certain offending chars 
prefs is UNDONE here<br>'."\r\n"; }
+                       if ($this->debug > 1) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): about to UNDO the pref 
friendly defanged chars, so the the html encoding of certain offending chars 
prefs is UNDONE here<br />'."\r\n"; }
                        $did_decode = False;
                        for ($filter_idx=0; $filter_idx < 
count($this->all_filters); $filter_idx++)
                        {
                                // currently only 2 elements get the defang, 
undefang treatment
                                // 1. filtername
                                $refanged_filtername = 
$this->string_undo_defang($this->all_filters[$filter_idx]['filtername']);
-                               if ($this->debug > 1) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): still defanged 
$this->all_filters['.$filter_idx.'][filtername] is 
['.serialize($this->all_filters[$filter_idx]['filtername']).'], RE-fanged 
$refanged_filtername ['.serialize($refanged_filtername).']<br>'."\r\n"; }
+                               if ($this->debug > 1) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): still defanged 
$this->all_filters['.$filter_idx.'][filtername] is 
['.serialize($this->all_filters[$filter_idx]['filtername']).'], RE-fanged 
$refanged_filtername ['.serialize($refanged_filtername).']<br />'."\r\n"; }
                                if ($refanged_filtername != 
$this->all_filters[$filter_idx]['filtername'])
                                {
                                        $did_decode = True;
@@ -443,7 +443,7 @@
                                for ($matches_idx=0; $matches_idx < 
count($this->all_filters[$filter_idx]['matches']); $matches_idx++)
                                {
                                        $refanged_matchthis = 
$this->string_undo_defang($this->all_filters[$filter_idx]['matches'][$matches_idx]['matchthis']);
-                                       if ($this->debug > 1) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): still defanged 
$this->all_filters['.$filter_idx.'][matches]['.$matches_idx.'][matchthis] is 
['.serialize($this->all_filters[$filter_idx]['matches'][$matches_idx]['matchthis']).'],
 RE-fanged $refanged_matchthis 
['.serialize($refanged_matchthis).']<br>'."\r\n"; }
+                                       if ($this->debug > 1) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): still defanged 
$this->all_filters['.$filter_idx.'][matches]['.$matches_idx.'][matchthis] is 
['.serialize($this->all_filters[$filter_idx]['matches'][$matches_idx]['matchthis']).'],
 RE-fanged $refanged_matchthis ['.serialize($refanged_matchthis).']<br 
/>'."\r\n"; }
                                        if ($refanged_matchthis != 
$this->all_filters[$filter_idx]['matches'][$matches_idx]['matchthis'])
                                        {
                                                $did_decode = True;
@@ -452,7 +452,7 @@
                                }
                        }
                        if ($this->debug > 2) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): defanged 
$this->all_filters DUMP:<pre>'; print_r($this->all_filters); echo 
'</pre>'."\r\n"; }
-                       if ($this->debug > 0) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): LEAVING, returning 
$did_decode ['.serialize($did_decode).']<br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 
'bofilters.all_filters_bulk_undo_defang('.__LINE__.'): LEAVING, returning 
$did_decode ['.serialize($did_decode).']<br />'."\r\n"; }
                        return $did_decode;
                }

@@ -463,7 +463,7 @@
                */
                function string_undo_defang($pref_string='')
                {
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_undo_defang('.__LINE__.'): ENTERING, param $pref_string 
['.serialize($pref_string).']<br>'."\r\n"; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_undo_defang('.__LINE__.'): ENTERING, param $pref_string 
['.serialize($pref_string).']<br />'."\r\n"; }
                        if (!$pref_string)
                        {
                                return '';
@@ -471,7 +471,7 @@
                        // undo the _LAME_ way to make the value "database 
friendly"
                        // return slashes and quotes to their actual form as 
slashes and quotes
                        $un_defanged_string = 
$GLOBALS['phpgw']->msg->html_quotes_decode($pref_string);
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_undo_defang('.__LINE__.'): LEAVING returning 
$un_defanged_string ['.serialize($un_defanged_string).']<br>'."\r\n"; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_undo_defang('.__LINE__.'): LEAVING returning 
$un_defanged_string ['.serialize($un_defanged_string).']<br />'."\r\n"; }
                        return $un_defanged_string;
                }

@@ -488,7 +488,7 @@
                */
                function string_strip_and_defang($user_string='')
                {
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_strip_and_defang: ENTERING, para, $user_string 
['.serialize($user_string).']<br>'."\r\n"; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_strip_and_defang: ENTERING, para, $user_string 
['.serialize($user_string).']<br />'."\r\n"; }
                        if (!$user_string)
                        {
                                return '';
@@ -499,7 +499,7 @@
                        // and this is a _LAME_ way to make the value "database 
friendly"
                        // because slashes and quotes will FRY the whole 
preferences repository
                        $prepared_string = 
$GLOBALS['phpgw']->msg->html_quotes_encode($prepared_string);
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_strip_and_defang: LEAVING returning $prepared_string 
['.serialize($prepared_string).']<br>'."\r\n"; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.string_strip_and_defang: LEAVING returning $prepared_string 
['.serialize($prepared_string).']<br />'."\r\n"; }
                        return $prepared_string;
                }

@@ -515,8 +515,8 @@
                */
                function check_duplicate_submit_elements($key='source_accounts')
                {
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.check_duplicate_submit_elements('.__LINE__.'): ENTERING, param $key 
is ['.$key.'] <br>'."\r\n"; }
-                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.check_duplicate_submit_elements('.__LINE__.'): this checks for buggy 
apache2 duplicated source account POSTED form numbered array data<br>'."\r\n"; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.check_duplicate_submit_elements('.__LINE__.'): ENTERING, param $key 
is ['.$key.'] <br />'."\r\n"; }
+                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.check_duplicate_submit_elements('.__LINE__.'): this checks for buggy 
apache2 duplicated source account POSTED form numbered array data<br 
/>'."\r\n"; }
                        $did_alter = False;

                        //source_accounts
@@ -528,7 +528,7 @@
                                if 
(in_array($GLOBALS['phpgw']->msg->ref_POST[$key][$i], $seen_list_items) == True)
                                {
                                        $did_alter = True;
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters: check_duplicate_submit_elements('.__LINE__.'): <u>unsetting</u> and 
*skipping* duplicate (buggy apache2) POST ['.$key.']['.$i.'] array item 
['.$GLOBALS['phpgw']->msg->ref_POST[$key][$i].'] <br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters: check_duplicate_submit_elements('.__LINE__.'): <u>unsetting</u> and 
*skipping* duplicate (buggy apache2) POST ['.$key.']['.$i.'] array item 
['.$GLOBALS['phpgw']->msg->ref_POST[$key][$i].'] <br />'; }
                                        
$GLOBALS['phpgw']->msg->ref_POST[$key][$i] = '';
                                        // can I UNSET this and have the next 
$i index item actually be the next one
                                        // YES, a) array count calculated 
before loop, and b) does not squash array to unset an item
@@ -542,13 +542,13 @@
                                else
                                {
                                        // track seen items for duplicate test
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters: check_duplicate_submit_elements('.__LINE__.'): good (not duplicate, 
not buggy apache2) POST ['.$key.']['.$i.'] array item 
['.$GLOBALS['phpgw']->msg->ref_POST[$key][$i].'] <br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters: check_duplicate_submit_elements('.__LINE__.'): good (not duplicate, 
not buggy apache2) POST ['.$key.']['.$i.'] array item 
['.$GLOBALS['phpgw']->msg->ref_POST[$key][$i].'] <br />'; }
                                        $tmp_next_idx = count($seen_list_items);
                                        $seen_list_items[$tmp_next_idx] = 
$GLOBALS['phpgw']->msg->ref_POST[$key][$i];
                                }
                        }

-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.check_duplicate_submit_elements('.__LINE__.'): LEAVING, returning 
$did_alter ['.serialize($did_alter).']<br>'."\r\n"; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.check_duplicate_submit_elements('.__LINE__.'): LEAVING, returning 
$did_alter ['.serialize($did_alter).']<br />'."\r\n"; }
                }

                /*!
@@ -558,11 +558,11 @@
                */
                function process_submitted_data()
                {
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.process_submitted_data('.__LINE__.'): ENTERING<br>'."\r\n"; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.process_submitted_data('.__LINE__.'): ENTERING<br />'."\r\n"; }
                        if ($this->debug_set_prefs > 2) { echo 
'bofilters.process_submitted_data('.__LINE__.'): (pre-buggy apache2 check) 
ref_POST dump:<pre>'; print_r($GLOBALS['phpgw']->msg->ref_POST); echo 
'</pre>'."\r\n"; }
                        
$this->check_duplicate_submit_elements('source_accounts');

-                       //if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data: caling 
$this->distill_filter_args<br>'."\r\n"; }
+                       //if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data: caling $this->distill_filter_args<br 
/>'."\r\n"; }
                        //$this->distill_filter_args();
                        // we must have data because the form action made this 
code run
                        $this_filter = array();
@@ -577,7 +577,7 @@
                                echo 
'bofilters.process_submitted_data('.__LINE__.'): LEAVING with ERROR, unable to 
obtain POST filter_num';
                                return;
                        }
-                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): $this_filter[filter_num]: 
['.$found_filter_num.']<br>'; }
+                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): $this_filter[filter_num]: 
['.$found_filter_num.']<br />'; }

                        // FILTER NAME
                        if 
((isset($GLOBALS['phpgw']->msg->ref_POST['filtername']))
@@ -592,7 +592,7 @@
                                //$this_filter['filtername'] = 'Filter 
'.$found_filter_num;
                                $this_filter['filtername'] = 'My Mail Filter';
                        }
-                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): $this_filter[filtername]: 
['.$this_filter['filtername'].']<br>'; }
+                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): $this_filter[filtername]: 
['.$this_filter['filtername'].']<br />'; }

                        // ---- The Rest of the data is submitted in  Array 
Form ----

@@ -632,7 +632,7 @@
                                || ($key == 'filtername')
                                || ($key == 'source_accounts'))
                                {
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): $GLOBALS[HTTP_POST_VARS] 
key,value walk thru: $key: ['.$key.'] is data we already processed, skip to 
next loop<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): $GLOBALS[HTTP_POST_VARS] 
key,value walk thru: $key: ['.$key.'] is data we already processed, skip to 
next loop<br />'; }
                                        continue;
                                }
                                if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): $GLOBALS[HTTP_POST_VARS] 
key,value walk thru: $key: ['.$key.'] ; $value DUMP:<pre>'; print_r($value); 
echo "</pre>\r\n"; }
@@ -641,39 +641,39 @@
                                {
                                        // now we grab the index value from the 
key string
                                        $match_this_idx = (int)$key[6];
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): match_this_idx grabbed value: 
['.$match_this_idx.']<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): match_this_idx grabbed value: 
['.$match_this_idx.']<br />'; }
                                        $match_data = 
$GLOBALS['phpgw']->msg->ref_POST[$key];
                                        // is this row even being used?
                                        if ((isset($match_data['andor']))
                                        && ($match_data['andor'] == 
'ignore_me'))
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): SKIP this row, 
$match_data[andor]: ['.$match_data['andor'].']<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): SKIP this row, 
$match_data[andor]: ['.$match_data['andor'].']<br />'; }
                                        }
                                        else
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): $match_data[matchthis] 
PRE-defang ['.serialize($match_data['matchthis']).']<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): $match_data[matchthis] 
PRE-defang ['.serialize($match_data['matchthis']).']<br />'; }
                                                // DEFANG on 
$match_data["matchthis"] (will need to reverse that on read)
                                                $match_data['matchthis'] = 
$this->string_strip_and_defang($match_data['matchthis']);
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): $match_data[matchthis] 
POST-defang ['.serialize($match_data['matchthis']).']<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): $match_data[matchthis] 
POST-defang ['.serialize($match_data['matchthis']).']<br />'; }
                                                
$this_filter['matches'][$match_this_idx] = $match_data;
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): 
$this_filter[matches]['.$match_this_idx.'] = 
['.serialize($this_filter['matches'][$match_this_idx]).']<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): 
$this_filter[matches]['.$match_this_idx.'] = 
['.serialize($this_filter['matches'][$match_this_idx]).']<br />'; }
                                        }
                                }
                                elseif (strstr($key, 'action_'))
                                {
                                        // now we grab the index value from the 
key string
                                        $action_this_idx = (int)$key[7];
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): action_this_idx grabbed value: 
['.$action_this_idx.']<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.process_submitted_data('.__LINE__.'): action_this_idx grabbed value: 
['.$action_this_idx.']<br />'; }
                                        $action_data = 
$GLOBALS['phpgw']->msg->ref_POST[$key];
                                        if ((isset($action_data['judgement']))
                                        && ($action_data['judgement'] == 
'ignore_me'))
                                        {
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): SKIP this row, 
$action_data[judgement]: ['.$match_data['andor'].']<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): SKIP this row, 
$action_data[judgement]: ['.$match_data['andor'].']<br />'; }
                                        }
                                        else
                                        {
                                                
$this_filter['actions'][$action_this_idx] = $action_data;
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): 
$this_filter[actions][$action_this_idx]: 
['.serialize($this_filter['actions'][$action_this_idx]).']<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.process_submitted_data('.__LINE__.'): 
$this_filter[actions][$action_this_idx]: 
['.serialize($this_filter['actions'][$action_this_idx]).']<br />'; }
                                        }
                                }
                        }
@@ -724,12 +724,12 @@

                        // NEW we need to wipe the cached filters
                        $my_location = '0;cached_prefs';
-                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository('.__LINE__.'): NEW: EXPIRE CACHED 
PREFERENCES, calling ->msg->so->so_appsession_passthru('.$my_location.', " 
")<br>'; }
+                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository('.__LINE__.'): NEW: EXPIRE CACHED 
PREFERENCES, calling ->msg->so->so_appsession_passthru('.$my_location.', " 
")<br />'; }
                        
$GLOBALS['phpgw']->msg->so->so_appsession_passthru($my_location, ' ');

                        // first we delete any existing data at the desired 
prefs location
                        $pref_struct_str = '["filters"]';
-                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                        
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);

                        for ($filter_idx=0; $filter_idx < 
count($this->all_filters); $filter_idx++)
@@ -742,7 +742,7 @@

                                // $this_filter['filtername']   string (will 
require htmlslecialchars_encode and decode
                                $pref_struct_str = 
'["filters"]['.$filter_idx.']["filtername"]';
-                               if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['filtername'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                               if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['filtername'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['filtername']);

                                // $this_filter['source_accounts']      array
@@ -753,11 +753,11 @@
                                {
                                        // folder
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["source_accounts"]['.$i.']["folder"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['source_accounts'][$i]['folder'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['source_accounts'][$i]['folder'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['source_accounts'][$i]['folder']);
                                        // acctnum
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["source_accounts"]['.$i.']["acctnum"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['source_accounts'][$i]['acctnum'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['source_accounts'][$i]['acctnum'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['source_accounts'][$i]['acctnum']);
                                }

@@ -773,16 +773,16 @@
                                        if 
(isset($this_filter['matches'][$i]['andor']))
                                        {
                                                $pref_struct_str = 
'["filters"]['.$filter_idx.']["matches"]['.$i.']["andor"]';
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['andor'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['andor'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                                
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['matches'][$i]['andor']);
                                        }
                                        // examine
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["matches"]['.$i.']["examine"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['examine'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['examine'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['matches'][$i]['examine']);
                                        // comparator
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["matches"]['.$i.']["comparator"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['comparator'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['comparator'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['matches'][$i]['comparator']);
                                        // matchthis
                                        // user_string, may need 
htmlslecialchars_encode decode and/or the user may forget to tnter data here
@@ -792,7 +792,7 @@
                                                
$this_filter['matches'][$i]['matchthis'] = 'user_string_not_filled_by_user';
                                        }
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["matches"]['.$i.']["matchthis"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['matchthis'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['matches'][$i]['matchthis'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['matches'][$i]['matchthis']);
                                }

@@ -806,21 +806,21 @@
                                {
                                        // judgement
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["actions"]['.$i.']["judgement"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['judgement'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['judgement'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['actions'][$i]['judgement']);
                                        // folder
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["actions"]['.$i.']["folder"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['folder'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['folder'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['actions'][$i]['folder']);
                                        // actiontext
                                        $pref_struct_str = 
'["filters"]['.$filter_idx.']["actions"]['.$i.']["actiontext"]';
-                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['actiontext'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                       if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['actiontext'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['actions'][$i]['actiontext']);
                                        // stop_filtering
                                        if 
(isset($this_filter['actions'][$i]['stop_filtering']))
                                        {
                                                $pref_struct_str = 
'["filters"]['.$filter_idx.']["actions"]['.$i.']["stop_filtering"]';
-                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['stop_filtering'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                               if ($this->debug_set_prefs > 1) 
{ echo 'bofilters.save_all_filters_to_repository: using 
preferences->add_struct("email", $pref_struct_str, 
'.$this_filter['actions'][$i]['stop_filtering'].') which will eval 
$pref_struct_str='.$pref_struct_str.'<br />'; }
                                                
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$this_filter['actions'][$i]['stop_filtering']);
                                        }
                                }
@@ -829,12 +829,12 @@
                        // DONE processing prefs, SAVE to the Repository
                        if ($this->debug_set_prefs > 3)
                        {
-                               echo 'bofilters.save_all_filters_to_repository: 
*debug* at ['.$this->debug_set_prefs.'] so skipping save_repository<br>';
+                               echo 'bofilters.save_all_filters_to_repository: 
*debug* at ['.$this->debug_set_prefs.'] so skipping save_repository<br />';
                        }
                        else
                        {
                                if ($this->debug_set_prefs > 2) { echo 
'bofilters.save_all_filters_to_repository: direct pre-save 
$GLOBALS[phpgw]->preferences->data[email][filters] DUMP:<pre>'; 
print_r($GLOBALS['phpgw']->preferences->data['email']['filters']); echo 
'</pre>'; }
-                               if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: SAVING REPOSITORY<br>'; }
+                               if ($this->debug_set_prefs > 1) { echo 
'bofilters.save_all_filters_to_repository: SAVING REPOSITORY<br />'; }
                                
$GLOBALS['phpgw']->preferences->save_repository();
                                // re-grab data from prefs

@@ -847,14 +847,14 @@
                                                                                
'/index.php',
                                                                                
'menuaction=email.uifilters.filters_list');

-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.save_all_filters_to_repository: almost LEAVING, about to issue a 
redirect to:<br>'.$take_me_to_url.'<br>'; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.save_all_filters_to_repository: almost LEAVING, about to issue a 
redirect to:<br />'.$take_me_to_url.'<br />'; }
                        if ($this->debug_set_prefs > 1)
                        {
-                               echo 'bofilters.save_all_filters_to_repository: 
LEAVING, *debug* at ['.$this->debug_set_prefs.'] so skipping Header redirection 
to: ['.$take_me_to_url.']<br>';
+                               echo 'bofilters.save_all_filters_to_repository: 
LEAVING, *debug* at ['.$this->debug_set_prefs.'] so skipping Header redirection 
to: ['.$take_me_to_url.']<br />';
                        }
                        else
                        {
-                               if ($this->debug_set_prefs > 0) { echo 
'bofilters.save_all_filters_to_repository: LEAVING with redirect to: 
<br>'.$take_me_to_url.'<br>'; }
+                               if ($this->debug_set_prefs > 0) { echo 
'bofilters.save_all_filters_to_repository: LEAVING with redirect to: <br 
/>'.$take_me_to_url.'<br />'; }
                                Header('Location: ' . $take_me_to_url);
                        }
                }
@@ -866,7 +866,7 @@
                */
                function delete_filter()
                {
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.delete_filter: ENTERING<br>'; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.delete_filter: ENTERING<br />'; }
                        // FILTER NUMBER
                        $filter_num = $this->obtain_filer_num();

@@ -880,7 +880,7 @@
                        $this->all_filters[$filter_num] = array();
                        unset($this->all_filters[$filter_num]);
                        $this->save_all_filters_to_repository();
-                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.delete_filter: LEAVING<br>'; }
+                       if ($this->debug_set_prefs > 0) { echo 
'bofilters.delete_filter: LEAVING<br />'; }
                }


@@ -891,24 +891,24 @@
                */
                function do_filter()
                {
-                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): ENTERING<br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): ENTERING<br />'; }
                        if (count($this->all_filters) == 0)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): LEAVING with ERROR, no filters exist<br>'; }
+                               if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): LEAVING with ERROR, no filters exist<br 
/>'; }
                                return False;
                        }

-                       //if ($this->debug > 0) { echo 'bofilters.do_filter: 
LINE '.__LINE__.' call "->msg->event_begin_big_move" to notice event of 
impending big batch moves or deletes<br>'; }
+                       //if ($this->debug > 0) { echo 'bofilters.do_filter: 
LINE '.__LINE__.' call "->msg->event_begin_big_move" to notice event of 
impending big batch moves or deletes<br />'; }
                        // CORRECTION: the move function now buffers the 
commands and the count of those buffered commands is kept there, where big move 
or not is now determined
                        //$GLOBALS['phpgw']->msg->event_begin_big_move(array(), 
'bofilters.do_filter: LINE '.__LINE__);

                        // filtering thousands of messages can require more time
-                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): calling set_time_limit giving value of 120 
ie 2 minutes? <br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): calling set_time_limit giving value of 120 
ie 2 minutes? <br />'; }
                        set_time_limit(120);

                        // "False" means  return $this->not_set  if no filter 
number was found anywhere
                        $found_filter_num = $this->obtain_filer_num(False);
-                       if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): $found_filter_num : 
[<code>'.serialize($found_filter_num).'</code>]<br>'."\r\n"; }
+                       if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): $found_filter_num : 
[<code>'.serialize($found_filter_num).'</code>]<br />'."\r\n"; }

                        if ($found_filter_num == $this->not_set)
                        {
@@ -916,7 +916,7 @@
                                $this->do_filter_apply_all = True;
                                for ($filter_idx=0; $filter_idx < 
count($this->all_filters); $filter_idx++)
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): run_all_finters_mode: calling 
$this->run_single_filter['.$filter_idx.']<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): run_all_finters_mode: calling 
$this->run_single_filter['.$filter_idx.']<br />'; }
                                        
$this->run_single_filter((int)$filter_idx);
                                        if ($this->just_testing())
                                        {
@@ -929,7 +929,7 @@
                        {
                                // we were given a filter_num, that means run 
THAT FILTER ONLY
                                $this->do_filter_apply_all = False;
-                               if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): run_single_filter mode: calling 
$this->run_single_filter['.$found_filter_num.']<br>'; }
+                               if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): run_single_filter mode: calling 
$this->run_single_filter['.$found_filter_num.']<br />'; }
                                
$this->run_single_filter((int)$found_filter_num);
                                if ($this->just_testing())
                                {
@@ -939,10 +939,10 @@
                        }

                        // ok, filters have run, EXPUNGE now
-                       if ($this->debug > 1) { echo 'bofilters.do_filter 
('.__LINE__.'): done filtering, now call 
$GLOBALS[phpgw]->msg->expunge_expungable_folders<br>'; }
+                       if ($this->debug > 1) { echo 'bofilters.do_filter 
('.__LINE__.'): done filtering, now call 
$GLOBALS[phpgw]->msg->expunge_expungable_folders<br />'; }
                        $did_expunge = False;
                        $did_expunge = 
$GLOBALS['phpgw']->msg->expunge_expungable_folders('bofilters.do_filter LINE 
'.__LINE__);
-                       if ($this->debug > 1) { echo 'bofilters.do_filter 
('.__LINE__.'): $GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br>'; }
+                       if ($this->debug > 1) { echo 'bofilters.do_filter 
('.__LINE__.'): $GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br />'; }

                        // ok, filters have run, do we have a report to show?
                        if ($this->just_testing())
@@ -972,27 +972,27 @@
                                        $num_matches = 
count($this->each_filter_mball_list[$filter_idx]);
                                        
parse_str($this_filter['actions'][0]['folder'], $target_folder);
                                        echo '<p>'."\r\n"
-                                       .'<strong>'.lang('Filter number').' 
'.(string)$filter_idx.':</strong>'.'<br>'."\r\n"
-                                       .'&nbsp;&nbsp;&nbsp;'.lang('filter 
name:').' ['.$this_filter['filtername'].']<br>'."\r\n"
-                                       .'&nbsp;&nbsp;&nbsp;'.lang('number of 
matches:').' ['.(string)$num_matches.']'.'<br>'."\r\n"
+                                       .'<strong>'.lang('Filter number').' 
'.(string)$filter_idx.':</strong>'.'<br />'."\r\n"
+                                       .'&nbsp;&nbsp;&nbsp;'.lang('filter 
name:').' ['.$this_filter['filtername'].']<br />'."\r\n"
+                                       .'&nbsp;&nbsp;&nbsp;'.lang('number of 
matches:').' ['.(string)$num_matches.']'.'<br />'."\r\n"

-                                       .'&nbsp;&nbsp;&nbsp;'.lang('requested 
filter action:').' ['.$this_filter['actions'][0]['judgement'].'] ; Acctnum 
['.(string)$target_folder['acctnum'].'] ;  '.lang('Folder').': 
['.htmlspecialchars($target_folder['folder']).']<br>'."\r\n"
+                                       .'&nbsp;&nbsp;&nbsp;'.lang('requested 
filter action:').' ['.$this_filter['actions'][0]['judgement'].'] ; Acctnum 
['.(string)$target_folder['acctnum'].'] ;  '.lang('Folder').': 
['.htmlspecialchars($target_folder['folder']).']<br />'."\r\n"
                                        .'</p>'."\r\n"
                                        .'<p>&nbsp;</p>'."\r\n";
                                }
                        }
-                       if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): calling end_request<br>'; }
+                       if ($this->debug > 1) { echo 
'bofilters.do_filter('.__LINE__.'): calling end_request<br />'; }
                        $GLOBALS['phpgw']->msg->end_request();
-                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): LEAVING<br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): LEAVING<br />'; }
                        $take_me_to_url = $GLOBALS['phpgw']->link(
                                                                                
'/index.php',
                                                                                
//'menuaction=email.uifilters.filters_list');
                                                                                
'menuaction=email.uiindex.index');
                        $take_me_to_href = '<a href="'.$take_me_to_url.'"> 
'.lang('Go Back').' </a>';
                        //Header('Location: ' . $take_me_to_url);
-                       echo 
'<br><p>'.'&nbsp;&nbsp;&nbsp;'.$take_me_to_href.'</p><BR>';
+                       echo '<br 
/><p>'.'&nbsp;&nbsp;&nbsp;'.$take_me_to_href.'</p><br />';

-                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): LEAVING<br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.do_filter('.__LINE__.'): LEAVING<br />'; }
                }

                // PRIVATE
@@ -1004,15 +1004,15 @@
                */
                function run_single_filter($filter_num='')
                {
-                       if ($this->debug > 0) { echo 
'bofilters.run_single_filter('.__LINE__.'): ENTERING, feed  $filter_num : 
[<code>'.serialize($filter_num).'</code>]<br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.run_single_filter('.__LINE__.'): ENTERING, feed  $filter_num : 
[<code>'.serialize($filter_num).'</code>]<br />'; }
                        if (count($this->all_filters) == 0)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.run_single_filter('.__LINE__.'): LEAVING with ERROR, no filters 
exist<br>'; }
+                               if ($this->debug > 0) { echo 
'bofilters.run_single_filter('.__LINE__.'): LEAVING with ERROR, no filters 
exist<br />'; }
                        }
                        $filter_exists = $this->filter_exists($filter_num);
                        if (!$filter_exists)
                        {
-                               if ($this->debug > 0) { echo 
'bofilters.run_single_filter('.__LINE__.'): LEAVING with ERROR, filter data for 
$filter_num ['.$filter_num.'] does not exist, return False<br>'; }
+                               if ($this->debug > 0) { echo 
'bofilters.run_single_filter('.__LINE__.'): LEAVING with ERROR, filter data for 
$filter_num ['.$filter_num.'] does not exist, return False<br />'; }
                                return False;
                        }
                        $this_filter = $this->all_filters[$filter_num];
@@ -1021,7 +1021,7 @@
                        // WE NEED TO DO THIS FOR EVERY SOURCE ACCOUNT 
specified in this filter
                        for ($src_acct_loop_num=0; $src_acct_loop_num < 
count($this_filter['source_accounts']); $src_acct_loop_num++)
                        {
-                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): source_accounts loop 
['.$src_acct_loop_num.']<br>'; }
+                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): source_accounts loop 
['.$src_acct_loop_num.']<br />'; }

                                // ACCOUNT TO SEARCH (always filter source is 
INBOX)
                                $fake_fldball = array();
@@ -1033,12 +1033,12 @@
                                if 
((isset($this->inbox_full_msgball_list[$src_acct_loop_num]))
                                || 
(count($this->inbox_full_msgball_list[$src_acct_loop_num]) > 0))
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): already obtained 
inbox_full_msgball_list, during a previous filter, for $src_acct_loop_num 
['.$src_acct_loop_num.']<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): already obtained 
inbox_full_msgball_list, during a previous filter, for $src_acct_loop_num 
['.$src_acct_loop_num.']<br />'; }
                                }
                                else
                                {
                                        // get FULL msgball list for this INBOX 
(we always filter INBOXs only)
-                                       if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): get_msgball_list for later XOR ing 
for <code>['.serialize($fake_fldball).']</code><br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): get_msgball_list for later XOR ing 
for <code>['.serialize($fake_fldball).']</code><br />'; }
                                        
//$this->inbox_full_msgball_list[$src_acct_loop_num] = 
$GLOBALS['phpgw']->msg->get_msgball_list($fake_fldball['acctnum'], 
$fake_fldball['folder']);
                                        // FIXME: FOR BACKWARDS COMPAT WE GET 
AN OLD STYLE MSGBALL LIST
                                        
$this->inbox_full_msgball_list[$src_acct_loop_num] = 
$GLOBALS['phpgw']->msg->get_msgball_list_oldschool($fake_fldball['acctnum'], 
$fake_fldball['folder']);
@@ -1047,7 +1047,7 @@

                                // FOR EACH MSG, GET IT'S RAW HEADERS
                                // only if we have not got them yet
-                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): get headers for each msg in 
$src_acct_loop_num ['.$src_acct_loop_num.']<br>'; }
+                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): get headers for each msg in 
$src_acct_loop_num ['.$src_acct_loop_num.']<br />'; }
                                for ($msg_iteration=0; $msg_iteration < 
count($this->inbox_full_msgball_list[$src_acct_loop_num]); $msg_iteration++)
                                {
                                        if 
((isset($this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['headers_text']))
@@ -1055,7 +1055,7 @@
                                        {
                                                // we ALREADY hav the headers
                                                // continue to the next message
-                                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): already obtained headers, during a 
previous filter, for $src_acct_loop_num ['.$src_acct_loop_num.']<br>'; }
+                                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): already obtained headers, during a 
previous filter, for $src_acct_loop_num ['.$src_acct_loop_num.']<br />'; }
                                                continue;
                                        }
                                        // we need to get the headers
@@ -1130,7 +1130,7 @@
                                        if 
($this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['msgnum'] 
== $this->not_set)
                                        {
                                                // this message had already 
been filtered AND MOVED OR DELETED, continue to next loop
-                                               if ($this->debug > 1) { echo 
'<br>bofilters.run_single_filter('.__LINE__.'): skipping... this message has 
already been moved, deleted by a previous filter, $src_acct_loop_num 
['.$src_acct_loop_num.'] $msg_iteration ['.$msg_iteration.']<br><br>'; }
+                                               if ($this->debug > 1) { echo 
'<br />bofilters.run_single_filter('.__LINE__.'): skipping... this message has 
already been moved, deleted by a previous filter, $src_acct_loop_num 
['.$src_acct_loop_num.'] $msg_iteration ['.$msg_iteration.']<br /><br />'; }
                                                continue;
                                        }
                                        // we have a message to be filtered...
@@ -1143,7 +1143,7 @@
                                        // WE NEED TO DO THIS FOR EVERY MATCH 
ROW
                                        for ($matches_row=0; $matches_row < 
count($this_filter['matches']); $matches_row++)
                                        {
-                                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): source_accounts loop 
['.$src_acct_loop_num.'] ; $msg_iteration ['.$msg_iteration.'] ; $matches_row 
['.$matches_row.']<br>'; }
+                                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): source_accounts loop 
['.$src_acct_loop_num.'] ; $msg_iteration ['.$msg_iteration.'] ; $matches_row 
['.$matches_row.']<br />'; }
                                                // Note on "RECIPIENT" :  
to,cc, bcc  "tri-fecta" all three headers must be considered
                                                // this is why we made a faux 
header line that contains all three of those in one line
                                                // NOTE: recipient Contains vs. 
NotContains
@@ -1165,7 +1165,7 @@
                                                // if this is really the 1st 
word of the header string, it will be preceeded by CRLF
                                                $inspect_me = 
stristr($headers_text, "\r\n".$search_key_imap);
                                                // inspect_me will be 
everything to the right of the "neede" INCLUDING the "needle" itself and the 
REST of the headers
-                                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): $search_key_imap  
['.$search_key_imap.'] ; $comparator ['.$comparator.'] ; $search_for 
['.$search_for.']<br>'; }
+                                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter('.__LINE__.'): $search_key_imap  
['.$search_key_imap.'] ; $comparator ['.$comparator.'] ; $search_for 
['.$search_for.']<br />'; }
                                                if ($inspect_me)
                                                {
                                                        // get rid of that 
"needle"  search_key_imap (it's included from the stristr above)
@@ -1176,7 +1176,7 @@
                                                        $cut_here = 
strpos($inspect_me, "\r\n");
                                                        // get everything FROM 
beginning of string TO  pos $cut_here (the end of the line);
                                                        $inspect_me = 
substr($inspect_me, 0, $cut_here);
-                                                       if ($this->debug > 1) { 
echo 'bofilters.run_single_filter('.__LINE__.'): GOT HEADER TO LOOK IN: 
$inspect_me ['.htmlspecialchars($inspect_me).']<br>'; }
+                                                       if ($this->debug > 1) { 
echo 'bofilters.run_single_filter('.__LINE__.'): GOT HEADER TO LOOK IN: 
$inspect_me ['.htmlspecialchars($inspect_me).']<br />'; }
                                                        // look for EXISTS or 
NOT EXISTS our search string
                                                        if
                                                        (
@@ -1186,7 +1186,7 @@
                                                                && 
(stristr($inspect_me, $search_for) == False))
                                                        )
                                                        {
-                                                               if 
($this->debug > 1) { echo 'bofilters.run_single_filter('.__LINE__.'): ** GOT 
ROW CRITERIA MATCH ** $matches_row '.$matches_row.'<br>'; }
+                                                               if 
($this->debug > 1) { echo 'bofilters.run_single_filter('.__LINE__.'): ** GOT 
ROW CRITERIA MATCH ** $matches_row '.$matches_row.'<br />'; }
                                                                // MATCH: this 
row matches the search criteria
                                                                // i.e. this 
header line does -or- does not have the seach for text, as requested
                                                                if 
($matches_row == 0)
@@ -1207,7 +1207,7 @@
                                                                }
                                                                else
                                                                {
-                                                                       echo 
'match keeper error<br>';
+                                                                       echo 
'match keeper error<br />';
                                                                        
$this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['match_keeper']
 = 'ERROR1';
                                                                }

@@ -1221,7 +1221,7 @@
                                                {
                                                        // header we are 
looking for does not exist in this messages headers
                                                        // probably lookinf for 
an "X-" header, like "X-Mailer:"
-                                                       if ($this->debug > 1) { 
echo 'bofilters.run_single_filter('.__LINE__.'): requested header 
$search_key_imap  ['.$search_key_imap.'] not in this messages headers<br>'; }
+                                                       if ($this->debug > 1) { 
echo 'bofilters.run_single_filter('.__LINE__.'): requested header 
$search_key_imap  ['.$search_key_imap.'] not in this messages headers<br />'; }
                                                }
                                                // this is the last code that 
gets run BEFORE we move on to the next row of match criteria
                                                // this code is INSIDE the 
match criteria rows
@@ -1291,25 +1291,25 @@
                */
                function filter_action_sequence($filter_num='', 
$src_acct_loop_num='', $msg_iteration='', $this_filter='')
                {
-                       if ($this->debug > 0) { echo 
'bofilters.filter_action_sequence: ENTERING <br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.filter_action_sequence: ENTERING <br />'; }
                        if (((string)$filter_num == '')
                        || ((string)$src_acct_loop_num == '')
                        || ((string)$msg_iteration == '')
                        || ($this_filter == ''))
                        {
-                               echo 'bofilters.filter_action_sequence: 
LEAVING, insufficient data in params <br>';
+                               echo 'bofilters.filter_action_sequence: 
LEAVING, insufficient data in params <br />';
                                return False;
                        }

                        $match_keeper = 
$this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['match_keeper'];
-                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: FINAL match results for this message 
[<code>'.serialize($match_keeper).'</code>] <br>'; }
+                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: FINAL match results for this message 
[<code>'.serialize($match_keeper).'</code>] <br />'; }
                        // test match keeper accuracy
                        if ($this->debug > 1)
                        {
-                               if ($match_keeper & F_ROW_0_MATCH) { echo 
'<b>MATCH</b> row 0 criteria<br>'; }
-                               if ($match_keeper & F_ROW_1_MATCH) { echo 
'<b>MATCH</b> row 1 criteria<br>'; }
-                               if ($match_keeper & F_ROW_2_MATCH) { echo 
'<b>MATCH</b> row 2 criteria<br>'; }
-                               if ($match_keeper & F_ROW_3_MATCH) { echo 
'<b>MATCH</b> row 3 criteria<br>'; }
+                               if ($match_keeper & F_ROW_0_MATCH) { echo 
'<b>MATCH</b> row 0 criteria<br />'; }
+                               if ($match_keeper & F_ROW_1_MATCH) { echo 
'<b>MATCH</b> row 1 criteria<br />'; }
+                               if ($match_keeper & F_ROW_2_MATCH) { echo 
'<b>MATCH</b> row 2 criteria<br />'; }
+                               if ($match_keeper & F_ROW_3_MATCH) { echo 
'<b>MATCH</b> row 3 criteria<br />'; }
                        }

                        $do_apply_action = False;
@@ -1319,12 +1319,12 @@
                        {
                                if ($match_keeper & F_ROW_0_MATCH)
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: single row criteria is a match and DOES 
trigger action<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: single row criteria is a match and DOES 
trigger action<br />'; }
                                        $do_apply_action = True;
                                }
                                else
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: single row criteria Fails<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: single row criteria Fails<br />'; }
                                }
                        }
                        // 2 rows handler
@@ -1336,7 +1336,7 @@
                                && ($match_keeper & F_ROW_0_MATCH)
                                && ($match_keeper & F_ROW_1_MATCH))
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 2 rows of criteria: "AND" logic chain is 
satisified, DO APPLY ACTION<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 2 rows of criteria: "AND" logic chain is 
satisified, DO APPLY ACTION<br />'; }
                                        $do_apply_action = True;
                                }
                                elseif (($this_filter['matches'][1]['andor'] == 
'or')
@@ -1345,12 +1345,12 @@
                                        )
                                )
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 2 rows of criteria: "OR" logic chain is 
satisified, DO APPLY ACTION<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 2 rows of criteria: "OR" logic chain is 
satisified, DO APPLY ACTION<br />'; }
                                        $do_apply_action = True;
                                }
                                else
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 2 rows of criteria: logic chain Fails<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 2 rows of criteria: logic chain Fails<br 
/>'; }
                                }
                        }
                        // 3 rows handler
@@ -1363,12 +1363,12 @@
                                        || ($match_keeper & 
$this->match_keeper_row_values[1])
                                        || ($match_keeper & 
$this->match_keeper_row_values[2]))
                                        {
-                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 3 rows of criteria: both "andor"s are "OR"s, 
logic chain is satisified, DO APPLY ACTION<br>'; }
+                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 3 rows of criteria: both "andor"s are "OR"s, 
logic chain is satisified, DO APPLY ACTION<br />'; }
                                                $do_apply_action = True;
                                        }
                                        else
                                        {
-                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 3 rows of criteria: both "andor"s are "OR"s, 
logic chain Fails<br>'; }
+                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: 3 rows of criteria: both "andor"s are "OR"s, 
logic chain Fails<br />'; }
                                        }
                                }
                                // after 2 rows of match criteria, we need to 
handle more complex AND / OR logic
@@ -1400,22 +1400,22 @@
                                                        .' '.$andor_code[2].' '
                                                        .'$match_keeper & 
$this->match_keeper_row_values[2]'
                                                        .');';
-                                       if ($this->debug > 1) { echo ' * $code: 
'.$code.'<br>'; }
+                                       if ($this->debug > 1) { echo ' * $code: 
'.$code.'<br />'; }
                                        eval($code);
-                                       if ($this->debug > 1) { echo ' * 
$evaled: '.serialize($evaled).'<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
$evaled: '.serialize($evaled).'<br />'; }
                                        $do_apply_action = $evaled;
                                }
                        }
                        else
                        {
-                               echo 'bofilters.filter_action_sequence: ERROR: 
too many rows<br>';
+                               echo 'bofilters.filter_action_sequence: ERROR: 
too many rows<br />';
                                return False;
                        }

                        // = = = ACTION(S) = = =
                        if ($do_apply_action == True)
                        {
-                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: <strong>### Filter MATCH ###</strong>, now 
apply the action... <br>'; }
+                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: <strong>### Filter MATCH ###</strong>, now 
apply the action... <br />'; }
                                // compile report
                                if 
(!isset($this->each_filter_mball_list[$filter_num]))
                                {
@@ -1430,7 +1430,7 @@
                                if ($this->just_testing() == False)
                                {
                                        // NOT A TEST - APPLY THE ACTION(S)
-                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: NOT a Test, *Apply* the Action(s) ; 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: NOT a Test, *Apply* the Action(s) ; 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br />'; }
                                        // ACTION: FILEINTO
                                        if 
($this_filter['actions'][0]['judgement'] == 'fileinto')
                                        {
@@ -1456,21 +1456,21 @@
                                                $to_fldball['folder'] = 
$target_folder['folder'];
                                                $to_fldball['acctnum'] = 
(int)$target_folder['acctnum'];
                                                if ($this->debug > 2) { echo 
'bofilters.filter_action_sequence: $to_fldball DUMP:<pre>'; 
print_r($to_fldball); echo "</pre>\r\n"; }
-                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: pre-move info: $mov_msgball 
[<code>'.serialize($mov_msgball).'</code>]<br>'; }
-                                               //echo 'EXIT NOT READY TO APPLY 
THE FILTER YET<br>';
+                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: pre-move info: $mov_msgball 
[<code>'.serialize($mov_msgball).'</code>]<br />'; }
+                                               //echo 'EXIT NOT READY TO APPLY 
THE FILTER YET<br />';
                                                $good_to_go = 
$GLOBALS['phpgw']->msg->industrial_interacct_mail_move($mov_msgball, 
$to_fldball);

                                                if (!$good_to_go)
                                                {
                                                        // ERROR
-                                                       if ($this->debug > 1) { 
echo 'bofilters.filter_action_sequence: ERROR: industrial_interacct_mail_move 
returns FALSE<br>'; }
+                                                       if ($this->debug > 1) { 
echo 'bofilters.filter_action_sequence: ERROR: industrial_interacct_mail_move 
returns FALSE<br />'; }
                                                        return False;
                                                }
                                        }
                                        else
                                        {
                                                // not yet coded action
-                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: actions not yet coded: 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br>'; }
+                                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: actions not yet coded: 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br />'; }
                                        }
                                }

@@ -1478,13 +1478,13 @@

                                // REMOVE THIS MSGBALL from the 
"inbox_full_msgball_list" IF we move, delete, etc... the message
                                // it must remain in sync with the actual mail 
box folder
-                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: action completed, REMOVE msgball from L1 
cache class var inbox_full_msgball_list, change msgball["msgnum"] from 
'.serialize($this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['msgnum']).'
 to not_set "-1"<br>'; }
+                               if ($this->debug > 1) { echo 
'bofilters.filter_action_sequence: action completed, REMOVE msgball from L1 
cache class var inbox_full_msgball_list, change msgball["msgnum"] from 
'.serialize($this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['msgnum']).'
 to not_set "-1"<br />'; }
                                
$this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['msgnum'] = 
$this->not_set;
                        }


-                       if ($this->debug > 0) { echo 
'bofilters.filter_action_sequence: LEAVING, returning True <br>'; }
-                       if ($this->debug > 1) { echo '<br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.filter_action_sequence: LEAVING, returning True <br />'; }
+                       if ($this->debug > 1) { echo '<br />'; }
                        // if we get to here, no error kicked us out of this 
function, so I guess we should retuen True
                        return True;
                }
@@ -1500,8 +1500,8 @@
                        if (($this->just_testing())
                        && (count($this->each_filter_mball_list[$filter_num]) > 
0))
                        {
-                               if ($this->debug > 1) { echo 
'bofilters.make_filter_match_report: Filter Report Maker<br>'; }
-                               if ($this->debug > 1) { echo 
'bofilters.make_filter_match_report: number of matches 
$this->each_filter_mball_list['.$filter_num.'] = ' 
.count($this->each_filter_mball_list[$filter_num]).'<br>'."\r\n"; }
+                               if ($this->debug > 1) { echo 
'bofilters.make_filter_match_report: Filter Report Maker<br />'; }
+                               if ($this->debug > 1) { echo 
'bofilters.make_filter_match_report: number of matches 
$this->each_filter_mball_list['.$filter_num.'] = ' 
.count($this->each_filter_mball_list[$filter_num]).'<br />'."\r\n"; }
                                // make a "fake" folder_info array to make 
things simple for get_msg_list_display
                                $fake_folder_info['is_imap'] = True;
                                $fake_folder_info['folder_checked'] = 'INBOX';
@@ -1640,10 +1640,10 @@
                        $this_filter_matching_msgballs = array();
                        for ($src_acct_loop_num=0; $src_acct_loop_num < 
count($this_filter['source_accounts']); $src_acct_loop_num++)
                        {
-                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter: source_accounts ACTION loop 
['.$src_acct_loop_num.']<br>'; }
+                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter: source_accounts ACTION loop 
['.$src_acct_loop_num.']<br />'; }
                                for ($msg_iteration=0; $msg_iteration < 
count($this->inbox_full_msgball_list[$src_acct_loop_num]); $msg_iteration++)
                                {
-                                       if ($this->debug > 1) { echo 
'bofilters.run_single_filter: source_accounts ['.$src_acct_loop_num.'] 
$msg_iteration iteration ['.$msg_iteration.'] ACTION loop<br>'; }
+                                       if ($this->debug > 1) { echo 
'bofilters.run_single_filter: source_accounts ['.$src_acct_loop_num.'] 
$msg_iteration iteration ['.$msg_iteration.'] ACTION loop<br />'; }
                                        // do we need to do something with this 
message?
                                        $match_keeper = 
$this->inbox_full_msgball_list[$src_acct_loop_num][$msg_iteration]['match_keeper'];
                                        if ($match_keeper == F_ROW_MATCHES)
@@ -1659,7 +1659,7 @@
                                                else
                                                {
                                                        // NOT A TEST - APPLY 
THE ACTION(S)
-                                                       if ($this->debug > 1) { 
echo 'bofilters.run_single_filter: NOT a Test, *Apply* the Action(s) ; 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br>'; }
+                                                       if ($this->debug > 1) { 
echo 'bofilters.run_single_filter: NOT a Test, *Apply* the Action(s) ; 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br />'; }
                                                        // ACTION: FILEINTO
                                                        if 
($this_filter['actions'][0]['judgement'] == 'fileinto')
                                                        {
@@ -1670,14 +1670,14 @@
                                                                
$to_fldball['folder'] = $target_folder['folder'];
                                                                
$to_fldball['acctnum'] = (int)$target_folder['acctnum'];
                                                                if 
($this->debug > 2) { echo 'bofilters.run_single_filter: $to_fldball 
DUMP:<pre>'; print_r($to_fldball); echo "</pre>\r\n"; }
-                                                               if 
($this->debug > 1) { echo 'bofilters.run_single_filter: pre-move info: 
$mov_msgball [<code>'.serialize($mov_msgball).'</code>]<br>'; }
-                                                               //echo 'EXIT 
NOT READY TO APPLY THE FILTER YET<br>';
+                                                               if 
($this->debug > 1) { echo 'bofilters.run_single_filter: pre-move info: 
$mov_msgball [<code>'.serialize($mov_msgball).'</code>]<br />'; }
+                                                               //echo 'EXIT 
NOT READY TO APPLY THE FILTER YET<br />';
                                                                $good_to_go = 
$GLOBALS['phpgw']->msg->industrial_interacct_mail_move($positive_msgball, 
$to_fldball);

                                                                if 
(!$good_to_go)
                                                                {
                                                                        // ERROR
-                                                                       if 
($this->debug > 1) { echo 'bofilters.run_single_filter: ERROR: 
industrial_interacct_mail_move returns FALSE<br>'; }
+                                                                       if 
($this->debug > 1) { echo 'bofilters.run_single_filter: ERROR: 
industrial_interacct_mail_move returns FALSE<br />'; }
                                                                        return 
False;
                                                                }
                                                                // since we 
acted on this message, since we MOVED this message
@@ -1692,7 +1692,7 @@
                                                        else
                                                        {
                                                                // not yet 
coded action
-                                                               if 
($this->debug > 1) { echo 'bofilters.run_single_filter: actions not yet coded: 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br>'; }
+                                                               if 
($this->debug > 1) { echo 'bofilters.run_single_filter: actions not yet coded: 
$this_filter[actions][0][judgement] : 
['.$this_filter['actions'][0]['judgement'].']<br />'; }
                                                        }
                                                        // POST ACTION STUFF
                                                        // n/a
@@ -1723,8 +1723,8 @@
                        if (($this->just_testing())
                        && (count($this_filter_matching_msgballs) > 0))
                        {
-                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter: Filter Test Run<br>'; }
-                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter: number of matches $this_filter_matching_msgballs 
= ' .count($this_filter_matching_msgballs).'<br>'."\r\n"; }
+                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter: Filter Test Run<br />'; }
+                               if ($this->debug > 1) { echo 
'bofilters.run_single_filter: number of matches $this_filter_matching_msgballs 
= ' .count($this_filter_matching_msgballs).'<br />'."\r\n"; }
                                // make a "fake" folder_info array to make 
things simple for get_msg_list_display
                                $fake_folder_info['is_imap'] = True;
                                $fake_folder_info['folder_checked'] = 'INBOX';
@@ -1744,7 +1744,7 @@
                        // cleanup
                        $this_filter_matching_msgballs = array();

-                       if ($this->debug > 0) { echo 
'bofilters.run_single_filter: LEAVING, return True because we made it to the 
end of the function<br><br><br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.run_single_filter: LEAVING, return True because we made it to the 
end of the function<br /><br /><br />'; }
                        return True;

                }
@@ -1805,7 +1805,7 @@
                */
                function make_imap_search_str($feed_filter)
                {
-                       if ($this->debug > 0) { echo 
'bofilters.make_imap_search_str: ENTERING<br>'; }
+                       if ($this->debug > 0) { echo 
'bofilters.make_imap_search_str: ENTERING<br />'; }
                        if ($this->debug > 2) { echo 
'bofilters.make_imap_search_str: $feed_filter DUMP:<pre>'; 
print_r($feed_filter); echo "</pre>\r\n"; }
                        /*
                        RFC2060:
@@ -1863,7 +1863,7 @@

                        // do we have one search or two, or more
                        $num_search_criteria = count($feed_filter['matches']);
-                       if ($this->debug > 1) { echo 
'bofilters.make_imap_search_str: $num_search_criteria: 
['.$num_search_criteria.']<br>'; }
+                       if ($this->debug > 1) { echo 
'bofilters.make_imap_search_str: $num_search_criteria: 
['.$num_search_criteria.']<br />'; }
                        // 1st search criteria
                        // convert form submitted data into usable IMAP search 
keys
                        $search_key_sieve = 
$feed_filter['matches'][0]['examine'];
@@ -1914,19 +1914,19 @@
                        || ($look_here_imap == ''))
                        {
                                $conv_error = 'invalid or no examine data';
-                               if ($this->debug > 1) { echo '<b> *** 
error</b>: bofilters.make_imap_search_str: error: '.$conv_error."<br> \r\n"; }
+                               if ($this->debug > 1) { echo '<b> *** 
error</b>: bofilters.make_imap_search_str: error: '.$conv_error."<br /> \r\n"; }
                                return '';
                        }
                        elseif ((!isset($for_this))
                        || (trim($for_this) == ''))
                        {
                                $conv_error = 'invalid or no search string 
data';
-                               if ($this->debug > 1) { echo '<b> *** 
error</b>: bofilters.make_imap_search_str: error: '.$conv_error."<br> \r\n"; }
+                               if ($this->debug > 1) { echo '<b> *** 
error</b>: bofilters.make_imap_search_str: error: '.$conv_error."<br /> \r\n"; }
                                return '';
                        }
                        $imap_str = $look_here_imap.' "'.$for_this.'"';
                        */
-                       if ($this->debug > 0) { echo 
'bofilters.make_imap_search_str: LEAVING, $one_line_only: 
['.serialize($one_line_only).'] returning search string: 
<code>'.$final_search_str.'</code><br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 
'bofilters.make_imap_search_str: LEAVING, $one_line_only: 
['.serialize($one_line_only).'] returning search string: 
<code>'.$final_search_str.'</code><br />'."\r\n"; }
                        return $final_search_str;
                }

@@ -2024,7 +2024,7 @@
                        $imap_search_str = $this->make_imap_search_str();
                        if (!$imap_search_str)
                        {
-                               if ($this->debug > 0) { echo '<b> *** 
error</b>: bofilters: do_imap_search: make_imap_search_str returned 
empty<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo '<b> *** 
error</b>: bofilters: do_imap_search: make_imap_search_str returned empty<br 
/>'."\r\n"; }
                                return array();
                        }

@@ -2039,7 +2039,7 @@
                        && ($attempt_reuse == True))
                        {
                                // no not create, we will reuse existing
-                               echo 'bofilters: do_imap_search: reusing 
existing mail_msg object'.'<br>';
+                               echo 'bofilters: do_imap_search: reusing 
existing mail_msg object'.'<br />';
                                // we need to feed the existing object some 
params begin_request uses to re-fill the msg->args[] data
                                $reuse_feed_args = 
$GLOBALS['phpgw']->msg->get_all_args();
                                $args_array = Array();
@@ -2047,7 +2047,7 @@
                                if ((isset($this->filters[0]['source_account']))
                                && ($this->filters[0]['source_account'] != ''))
                                {
-                                       if ($this->debug > 0) { echo 
'bofilters: do_imap_search: this->filters[0][source_account] = ' 
.$this->filters[0]['source_account'].'<br>'."\r\n"; }
+                                       if ($this->debug > 0) { echo 
'bofilters: do_imap_search: this->filters[0][source_account] = ' 
.$this->filters[0]['source_account'].'<br />'."\r\n"; }
                                        $args_array['folder'] = 
$this->filters[0]['source_account'];
                                }
                                else
@@ -2059,14 +2059,14 @@
                        }
                        else
                        {
-                               if ($this->debug_index_data == True) { echo 
'bofilters: do_imap_search: creating new login email.mail_msg, cannot or not 
trying to reusing existing'.'<br>'; }
+                               if ($this->debug_index_data == True) { echo 
'bofilters: do_imap_search: creating new login email.mail_msg, cannot or not 
trying to reusing existing'.'<br />'; }
                                // new login
                                // (1) folder (if specified) - can be left 
empty or unset, mail_msg will then assume INBOX
                                $args_array = Array();
                                if ((isset($this->filters[0]['source_account']))
                                && ($this->filters[0]['source_account'] != ''))
                                {
-                                       if ($this->debug > 0) { echo 
'bofilters: do_imap_search: this->filters[0][source_account] = ' 
.$this->filters[0]['source_account'].'<br>'."\r\n"; }
+                                       if ($this->debug > 0) { echo 
'bofilters: do_imap_search: this->filters[0][source_account] = ' 
.$this->filters[0]['source_account'].'<br />'."\r\n"; }
                                        $args_array['folder'] = 
$this->filters[0]['source_account'];
                                }
                                else
@@ -2081,7 +2081,7 @@
                        //if ((isset($this->filters[0]['source_account']))
                        //&& ($this->filters[0]['source_account'] != ''))
                        //{
-                       //      if ($this->debug > 0) { echo 'bofilters: 
do_imap_search: this->filters[0][source_account] = ' 
.$this->filters[0]['source_account'].'<br>'."\r\n"; }
+                       //      if ($this->debug > 0) { echo 'bofilters: 
do_imap_search: this->filters[0][source_account] = ' 
.$this->filters[0]['source_account'].'<br />'."\r\n"; }
                        //      $args_array['folder'] = 
$this->filters[0]['source_account'];
                        //}
                        //else
@@ -2098,14 +2098,14 @@
                        if (($initial_result_set == False)
                        || (count($initial_result_set) == 0))
                        {
-                               echo 'bofilters: do_imap_search: no hits or 
possible search error<br>'."\r\n";
+                               echo 'bofilters: do_imap_search: no hits or 
possible search error<br />'."\r\n";
                                echo 'bofilters: do_imap_search: 
server_last_error (if any) was: 
"'.$GLOBALS['phpgw']->msg->phpgw_server_last_error().'"'."\r\n";
                                // we leave this->result_set_mlist an an empty 
array, as it was initialized on class creation
                        }
                        else
                        {
                                $this->result_set = $initial_result_set;
-                               if ($this->debug > 0) { echo 'bofilters: 
do_imap_search: number of matches = ' .count($this->result_set).'<br>'."\r\n"; }
+                               if ($this->debug > 0) { echo 'bofilters: 
do_imap_search: number of matches = ' .count($this->result_set).'<br 
/>'."\r\n"; }
                                // make a "fake" folder_info array to make 
things simple for get_msg_list_display
                                $this->fake_folder_info['is_imap'] = True;
                                $this->fake_folder_info['folder_checked'] = 
$GLOBALS['phpgw']->msg->get_arg_value('folder');
@@ -2116,7 +2116,7 @@
                                $this->result_set_mlist = 
$GLOBALS['phpgw']->msg->get_msg_list_display($this->fake_folder_info,$this->result_set);
                        }
                        $GLOBALS['phpgw']->msg->end_request();
-                       //echo 'bofilters: do_imap_search: returned:<br>'; 
var_dump($this->result_set); echo "<br>\r\n";
+                       //echo 'bofilters: do_imap_search: returned:<br />'; 
var_dump($this->result_set); echo "<br />\r\n";
                }
                */


====================================================
Index: email/inc/class.bofolder.inc.php
diff -u email/inc/class.bofolder.inc.php:1.9 
email/inc/class.bofolder.inc.php:1.10
--- email/inc/class.bofolder.inc.php:1.9        Thu Dec 30 23:13:50 2004
+++ email/inc/class.bofolder.inc.php    Sun Mar 13 23:22:43 2005
@@ -39,7 +39,7 @@

                function folder()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.bofolder.folder('.__LINE__.')'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.bofolder.folder('.__LINE__.')'.'<br />'; }
                        // create class objects
                        $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');

@@ -49,25 +49,25 @@

                        // ----  Create or Delete or Rename a Folder ?  ----
                        // "folder_action()" handles checking if any action 
should be taken
-                       if ($this->debug > 1) { echo 
'email.bofolder.folder('.__LINE__.') calling $this->folder_action()'.'<br>'; }
+                       if ($this->debug > 1) { echo 
'email.bofolder.folder('.__LINE__.') calling $this->folder_action()'.'<br />'; }
                        $this->folder_action();


                        // ----  Get a List Of All Folders  AND Display them 
----
-                       if ($this->debug > 1) { echo 
'email.bofolder.folder('.__LINE__.') calling $this->folder_data()'.'<br>'; }
+                       if ($this->debug > 1) { echo 
'email.bofolder.folder('.__LINE__.') calling $this->folder_data()'.'<br />'; }
                        $this->folder_data();

                        // end the email transaction
                        //$GLOBALS['phpgw']->msg->end_request();
                        // NO we may not be really done yet
-                       if ($this->debug > 0) { echo 'LEAVING: 
email.bofolder.folder('.__LINE__.')'.'<br>'; }
+                       if ($this->debug > 0) { echo 'LEAVING: 
email.bofolder.folder('.__LINE__.')'.'<br />'; }
                }



                function folder_action()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.bofolder.folder_action('.__LINE__.')'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.bofolder.folder_action('.__LINE__.')'.'<br />'; }
                        // ----  Create or Delete or Rename a Folder ?  ----
                        if (($GLOBALS['phpgw']->msg->get_arg_value('action') == 
'create')
                        || ($GLOBALS['phpgw']->msg->get_arg_value('action') == 
'delete')
@@ -97,7 +97,7 @@
                                {
                                        $source_fldball = 
$GLOBALS['phpgw']->msg->get_arg_value('source_fldball');
                                        $target_fldball = 
$GLOBALS['phpgw']->msg->get_arg_value('target_fldball');
-                                       if ($this->debug > 1) { echo 
'email.bofolder.folder_action('.__LINE__.'): we will delete, rename, or create 
a folder; ->msg->get_arg_value("action") is 
['.$GLOBALS['phpgw']->msg->get_arg_value('action').']'.'<br>'; }
+                                       if ($this->debug > 1) { echo 
'email.bofolder.folder_action('.__LINE__.'): we will delete, rename, or create 
a folder; ->msg->get_arg_value("action") is 
['.$GLOBALS['phpgw']->msg->get_arg_value('action').']'.'<br />'; }
                                        if ($this->debug > 2) { echo 
'email.bofolder.folder_action('.__LINE__.'): $source_fldball DUMP<pre>'; 
print_r($source_fldball); echo '<pre>'; }
                                        if ($this->debug > 2) { echo 
'email.bofolder.folder_action('.__LINE__.'): $target_fldball DUMP<pre>'; 
print_r($target_fldball); echo '<pre>'; }

@@ -232,22 +232,22 @@
                                        {
                                                $action_report =
                                                        
'<em>'.$GLOBALS['phpgw']->msg->get_arg_value('action') .' 
'.lang('folder').'</em>'
-                                                       .'<br>'
+                                                       .'<br />'
                                                        
.htmlspecialchars($source_folder_decoded)
-                                                       .'<br>'
+                                                       .'<br />'
                                                        
.'<em>'.lang('to').'</em>'
-                                                       .'<br>'
+                                                       .'<br />'
                                                        
.htmlspecialchars($target_folder_decoded)
-                                                       .'<br>'
+                                                       .'<br />'
                                                        .lang('result').' : ';
                                        }
                                        else
                                        {
                                                $action_report =
                                                        
'<em>'.$GLOBALS['phpgw']->msg->get_arg_value('action').' 
'.lang('folder').'</em>'
-                                                       .'<br>'
+                                                       .'<br />'
                                                        
.htmlspecialchars($target_folder_decoded)
-                                                       .'<br>'
+                                                       .'<br />'
                                                        .lang('result').' : ';
                                        }
                                        // did it work or not
@@ -282,14 +282,14 @@
                        // we may have been  called externally, return this 
action report
                        //return $action_report;
                        // we may have been  called externally, return if we 
succeeded or not
-                       if ($this->debug > 0) { echo 'LEAVING: 
email.bofolder.folder_action('.__LINE__.'), returning $success 
['.serialize($success).'], only matters if folder action was attempted'.'<br>'; 
}
+                       if ($this->debug > 0) { echo 'LEAVING: 
email.bofolder.folder_action('.__LINE__.'), returning $success 
['.serialize($success).'], only matters if folder action was attempted'.'<br 
/>'; }
                        return $success;
                }


                function folder_data()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.bofolder.folder_data('.__LINE__.')'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.bofolder.folder_data('.__LINE__.')'.'<br />'; }
                        //  ----  Establish Email Server Connectivity 
Conventions  ----
                        $server_str = 
$GLOBALS['phpgw']->msg->get_arg_value('mailsvr_callstr');
                        $name_space = 
$GLOBALS['phpgw']->msg->get_arg_value('mailsvr_namespace');
@@ -301,7 +301,7 @@
                        //$folder_list =& 
$GLOBALS['phpgw']->msg->get_arg_value_ref('folder_list');

                        if ($this->debug > 2) { echo 
'email.bofolder.folder_data('.__LINE__.'): $folder_list[] dump:<pre>'; 
print_r($folder_list); echo '</pre>'; }
-                       if ($this->debug > 1) { echo 
'email.bofolder.folder_data('.__LINE__.') USE CACHABLE? 
$this->use_cachable_status is 
['.serialize($this->use_cachable_status).']'.'<br>'; }
+                       if ($this->debug > 1) { echo 
'email.bofolder.folder_data('.__LINE__.') USE CACHABLE? 
$this->use_cachable_status is ['.serialize($this->use_cachable_status).']'.'<br 
/>'; }

                        $this->xi['folder_list_display'] = array();
                        for ($i=0; $i<count($folder_list);$i++)
@@ -328,7 +328,7 @@
                                //$real_long_name = 
$GLOBALS['phpgw']->msg->folder_lookup('',$folder_list[$i]['folder_short']);
                                //if ($real_long_name != '')
                                //{
-                               //      echo 'folder exists, official long 
name: '.$real_long_name.'<br>';
+                               //      echo 'folder exists, official long 
name: '.$real_long_name.'<br />';
                                //}

                                // ROW BACK COLOR
@@ -451,7 +451,7 @@
                        $this->xi['the_font'] = 
$GLOBALS['phpgw_info']['theme']['font'];
                        $this->xi['th_backcolor'] = 
$GLOBALS['phpgw_info']['theme']['th_bg'];

-                       if ($this->debug > 0) { echo 'LEAVING: 
email.bofolder.folder_data('.__LINE__.')'.'<br>'; }
+                       if ($this->debug > 0) { echo 'LEAVING: 
email.bofolder.folder_data('.__LINE__.')'.'<br />'; }
                }

        }

====================================================
Index: email/inc/class.html_widgets.inc.php
diff -u email/inc/class.html_widgets.inc.php:1.4 
email/inc/class.html_widgets.inc.php:1.5
--- email/inc/class.html_widgets.inc.php:1.4    Thu Dec 30 23:13:50 2004
+++ email/inc/class.html_widgets.inc.php        Sun Mar 13 23:22:44 2005
@@ -137,7 +137,7 @@
                
\**************************************************************************/
                function html_widgets()
                {
-                       if ($this->debug_init > 0) { echo 'ENTER: 
email.html_widgets.CONSTRUCTOR'.'<br>'."\r\n"; }
+                       if ($this->debug_init > 0) { echo 'ENTER: 
email.html_widgets.CONSTRUCTOR'.'<br />'."\r\n"; }
                        /*!
                        @class requires including spell_struct header file
                        @discussion  class html_widgets needs the special 
C-Style Include .h like file,
@@ -153,7 +153,7 @@
                        
//require_once(PHPGW_INCLUDE_ROOT.'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/inc/class.'.$required_class.'.inc.php');
                        
require_once(PHPGW_INCLUDE_ROOT.'/'.$this->my_currentapp.'/inc/class.'.$required_class.'.inc.php');

-                       if ($this->debug_init > 0) { echo 'EXIT: 
email.html_widgets.CONSTRUCTOR'.'<br>'."\r\n"; }
+                       if ($this->debug_init > 0) { echo 'EXIT: 
email.html_widgets.CONSTRUCTOR'.'<br />'."\r\n"; }
                        return;
                }

@@ -998,7 +998,7 @@
                                        //Check for folder support and create 
Folder Button
                                        if ($has_folders == True)
                                        {
-                                               
//$this->set_href_clickme($this->img_maketag($image_dir.'/'.$icon_theme.'-folder-'.$icon_size.'.gif',lang('Folders'),'','','0'));
+                                               
//$this->set_href_clickme($this->img_maketag($image_dir.'/'.$icon_theme.'-folder-'.$icon_size.'.png',lang('Folders'),'','','0'));
                                                
//$this->tpl->set_var('folders_img_link', $this->get_href());
                                                //Create Folder Text Link
                                                
$this->set_href_link($folders_link);
@@ -1020,7 +1020,7 @@
                                        $this->tpl->set_var('compose_txt_link', 
'&nbsp;');
                                        //Create Search Button
                                        $this->set_href_link($search_link);
-                                       
//$this->set_href_clickme($this->img_maketag($image_dir.'/'.$icon_theme.'-search-16.gif',lang('Search'),'','','0'));
+                                       
//$this->set_href_clickme($this->img_maketag($image_dir.'/'.$icon_theme.'-search-16.png',lang('Search'),'','','0'));
                                        // will fix this later when new images 
are made
                                        
$this->set_href_clickme($this->img_maketag($GLOBALS['phpgw']->msg->_image_on('email',$icon_theme.'/search-'.$icon_size,'_on'),lang('Search'),'','','0'));
                                        $this->tpl->set_var('search_img_link', 
$this->get_href());
@@ -1066,7 +1066,7 @@
                                        $this->tpl->set_var('compose_txt_link', 
$this->get_href());
                                        //Create Search Button
                                        $this->set_href_link($search_link);
-                                       
//$this->set_href_clickme($this->img_maketag($image_dir.'/'.$icon_theme.'-search-16.gif',lang('Search'),'','','0'));
+                                       
//$this->set_href_clickme($this->img_maketag($image_dir.'/'.$icon_theme.'-search-16.png',lang('Search'),'','','0'));
                                        // will fix this later when new images 
are made
                                        
$this->set_href_clickme($this->img_maketag($GLOBALS['phpgw']->msg->_image_on('email',$icon_theme.'/search-'.$icon_size,'_on'),lang('Search'),'','','0'));
                                        $this->tpl->set_var('search_img_link', 
$this->get_href());
@@ -1426,7 +1426,7 @@
                        $debug_mega_listbox = 0;
                        //$debug_mega_listbox = 3;

-                       if ($debug_mega_listbox > 0) { echo 
'folders_mega_listbox('.__LINE__.'): ENTERING<br>'; }
+                       if ($debug_mega_listbox > 0) { echo 
'folders_mega_listbox('.__LINE__.'): ENTERING<br />'; }

                        $this->new_combobox();
                        $this->set_cbox_name($this->F_megalist_widget_name);
@@ -1452,12 +1452,12 @@
                                if ($this_status != 'enabled')
                                {
                                        // Do Nothing, This account is not in 
use
-                                       if ($debug_mega_listbox > 1) { echo 
'folders_mega_listbox('.__LINE__.'): $this_acctnum ['.$this_acctnum.'] is not 
in use, so skip folderlist<br>'; }
+                                       if ($debug_mega_listbox > 1) { echo 
'folders_mega_listbox('.__LINE__.'): $this_acctnum ['.$this_acctnum.'] is not 
in use, so skip folderlist<br />'; }
                                }
                                else
                                {
                                        $folder_list = 
$GLOBALS['phpgw']->msg->get_arg_value('folder_list', $this_acctnum);
-                                       if ($debug_mega_listbox > 1) { echo 
'folders_mega_listbox('.__LINE__.'): $this_acctnum ['.$this_acctnum.'] IS 
enabled, got folder list<br>'; }
+                                       if ($debug_mega_listbox > 1) { echo 
'folders_mega_listbox('.__LINE__.'): $this_acctnum ['.$this_acctnum.'] IS 
enabled, got folder list<br />'; }
                                        if ($debug_mega_listbox > 2) { echo 
'folders_mega_listbox('.__LINE__.'): $folder_list for $this_acctnum 
['.$this_acctnum.'] DUMP<pre>'; print_r($folder_list); echo '</pre>'; }

                                        // iterate thru the folder list for 
this acctnum
@@ -1475,7 +1475,7 @@
                                                && ($folder_acctnum == 
$this->F_megalist_skip_fldball['acctnum']))
                                                {
                                                        // Do Nothing, this 
folder should not be included
-                                                       if ($debug_mega_listbox 
> 1) { echo 'folders_mega_listbox('.__LINE__.'): skipping 
$this->F_megalist_skip_fldball 
['.htmlspecialchars(serialize($this->F_megalist_skip_fldball)).'] has been 
matched<br>'; }
+                                                       if ($debug_mega_listbox 
> 1) { echo 'folders_mega_listbox('.__LINE__.'): skipping 
$this->F_megalist_skip_fldball 
['.htmlspecialchars(serialize($this->F_megalist_skip_fldball)).'] has been 
matched<br />'; }
                                                }
                                                else
                                                {
@@ -1519,7 +1519,7 @@
                                        }
                                }
                        }
-                       if ($debug_mega_listbox > 0) { echo 
'folders_mega_listbox('.__LINE__.'): LEAVING<br>'; }
+                       if ($debug_mega_listbox > 0) { echo 
'folders_mega_listbox('.__LINE__.'): LEAVING<br />'; }
                        return $this->get_combobox();
                }

@@ -1893,7 +1893,7 @@
                        }

                        $geek_bar =
-                       '<br>
+                       '<br />
                        <table border="0" cellpadding="4" cellspacing="0" 
width="100%" align="center">
                        <tr bgcolor="'.$row_on.'" class="row_on">
                                <td width="100%" align="left">'."\r\n"

====================================================
Index: email/inc/class.mail_dcom.inc.php
diff -u email/inc/class.mail_dcom.inc.php:1.11 
email/inc/class.mail_dcom.inc.php:1.12
--- email/inc/class.mail_dcom.inc.php:1.11      Thu Dec 30 23:13:50 2004
+++ email/inc/class.mail_dcom.inc.php   Sun Mar 13 23:22:44 2005
@@ -46,13 +46,13 @@
        )
        {
                $mail_server_type = $p1;
-               if ($debug_dcom) { echo 'DCOM DEBUG: found class feed arg $p1 
['.serialize($p1).']<br>'; }
-               //{ echo 'DCOM DEBUG: found class feed arg $p1 
['.serialize($p1).']<br>'; }
+               if ($debug_dcom) { echo 'DCOM DEBUG: found class feed arg $p1 
['.serialize($p1).']<br />'; }
+               //{ echo 'DCOM DEBUG: found class feed arg $p1 
['.serialize($p1).']<br />'; }
        }
        else
        {
-               if ($debug_dcom) { echo 'DCOM DEBUG: did NOT find class feed 
arg $p1 ['.serialize($p1).']<br>'; }
-               //{ echo 'DCOM DEBUG: did NOT find class feed arg $p1 
['.serialize($p1).']<br>'; }
+               if ($debug_dcom) { echo 'DCOM DEBUG: did NOT find class feed 
arg $p1 ['.serialize($p1).']<br />'; }
+               //{ echo 'DCOM DEBUG: did NOT find class feed arg $p1 
['.serialize($p1).']<br />'; }
                $mail_server_type = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server_type'];
        }

@@ -68,60 +68,60 @@
        {
                $imap_builtin = False;
                $sock_fname = '_sock';
-               if ($debug_dcom) { echo 'DCOM DEBUG: force socket class for 
$mail_server_type ['.$mail_server_type.']<br>'; }
+               if ($debug_dcom) { echo 'DCOM DEBUG: force socket class for 
$mail_server_type ['.$mail_server_type.']<br />'; }
        }
        elseif (extension_loaded('imap') && function_exists('imap_open'))
        {
                $imap_builtin = True;
                $sock_fname = '';
-               if ($debug_dcom) { echo 'imap builtin extension is 
available<br>'; }
+               if ($debug_dcom) { echo 'imap builtin extension is available<br 
/>'; }
        }
        else
        {
                $imap_builtin = False;
                $sock_fname = '_sock';
-               if ($debug_dcom) { echo 'imap builtin extension NOT available, 
using socket class<br>'; }
+               if ($debug_dcom) { echo 'imap builtin extension NOT available, 
using socket class<br />'; }
        }

        /* -----  include SOCKET or PHP-BUILTIN classes as necessary */
        if ($imap_builtin == False)
        {
                CreateObject('phpgwapi.network');
-               if ($debug_dcom) { echo 'created phpgwapi network class used 
with sockets<br>'; }
+               if ($debug_dcom) { echo 'created phpgwapi network class used 
with sockets<br />'; }
        }

        //CreateObject('email.mail_dcom_base'.$sock_fname);
        
include(PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_base'.$sock_fname.'.inc.php');
-       if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_base'.$sock_fname.'.inc.php<br>';
 }
+       if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_base'.$sock_fname.'.inc.php<br
 />'; }

        if (($mail_server_type == 'imap')
        || ($mail_server_type == 'imaps'))
         {
                
include(PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_imap'.$sock_fname.'.inc.php');
-               if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_imap'.$sock_fname.'.inc.php<br>';
 }
+               if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_imap'.$sock_fname.'.inc.php<br
 />'; }
        }
        elseif (($mail_server_type == 'pop3')
        || ($mail_server_type == 'pop3s'))
        {
                
include(PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_pop3'.$sock_fname.'.inc.php');
-               if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_pop3'.$sock_fname.'.inc.php<br>';
 }
+               if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_pop3'.$sock_fname.'.inc.php<br
 />'; }
        }
        elseif ($mail_server_type == 'nntp')
        {
                
include(PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_nntp'.$sock_fname.'.inc.php');
-               if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_nntp'.$sock_fname.'.inc.php<br>';
 }
+               if ($debug_dcom) { echo 'including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_nntp'.$sock_fname.'.inc.php<br
 />'; }
        }
        elseif ((isset($mail_server_type))
        && ($mail_server_type != ''))
        {
                /* educated guess based on info being available: */
                
include(PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_'.$GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server_type'].$sock_fname.'.inc.php');
-               if ($debug_dcom) { echo 'Educated Guess: including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_'.$GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server_type'].$sock_fname.'.inc.php<br>';
 }
+               if ($debug_dcom) { echo 'Educated Guess: including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_'.$GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server_type'].$sock_fname.'.inc.php<br
 />'; }
        }
        else
        {
                /* DEFAULT FALL BACK: */
                
include(PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_imap.inc.php');
-               if ($debug_dcom) { echo 'NO INFO DEFAULT: including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_imap.inc.php<br>'; }
+               if ($debug_dcom) { echo 'NO INFO DEFAULT: including 
:'.PHPGW_INCLUDE_ROOT.'/email/inc/class.mail_dcom_imap.inc.php<br />'; }
        }
 ?>

====================================================
Index: email/inc/class.mail_dcom_nntp.inc.php
diff -u email/inc/class.mail_dcom_nntp.inc.php:1.5 
email/inc/class.mail_dcom_nntp.inc.php:1.6
--- email/inc/class.mail_dcom_nntp.inc.php:1.5  Thu Dec 30 23:13:50 2004
+++ email/inc/class.mail_dcom_nntp.inc.php      Sun Mar 13 23:22:44 2005
@@ -159,7 +159,7 @@
                        $debug_logins = False;
                        if($debug_logins)
                        {
-                               echo 'CALL TO LOGIN IN CLASS MSG 
POP3'.'<br>'.'userid='.$GLOBALS['phpgw_info']['user']['preferences']['email']['userid'];
+                               echo 'CALL TO LOGIN IN CLASS MSG POP3'.'<br 
/>'.'userid='.$GLOBALS['phpgw_info']['user']['preferences']['email']['userid'];
                        }

                        error_reporting(error_reporting() - 2);

====================================================
Index: email/inc/class.mail_dcom_nntp_sock.inc.php
diff -u email/inc/class.mail_dcom_nntp_sock.inc.php:1.5 
email/inc/class.mail_dcom_nntp_sock.inc.php:1.6
--- email/inc/class.mail_dcom_nntp_sock.inc.php:1.5     Fri Mar 14 04:00:55 2003
+++ email/inc/class.mail_dcom_nntp_sock.inc.php Sun Mar 13 23:22:44 2005
@@ -83,7 +83,7 @@
                $this->num_msgs = $this->num_msg($this->mailbox);
                $this->start_msg = $this->first_message($this->mailbox);
                $this->end_msg = $this->last_message($this->mailbox);
-               echo 'Successful connection to '.$this->mailbox."<br>\n";
+               echo 'Successful connection to '.$this->mailbox."<br />\n";
        }

        function fix_folder($folder='')
@@ -315,7 +315,7 @@
                while(list($key,$value) = each($field_list))
                {
                        $return_array[] = $key;
-                       echo '('.$i++.') Field: <b>'.$value."</b>\t\tMsg Num: 
<b>".$key."</b><br>\n";
+                       echo '('.$i++.') Field: <b>'.$value."</b>\t\tMsg Num: 
<b>".$key."</b><br />\n";
                }
                @reset($return_array);
                return $return_array;

====================================================
Index: email/inc/class.mail_dcom_imap_sock.inc.php
diff -u email/inc/class.mail_dcom_imap_sock.inc.php:1.16 
email/inc/class.mail_dcom_imap_sock.inc.php:1.17
--- email/inc/class.mail_dcom_imap_sock.inc.php:1.16    Thu Dec 30 23:13:50 2004
+++ email/inc/class.mail_dcom_imap_sock.inc.php Sun Mar 13 23:22:44 2005
@@ -45,7 +45,7 @@
                */
                function mail_dcom()
                {
-                       echo "<br>\n" . lang('php-imap support not installed - 
exiting') . "<br>\n";
+                       echo "<br />\n" . lang('php-imap support not installed 
- exiting') . "<br />\n";
                        echo lang('contact your system administrator');
                        exit;
                }
@@ -249,15 +249,15 @@
                */
                function report_svr_data($data_array, $calling_func_name='', 
$show_ok_msg=True)
                {
-                       echo 'imap: '.$calling_func_name.': response_array line 
by line:<br>';
+                       echo 'imap: '.$calling_func_name.': response_array line 
by line:<br />';
                        for ($i=0; $i<count($data_array); $i++)
                        {
-                               echo ' -- ArrayPos['.$i.'] data: ' 
.htmlspecialchars($data_array[$i]) .'<br>';
+                               echo ' -- ArrayPos['.$i.'] data: ' 
.htmlspecialchars($data_array[$i]) .'<br />';
                        }
-                       echo 'imap: '.$calling_func_name.': =ENDS= 
response_array line by line:<br>';
+                       echo 'imap: '.$calling_func_name.': =ENDS= 
response_array line by line:<br />';
                        if ($show_ok_msg == True)
                        {
-                               echo 'imap: '.$calling_func_name.': last server 
completion line: "'.htmlspecialchars($this->server_last_ok_response).'"<br>';
+                               echo 'imap: '.$calling_func_name.': last server 
completion line: "'.htmlspecialchars($this->server_last_ok_response).'"<br />';
                        }
                }

@@ -271,7 +271,7 @@
                */
                function server_last_error()
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
server_last_error<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
server_last_error<br />'; }
                        return $this->server_last_error_str;
                }

@@ -286,7 +286,7 @@
                function createmailbox($stream,$mailbox)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: createmailbox<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: createmailbox<br />'; }
                        // eventually this will use this function to call for 
expiration of stale cached data, if any
                        //$this->folder_list_did_change();
                        return true;
@@ -298,7 +298,7 @@
                function deletemailbox($stream,$mailbox)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: deletemailbox<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: deletemailbox<br />'; }
                        // eventually this will use this function to call for 
expiration of stale cached data, if any
                        //$this->folder_list_did_change();
                        return true;
@@ -310,7 +310,7 @@
                function renamemailbox($stream,$mailbox_old,$mailbox_new)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: renamemailbox<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: renamemailbox<br />'; }
                        // eventually this will use this function to call for 
expiration of stale cached data, if any
                        //$this->folder_list_did_change();
                        return true;
@@ -323,7 +323,7 @@
                function expunge($stream)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: expunge<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: expunge<br />'; }
                        return true;
                }
                /*!
@@ -333,7 +333,7 @@
                function mailcopy($stream,$msg_list,$mailbox,$flags)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: mailcopy<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: mailcopy<br />'; }
                        return False;
                }
                /*!
@@ -343,7 +343,7 @@
                function mail_move($stream,$msg_list,$mailbox)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: mail_move<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: mail_move<br />'; }
                        return False;
                }
                /*!
@@ -353,7 +353,7 @@
                function noop_ping_test($stream)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: noop_ping_test<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: call to 
unimplemented socket function: noop_ping_test<br />'; }
                        return False;
                }
                /*!
@@ -363,7 +363,7 @@
                function append($stream, $folder = "Sent", $header, $body, 
$flags = "")
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: append NOT 
YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: append NOT 
YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }
                /*!
@@ -373,7 +373,7 @@
                function fetch_overview($stream_notused,$criteria,$flags)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: 
fetch_overview NOT YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: 
fetch_overview NOT YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }
                /*
@@ -417,7 +417,7 @@
                {
                        $empty_return=array();
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'imap: search NOT 
YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: search NOT 
YET IMPLEMENTED imap sockets function<br />'; }
                        return $empty_return;
                }

@@ -447,7 +447,7 @@
                */
                function open ($fq_folder, $user, $pass, $flags='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
open<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
open<br />'; }

                        // fq_folder is a "fully qualified folder", seperate 
the parts:
                        $svr_data = array();
@@ -455,34 +455,34 @@
                        $folder = $svr_data['folder'];
                        $server = $svr_data['server'];
                        $port = $svr_data['port'];
-                       if ($this->debug_dcom >= 1) { echo 'imap: open: 
svr_data:<br>'.serialize($svr_data).'<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: open: 
svr_data:<br />'.serialize($svr_data).'<br />'; }

                        if (!$this->open_port($server,$port,15))
                        {
-                               echo '<p><center><b>' .lang('There was an error 
trying to connect to your IMAP server.<br>Please contact your admin to check 
the servername, username or password.') .'</b></center>';
+                               echo '<p><center><b>' .lang('There was an error 
trying to connect to your IMAP server.<br />Please contact your admin to check 
the servername, username or password.') .'</b></center>';
                                echo('<CENTER><A 
HREF="'.$GLOBALS['phpgw']->link('/home.php').'">'.lang('Click here to 
continue').'...</A></CENTER>'); //cbsman
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
                        else
                        {
                                $junk = $this->read_port();
-                               if ($this->debug_dcom >= 2) { echo 'imap: open: 
open port server hello: "' .htmlspecialchars($this->show_crlf($junk)) .'"<br>'; 
}
+                               if ($this->debug_dcom >= 2) { echo 'imap: open: 
open port server hello: "' .htmlspecialchars($this->show_crlf($junk)) .'"<br 
/>'; }
                        }


-                       if ($this->debug_dcom >= 2) { echo 'imap: open: user 
and pass NO quotemeta: user ['. htmlspecialchars($user).'] pass 
['.htmlspecialchars($pass).']<br>'; }
-                       if ($this->debug_dcom >= 2) { echo 'imap: open: user 
and pass WITH quotemeta: user ['. htmlspecialchars(quotemeta($user)).'] pass 
['.htmlspecialchars(quotemeta($pass)).']<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: open: user 
and pass NO quotemeta: user ['. htmlspecialchars($user).'] pass 
['.htmlspecialchars($pass).']<br />'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: open: user 
and pass WITH quotemeta: user ['. htmlspecialchars(quotemeta($user)).'] pass 
['.htmlspecialchars(quotemeta($pass)).']<br />'; }

                        $cmd_tag = 'L001';
                        $full_command = $cmd_tag.' LOGIN "'.$user.'" 
"'.$pass.'"';
                        $expecting = $cmd_tag; // may be followed by OK, NO, or 
BAD

-                       if ($this->debug_dcom >= 2) { echo 'imap: open: 
write_port: '. htmlspecialchars($full_command) .'<br>'; }
-                       if ($this->debug_dcom >= 2) { echo 'imap: open: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or 
BAD<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: open: 
write_port: '. htmlspecialchars($full_command) .'<br />'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: open: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or BAD<br 
/>'; }

                        if(!$this->write_port($full_command))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'imap: open: 
LEAVING with error: could not write_port<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: open: 
LEAVING with error: could not write_port<br />'; }
                                $this->error();
                                // does $this->error() ever continue onto next 
line?
                                return False;
@@ -496,27 +496,27 @@
                        {
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'imap: open: error in Open<br>';
-                                       echo 'imap: open: last recorded 
error:<br>';
-                                       echo  $this->server_last_error().'<br>';
+                                       echo 'imap: open: error in Open<br />';
+                                       echo 'imap: open: last recorded 
error:<br />';
+                                       echo  $this->server_last_error().'<br 
/>';
                                }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING Open with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING Open with error<br />'; }
                                return False;
                        }
                        else
                        {
                                if ($this->debug_dcom >= 2) { 
$this->report_svr_data($response_array, 'open', True); }
-                               if ($this->debug_dcom >= 1) { echo 'imap: open: 
Successful IMAP Login<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: open: 
Successful IMAP Login<br />'; }
                        }

                        // now that we have logged in, php's IMAP_OPEN would 
now select the desired folder
-                       if ($this->debug_dcom >= 2) { echo 'imap: open: php 
IMAP_OPEN would now select desired folder: "'. htmlspecialchars($folder) 
.'"<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: open: php 
IMAP_OPEN would now select desired folder: "'. htmlspecialchars($folder) .'"<br 
/>'; }
                        // php's IMAP_OPEN also selects the desired folder 
(mailbox) after the connection is established
                        if($folder != '')
                        {
                                $this->reopen('',$fq_folder);
                        }
-                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
open<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
open<br />'; }
                        return $this->socket;
                }

@@ -527,18 +527,18 @@
                */
                function close($flags="")
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
Close<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
Close<br />'; }

                        $cmd_tag = 'c001';
                        $full_command = $cmd_tag.' LOGOUT';
                        $expecting = $cmd_tag; // may be followed by OK, NO, or 
BAD

-                       if ($this->debug_dcom >= 2) { echo 'imap: close: 
write_port: "'. htmlspecialchars($full_command) .'"<br>'; }
-                       if ($this->debug_dcom >= 2) { echo 'imap: close: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or 
BAD<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: close: 
write_port: "'. htmlspecialchars($full_command) .'"<br />'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: close: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or BAD<br 
/>'; }

                        if(!$this->write_port($full_command))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
close: LEAVING with error: could not write_port<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
close: LEAVING with error: could not write_port<br />'; }
                                $this->error();
                        }

@@ -551,17 +551,17 @@
                        {
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'imap: close: error in Close<br>';
-                                       echo 'imap: close: last recorded 
error:<br>';
-                                       echo  $this->server_last_error().'<br>';
+                                       echo 'imap: close: error in Close<br 
/>';
+                                       echo 'imap: close: last recorded 
error:<br />';
+                                       echo  $this->server_last_error().'<br 
/>';
                                }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
Leaving Close with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
Leaving Close with error<br />'; }
                                return False;
                        }
                        else
                        {
                                if ($this->debug_dcom >= 2) { 
$this->report_svr_data($response_array, 'close', True); }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING Close<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING Close<br />'; }
                                return True;
                        }
                }
@@ -579,24 +579,24 @@
                */
                function reopen($stream_notused, $fq_folder, $flags='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
reopen<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
reopen<br />'; }

                        // fq_folder is a "fully qualified folder", seperate 
the parts:
                        $svr_data = array();
                        $svr_data = $this->distill_fq_folder($fq_folder);
                        $folder = $svr_data['folder'];
-                       if ($this->debug_dcom >= 1) { echo 'imap: reopen: 
folder value is: ['.$folder.']<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: reopen: 
folder value is: ['.$folder.']<br />'; }

                        $cmd_tag = 'r001';
                        $full_command = $cmd_tag.' SELECT "'.$folder.'"';
                        $expecting = $cmd_tag; // may be followed by OK, NO, or 
BAD

-                       if ($this->debug_dcom >= 2) { echo 'imap: reopen: 
write_port: "'. htmlspecialchars($full_command) .'"<br>'; }
-                       if ($this->debug_dcom >= 2) { echo 'imap: reopen: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or 
BAD<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: reopen: 
write_port: "'. htmlspecialchars($full_command) .'"<br />'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: reopen: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or BAD<br 
/>'; }

                        if(!$this->write_port($full_command))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
reopen: could not write_port<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
reopen: could not write_port<br />'; }
                                $this->error();
                        }

@@ -608,17 +608,17 @@
                        {
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'imap: reopen: error in 
reopen<br>';
-                                       echo 'imap: reopen: last recorded 
error:<br>';
-                                       echo  $this->server_last_error().'<br>';
+                                       echo 'imap: reopen: error in reopen<br 
/>';
+                                       echo 'imap: reopen: last recorded 
error:<br />';
+                                       echo  $this->server_last_error().'<br 
/>';
                                }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING reopen with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING reopen with error<br />'; }
                                return False;
                        }
                        else
                        {
                                if ($this->debug_dcom >= 2) { 
$this->report_svr_data($response_array, 'reopen', True); }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING reopen<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING reopen<br />'; }
                                return True;
                        }
                }
@@ -655,7 +655,7 @@
                */
                function listmailbox($stream_notused,$server_str,$pattern)
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
listmailbox<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
listmailbox<br />'; }
                        $mailboxes_array = Array();

                        // prepare params, seperate wildcards "*" or "%" from 
param $pattern
@@ -694,12 +694,12 @@
                        $full_command = $cmd_tag.' LIST '.$list_params;
                        $expecting = $cmd_tag; // may be followed by OK, NO, or 
BAD

-                       if ($this->debug_dcom >= 2) { echo 'imap: listmailbox: 
write_port: ['. htmlspecialchars($full_command) .']<br>'; }
-                       if ($this->debug_dcom >= 2) { echo 'imap: listmailbox: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or 
BAD<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: listmailbox: 
write_port: ['. htmlspecialchars($full_command) .']<br />'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: listmailbox: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or BAD<br 
/>'; }

                        if(!$this->write_port($full_command))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
listmailbox: could not write_port<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
listmailbox: could not write_port<br />'; }
                                $this->error();
                        }

@@ -711,11 +711,11 @@
                        {
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'imap: listmailbox: error in 
listmailbox<br>';
-                                       echo 'imap: listmailbox: last recorded 
error:<br>';
-                                       echo  $this->server_last_error().'<br>';
+                                       echo 'imap: listmailbox: error in 
listmailbox<br />';
+                                       echo 'imap: listmailbox: last recorded 
error:<br />';
+                                       echo  $this->server_last_error().'<br 
/>';
                                }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
Leaving listmailbox with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
Leaving listmailbox with error<br />'; }
                                return False;
                        }
                        else
@@ -755,7 +755,7 @@
                        }

                        if ($this->debug_dcom >= 2) { 
$this->report_svr_data($mailboxes_array, 'listmailbox 
INTERNAL_mailboxes_array', False); }
-                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
listmailbox<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
listmailbox<br />'; }
                        //return '';
                        return $mailboxes_array;
                }
@@ -771,7 +771,7 @@
                */
                function mailboxmsginfo($stream_notused='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: 
mailboxmsginfo NOT YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: 
mailboxmsginfo NOT YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }

@@ -841,7 +841,7 @@
                */
                function status($stream_notused='', 
$fq_folder='',$options=SA_ALL)
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
status<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
status<br />'; }

                        // fq_folder is a "fully qualified folder", seperate 
the parts:
                        $svr_data = array();
@@ -871,12 +871,12 @@
                        $full_command = $cmd_tag.' STATUS 
"'.$svr_data['folder'].'" ('.$query_str.')';
                        $expecting = $cmd_tag; // may be followed by OK, NO, or 
BAD

-                       if ($this->debug_dcom >= 2) { echo 'imap: status: 
write_port: "'. htmlspecialchars($full_command) .'"<br>'; }
-                       if ($this->debug_dcom >= 2) { echo 'imap: status: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or 
BAD<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: status: 
write_port: "'. htmlspecialchars($full_command) .'"<br />'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: status: 
expecting: "'. htmlspecialchars($expecting) .'" followed by OK, NO, or BAD<br 
/>'; }

                        if(!$this->write_port($full_command))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
status: LEAVING with error: could not write_port<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
status: LEAVING with error: could not write_port<br />'; }
                                $this->error();
                                return False;
                        }
@@ -890,11 +890,11 @@
                        {
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'imap: status: error in 
status<br>';
-                                       echo 'imap: status: last recorded 
error:<br>';
-                                       echo  $this->server_last_error().'<br>';
+                                       echo 'imap: status: error in status<br 
/>';
+                                       echo 'imap: status: last recorded 
error:<br />';
+                                       echo  $this->server_last_error().'<br 
/>';
                                }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING status with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING status with error<br />'; }
                                return False;
                        }

@@ -905,11 +905,11 @@
                        //{
                        //      if ($this->debug_dcom >= 2)
                        //      {
-                       //              echo 'imap: status: error in status, 
more than (one) TWO lines (for buggy uwash servers) line server response, not 
normal<br>';
-                       //              echo 'imap: status: last recorded 
error:<br>';
-                       //              echo  $this->server_last_error().'<br>';
+                       //              echo 'imap: status: error in status, 
more than (one) TWO lines (for buggy uwash servers) line server response, not 
normal<br />';
+                       //              echo 'imap: status: last recorded 
error:<br />';
+                       //              echo  $this->server_last_error().'<br 
/>';
                        //      }
-                       //      if ($this->debug_dcom >= 1) { echo 'imap: 
Leaving status with error<br>'; }
+                       //      if ($this->debug_dcom >= 1) { echo 'imap: 
Leaving status with error<br />'; }
                        //      return False;
                        //}

@@ -936,11 +936,11 @@
                        {
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'imap: status: error in status, 
$response_line_of_data does not have "* STATUS" so it is not valid data<br>';
-                                       echo 'imap: status: last recorded 
error:<br>';
-                                       echo  $this->server_last_error().'<br>';
+                                       echo 'imap: status: error in status, 
$response_line_of_data does not have "* STATUS" so it is not valid data<br />';
+                                       echo 'imap: status: last recorded 
error:<br />';
+                                       echo  $this->server_last_error().'<br 
/>';
                                }
-                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING status with error at '.__LINE__.'<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'imap: 
LEAVING status with error at '.__LINE__.'<br />'; }
                                return False;
                        }

@@ -1006,7 +1006,7 @@
                        // so L1 class var cache it so "sort" does not have to 
call this function if it has ALREADY been run
                        $this->mailbox_status = $info;
                        if ($this->debug_dcom >= 2) { echo 'imap: status: L1 
class var caching: $this->mailbox_status DUMP:<pre>'; 
print_r($this->mailbox_status); echo '</pre>'; }
-                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
status<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
status<br />'; }
                        return $info;
                }

@@ -1057,7 +1057,7 @@
                                // snarf the data
                                $data_mini_str = trim(substr($data_mini_str, 0, 
$data_end));
                                $return_data = (int)$data_mini_str;
-                               if ($this->debug_dcom >= 2) { echo 'imap: 
snarf_status_data: '.$snarf_this.' = '.$return_data.'<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'imap: 
snarf_status_data: '.$snarf_this.' = '.$return_data.'<br />'; }
                        }
                        return $return_data;
                }
@@ -1104,33 +1104,33 @@
                        //SE_NOPREFETCH Don't prefetch searched messages.
                function 
sort($stream_notused='',$criteria=SORTARRIVAL,$reverse=False,$options='')
                {
-                       //if ($this->debug_dcom >= 1) { echo 'imap: sort NOT 
YET IMPLEMENTED imap sockets function<br>'; }
+                       //if ($this->debug_dcom >= 1) { echo 'imap: sort NOT 
YET IMPLEMENTED imap sockets function<br />'; }
                        //return False;
                //}

                //function 
sort($folder='',$criteria=SORTDATE,$reverse=False,$options='')
                //{
-                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
sort<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
sort<br />'; }

                        // we need total num message in this folder, is it 
cached?
                        if ($this->mailbox_status != '')
                        {
                                $num_msgs = $this->mailbox_status->messages;
-                               if ($this->debug_dcom >= 2) { echo 'imap: sort: 
using L1 class var cached $this->mailbox_status->messages 
['.$this->mailbox_status->messages.']<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'imap: sort: 
using L1 class var cached $this->mailbox_status->messages 
['.$this->mailbox_status->messages.']<br />'; }
                        }
                        else
                        {
                                // we need an "fq_folder" to call this function
                                $fq_folder =     
$GLOBALS['phpgw']->msg->get_arg_value('mailsvr_callstr')
                                                        
.$GLOBALS['phpgw']->msg->get_arg_value('folder');
-                               if ($this->debug_dcom >= 2) { echo 'imap: sort: 
NO L1 class var cached num msgs data, calling this->status with $fq_folder 
['.htmlspecialchars($fq_folder).']<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'imap: sort: 
NO L1 class var cached num msgs data, calling this->status with $fq_folder 
['.htmlspecialchars($fq_folder).']<br />'; }
                                $status_data = $this->status($stream_notused, 
$fq_folder,SA_ALL);
                                $num_msgs = $status_data->messages;
                        }


                        // DEBUG
-                       //if ($this->debug_dcom >= 1) { echo 'imap: debug QUICK 
EXIT sort<br>'; }
+                       //if ($this->debug_dcom >= 1) { echo 'imap: debug QUICK 
EXIT sort<br />'; }
                        //return False;


@@ -1184,10 +1184,10 @@
                        while(list($key,$value) = each($field_list))
                        {
                                $return_array[] = $key;
-                               if ($this->debug_dcom >= 2) { echo 'imap: sort: 
('.$i++.') Field: <b>'.$value."</b>\t\tMsg Num: <b>".$key."</b><br>\r\n"; }
+                               if ($this->debug_dcom >= 2) { echo 'imap: sort: 
('.$i++.') Field: <b>'.$value."</b>\t\tMsg Num: <b>".$key."</b><br />\r\n"; }
                        }
                        @reset($return_array);
-                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
sort<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
sort<br />'; }
                        return $return_array;
                }

@@ -1198,7 +1198,7 @@
                */
                function fetch_header($start,$stop,$element)
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
fetch_header<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: ENTERING 
fetch_header<br />'; }

                        if(!$this->write_port('a001 FETCH '.$start.':'.$stop.' 
RFC822.HEADER'))
                        {
@@ -1212,7 +1212,7 @@
                                //while(!ereg('FETCH completed',$response))
                                while(chop($response)!='')
                                {
-                                       if ($this->debug_dcom >= 2) { echo 
'imap: fetch_header: Response = '.$response."<br>\r\n"; }
+                                       if ($this->debug_dcom >= 2) { echo 
'imap: fetch_header: Response = '.$response."<br />\r\n"; }
                                        if(ereg('^\*',$response))
                                        {
                                                $field = explode(' ',$response);
@@ -1221,20 +1221,20 @@
                                        if(ereg('^'.$element,$response))
                                        {
                                                $field_element[$msg_num] = 
$this->phpGW_quoted_printable_decode2(substr($response,strlen($element)+1));
-                                               if ($this->debug_dcom >= 2) { 
echo 'imap: fetch_header: <b>Field:</b> '.$field_element[$msg_num]."\t = <b>Msg 
Num</b> ".$msg_num."<br>\r\n"; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'imap: fetch_header: <b>Field:</b> '.$field_element[$msg_num]."\t = <b>Msg 
Num</b> ".$msg_num."<br />\r\n"; }
                                        }
                                        
elseif(ereg('^'.strtoupper($element),$response))
                                        {
                                                $field_element[$msg_num] = 
$this->phpGW_quoted_printable_decode2(substr($response,strlen(strtoupper($element))+1));
-                                               if ($this->debug_dcom >= 2) { 
echo 'imap: fetch_header: <b>Field:</b> '.$field_element[$msg_num]."\t = <b>Msg 
Num</b> ".$msg_num."<br>\r\n"; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'imap: fetch_header: <b>Field:</b> '.$field_element[$msg_num]."\t = <b>Msg 
Num</b> ".$msg_num."<br />\r\n"; }
                                        }
                                        $response = $this->read_port();
                                }
                                $response = $this->read_port();
                        }
                        $response = $this->read_port();
-                       if ($this->debug_dcom >= 2) { echo 'imap: fetch_header: 
returning $field_element ['.$field_element.'] <br>'; }
-                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
fetch_header<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'imap: fetch_header: 
returning $field_element ['.$field_element.'] <br />'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: LEAVING 
fetch_header<br />'; }
                        return $field_element;
                }

@@ -1252,11 +1252,11 @@
                        $response = $this->read_port();
                        while(!ereg('FETCH completed',$response))
                        {
-                               //echo 'Response = '.$response."<br>\n";
+                               //echo 'Response = '.$response."<br />\n";
                                $field = explode(' ',$response);
                                $msg_num = intval($field[1]);
                                $field_element[$msg_num] = 
substr($field[4],0,strpos($field[4],')'));
-                               //echo '<b>Field:</b> 
'.substr($field[4],0,strpos($field[4],')'))."\t = <b>Msg Num</b> 
".$field_element[substr($field[4],0,strpos($field[4],')'))]."<br>\n";
+                               //echo '<b>Field:</b> 
'.substr($field[4],0,strpos($field[4],')'))."\t = <b>Msg Num</b> 
".$field_element[substr($field[4],0,strpos($field[4],')'))]."<br />\n";
                                $response = $this->read_port();
                        }
                        return $field_element;
@@ -1276,7 +1276,7 @@
                function fetchstructure($stream_notused,$msg_num,$flags="")
                {
                        // outer control structure for the multi-pass functions
-                       if ($this->debug_dcom >= 1) { echo 'imap: 
fetchstructure NOT YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: 
fetchstructure NOT YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }

@@ -1295,12 +1295,12 @@
                        {
                                if(!ereg('^\* '.$msgnum.' FETCH 
\(BODY\[HEADER',$response) && chop($response) != '' && chop($response) != ')')
                                {
-                                       echo 'Response = '.$response."<br>\n";
+                                       echo 'Response = '.$response."<br />\n";
                                        
$this->create_header($response,&$this->header,"True");
                                }
                                $response = $this->read_port();
                        }
-                       echo '<b>'.$msgnum.'</b> Completed!'."<br>\n";
+                       echo '<b>'.$msgnum.'</b> Completed!'."<br />\n";
                        if(!$this->write_port('a001 FETCH '.$msgnum.' 
BODY[TEXT]'))
                        {
                                $this->error();
@@ -1308,7 +1308,7 @@
                        $response = $this->read_port();
                        while(!ereg('^a001 OK FETCH completed',$response))
                        {
-                               echo 'Response = '.$response."<br>\n";
+                               echo 'Response = '.$response."<br />\n";
                                $response = $this->read_port();
                        }
                        return $this->header;
@@ -1325,7 +1325,7 @@
                */
                function 
header($stream_notused,$msg_num,$fromlength="",$tolength="",$defaulthost="")
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: header NOT 
YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: header NOT 
YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }

@@ -1343,7 +1343,7 @@
                */
                function delete($stream_notused,$msg_num,$flags="")
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: delete NOT 
YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: delete NOT 
YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }

@@ -1358,7 +1358,7 @@
                function fetchheader($stream_notused,$msg_num,$flags='')
                {
                        // NEEDED: code for flags: FT_UID; FT_INTERNAL; 
FT_PREFETCHTEXT
-                       if ($this->debug_dcom >= 1) { echo 'imap: fetchheader 
NOT YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: fetchheader 
NOT YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }

@@ -1372,7 +1372,7 @@
                */
                function 
fetchbody($stream_notused,$msg_num,$part_num="",$flags="")
                {
-                       if ($this->debug_dcom >= 1) { echo 'imap: fetchbody  
NOT YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: fetchbody  
NOT YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }

@@ -1383,7 +1383,7 @@
                function 
get_body($stream_notused,$msg_num,$flags='',$phpgw_include_header=True)
                {
                        // NEEDED: code for flags: FT_UID; maybe FT_INTERNAL; 
FT_NOT; flag FT_PEEK has no effect on POP3
-                       if ($this->debug_dcom >= 1) { echo 'imap: get_body  NOT 
YET IMPLEMENTED imap sockets function<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'imap: get_body  NOT 
YET IMPLEMENTED imap sockets function<br />'; }
                        return False;
                }


====================================================
Index: email/inc/class.mail_dcom_imap.inc.php
diff -u email/inc/class.mail_dcom_imap.inc.php:1.22 
email/inc/class.mail_dcom_imap.inc.php:1.23
--- email/inc/class.mail_dcom_imap.inc.php:1.22 Thu Dec 30 23:13:50 2004
+++ email/inc/class.mail_dcom_imap.inc.php      Sun Mar 13 23:22:44 2005
@@ -28,7 +28,7 @@
                function append($stream, $folder, $message, $flags=0)
                {
                        $folder = $this->utf7_encode($folder);
-                       return imap_append($stream, $folder, $message, $flags);
+                       $return = imap_append($stream, $folder, $message, 
$flags);
                }

                function base64($text)
@@ -79,6 +79,13 @@
                        return imap_expunge($stream);
                }

+               function empty_trash($stream)
+               {
+                       $val = imap_delete($stream, '1:*');
+                       imap_expunge($stream);
+                       return $val;
+               }
+
                function fetchbody($stream,$msgnr,$partnr,$flags=0)
                {
                        // do we force use of msg UID's
@@ -252,7 +259,7 @@
                        {
                                $flags |= SE_UID;
                        }
-                       //echo 'class dcom: sort: $this->force_msg_uids= 
'.serialize($this->force_msg_uids).'; $flags: ['.serialize($flags).']<br>';
+                       //echo 'class dcom: sort: $this->force_msg_uids= 
'.serialize($this->force_msg_uids).'; $flags: ['.serialize($flags).']<br />';
                        return imap_sort($stream,$criteria,$reverse,$flags);
                }

@@ -278,6 +285,16 @@
                        return 
$GLOBALS['phpgw']->msg->get_folder_short($folder);
                }

+               function set_flag($stream, $msgnum, $flag)
+               {
+                       $uids = 0;
+                       if($this->force_msg_uids == True)
+                       {
+                               $uids |= ST_UID;
+                       }
+                       return imap_setflag_full($stream, $msgnum, $flag, 
$uids);
+               }
+
                /* rfc_get_flag() is more "rfc safe", as RFC822 allows
                        the content of the header to be on several lines.


====================================================
Index: email/inc/class.mail_dcom_base.inc.php
diff -u email/inc/class.mail_dcom_base.inc.php:1.10 
email/inc/class.mail_dcom_base.inc.php:1.11
--- email/inc/class.mail_dcom_base.inc.php:1.10 Thu Dec 30 23:13:50 2004
+++ email/inc/class.mail_dcom_base.inc.php      Sun Mar 13 23:22:44 2005
@@ -81,14 +81,14 @@
                */
                function utf7_encode($data, $called_by='not_provided')
                {
-                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): ENTERING, $called_by ['.$called_by.']<br>'; }
-                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): $data ['.serialize($data).']<br>'; }
+                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): ENTERING, $called_by ['.$called_by.']<br />'; }
+                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): $data ['.serialize($data).']<br />'; }
                        // handle utf7 encoding of folder names, if necessary
                        if (($this->enable_utf7 == False)
                        || (function_exists('imap_utf7_encode') == False)
                        || (!isset($data)))
                        {
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here, $called_by 
['.$called_by.']<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here, $called_by 
['.$called_by.']<br />'; }
                                return $data;
                        }

@@ -101,20 +101,20 @@
                                {
                                        $return_array[$i] = 
$this->utf7_encode_string($data[$i]);
                                }
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).'], $called_by ['.$called_by.']<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).'], $called_by ['.$called_by.']<br />'; }
                                return $return_array;
                        }
                        elseif (gettype($data) == 'string')
                        {
                                // string data
                                $return_string = 
$this->utf7_encode_string($data);
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).'], $called_by ['.$called_by.']<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).'], $called_by ['.$called_by.']<br />'; }
                                return $return_string;
                        }
                        else
                        {
                                // ERROR
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array, $called_by 
['.$called_by.']<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array, $called_by ['.$called_by.']<br 
/>'; }
                                return $data;
                        }
                }
@@ -162,7 +162,7 @@
                                $name['folder_after'] = 
imap_utf7_encode($name['folder_before']);
                                $name['translated'] = $name['folder_after'];
                        }
-                       if ($this->debug_utf7 > 1) { echo ' _ mail_dcom_base: 
utf7_encode_string ('.__LINE__.'): $name DUMP: 
['.htmlspecialchars(serialize($name)).']<br>'; }
+                       if ($this->debug_utf7 > 1) { echo ' _ mail_dcom_base: 
utf7_encode_string ('.__LINE__.'): $name DUMP: 
['.htmlspecialchars(serialize($name)).']<br />'; }
                        return $name['translated'];
                }

@@ -174,14 +174,14 @@
                */
                function utf7_decode($data)
                {
-                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): ENTERING<br>'; }
-                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): $data ['.serialize($data).']<br>'; }
+                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): ENTERING<br />'; }
+                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): $data ['.serialize($data).']<br />'; }
                        // handle utf7 decoding of folder names, if necessary
                        if (($this->enable_utf7 == False)
                        || (function_exists('imap_utf7_decode') == False)
                        || (!isset($data)))
                        {
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here<br />'; }
                                return $data;
                        }

@@ -194,20 +194,20 @@
                                {
                                        $return_array[$i] = 
$this->utf7_decode_string($data[$i]);
                                }
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).']<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).']<br />'; }
                                return $return_array;
                        }
                        elseif (gettype($data) == 'string')
                        {
                                // string data
                                $return_string = 
$this->utf7_decode_string($data);
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).']<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).']<br />'; }
                                return $return_string;
                        }
                        else
                        {
                                // ERROR
-                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array.<br>'; }
+                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array.<br />'; }
                                return $data;
                        }
                }
@@ -277,14 +277,14 @@
                                || ($name['folder_before'] == 
$name['folder_after']) )
                                {
                                        // no translation occured
-                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br>'; }
+                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br />'; }
                                        return $data_str;
                                }
                                else
                                {
                                        // replace old folder name with new 
folder name
                                        $name['translated'] = 
str_replace($name['folder_before'], $name['folder_after'], $data_str);
-                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br>'; }
+                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br />'; }
                                        return $name['translated'];
                                }
                        }
@@ -300,12 +300,12 @@
                                || ($name['folder_before'] == $data_str) )
                                {
                                        // no translation occured
-                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br>'; }
+                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br />'; }
                                        return $data_str;
                                }
                                else
                                {
-                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br>'; }
+                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br />'; }
                                        return $name['translated'];
                                }
                        }

====================================================
Index: email/inc/class.mail_dcom_base_sock.inc.php
diff -u email/inc/class.mail_dcom_base_sock.inc.php:1.25 
email/inc/class.mail_dcom_base_sock.inc.php:1.26
--- email/inc/class.mail_dcom_base_sock.inc.php:1.25    Thu Dec 30 23:13:50 2004
+++ email/inc/class.mail_dcom_base_sock.inc.php Sun Mar 13 23:22:44 2005
@@ -384,7 +384,7 @@
                */
                function error()
                {
-                       echo 'Error: '.$this->error['code'].' : 
'.$this->error['msg'].' - '.$this->error['desc']."<br>\r\n";
+                       echo 'Error: '.$this->error['code'].' : 
'.$this->error['msg'].' - '.$this->error['desc']."<br />\r\n";
                        $this->close();
                        echo('<A 
HREF="'.$GLOBALS['phpgw']->link('/home.php').'">'.lang('Click here to 
continue').'...</A>'); //cbsman
                        $GLOBALS['phpgw']->common->phpgw_exit();
@@ -522,7 +522,7 @@
                        $glob_response = '';
                        while ($line = $this->read_port())
                        {
-                               //echo $line."<br>\r\n";
+                               //echo $line."<br />\r\n";
                                if (chop($line) == $end)
                                {
                                        break;
@@ -658,12 +658,12 @@
                                        if ($line2 == 'True')
                                        {
                                                $line2 = $this->read_port();
-                                               echo 'Response = 
'.$line2.'<br>'."\n";
+                                               echo 'Response = '.$line2.'<br 
/>'."\n";
                                        }
                                }
                                $header[$key] .= chop($line2);
                        }
-                       //echo 'Header[$key] = '.$header[$key].'<br>'."\n";
+                       //echo 'Header[$key] = '.$header[$key].'<br />'."\n";
                }

                /*!
@@ -703,7 +703,7 @@
                        {
                                //$new_list[$key] = $this->convert_date($value);
                                $new_list[$key] = $this->make_udate($value);
-                               if ($this->debug_dcom >= 2) { echo 'base_sock: 
convert_date_array: field_list: "'.$new_list[$key].'" was "'.$value.'"<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'base_sock: 
convert_date_array: field_list: "'.$new_list[$key].'" was "'.$value.'"<br />'; }

                        }
                        return $new_list;
@@ -725,7 +725,7 @@
                        {
                                $msg_date = substr($msg_date,$comma + 2);
                        }
-                       //echo 'Msg Date : '.$msg_date."<br>\n";
+                       //echo 'Msg Date : '.$msg_date."<br />\n";
                        $dta = explode(' ',$msg_date);
                        $ta = explode(':',$dta[3]);

@@ -748,7 +748,7 @@
                        }

                        $new_time = 
mktime($ta[0],$ta[1],$ta[2],$GLOBALS['month_array'][strtolower($dta[1])],$dta[0],$dta[2])
 - ((60 * 60) * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tzoffset']));
-                       //echo 'New Time : '.$new_time."<br>\n";
+                       //echo 'New Time : '.$new_time."<br />\n";
                        return $new_time;
                }

@@ -965,7 +965,7 @@
                        $this->header = Array();
                        while ($line = $this->read_port())
                        {
-                               //echo $line."<br>\n";
+                               //echo $line."<br />\n";
                                if (chop($line) == $end) break;
                                
$this->create_header($line,&$this->header,"True");
                        }

====================================================
Index: email/inc/class.bocompose.inc.php
diff -u email/inc/class.bocompose.inc.php:1.9 
email/inc/class.bocompose.inc.php:1.10
--- email/inc/class.bocompose.inc.php:1.9       Thu Dec 30 23:13:50 2004
+++ email/inc/class.bocompose.inc.php   Sun Mar 13 23:22:43 2005
@@ -56,55 +56,6 @@
                }

                /*!
-               @function recall_desired_action
-               @abstract used to preserve if this originated as a reply, 
replyall, forward, or new mail
-               @author Angles
-               @discussion Line lengths will differ for new mail and forwarded 
orig body, vs. reply mail that has longer
-               lines. So this preserves this info for later use. Particularly 
we like to preserve this thru the spelling pass also.
-               We look for GPC args "action" or "orig_action", as keys, and 
their
-               values are limited to "reply", "replyall", "forward", and 
"new", with "new" being deduced on the
-               initial compose page call and put into "orig_action" for later 
use, while the others possible "action"
-               values simply get stored in "orig_action" no deduction is 
required, it is specified.
-               If new future actions are added, adjust this function 
accordingly.
-               @access public
-               // MOVED TO MAIL_MSG_BASE BECAUSE WE ALSO NEED THIS IN CLASS 
BOSEND
-               function recall_desired_action()
-               {
-                       // what action are we dealing with here, reply(all), 
forward, or newmail
-                       // we care because new and forward get different line 
length then reply mail that has ">"
-                       $orig_action = 'unknown';
-                       if (($GLOBALS['phpgw']->msg->get_isset_arg('action'))
-                       && (
-                               
($GLOBALS['phpgw']->msg->get_arg_value('action') == 'forward')
-                               || 
($GLOBALS['phpgw']->msg->get_arg_value('action') == 'reply')
-                               || 
($GLOBALS['phpgw']->msg->get_arg_value('action') == 'replyall')
-                               )
-                       )
-                       {
-                               $orig_action = 
$GLOBALS['phpgw']->msg->get_arg_value('action');
-                       }
-                       elseif 
(($GLOBALS['phpgw']->msg->get_isset_arg('orig_action'))
-                       && (
-                               
($GLOBALS['phpgw']->msg->get_arg_value('orig_action') == 'forward')
-                               || 
($GLOBALS['phpgw']->msg->get_arg_value('orig_action') == 'reply')
-                               || 
($GLOBALS['phpgw']->msg->get_arg_value('orig_action') == 'replyall')
-                               || 
($GLOBALS['phpgw']->msg->get_arg_value('orig_action') == 'new')
-                               )
-                       )
-                       {
-                               $orig_action = 
$GLOBALS['phpgw']->msg->get_arg_value('orig_action');
-                       }
-                       else
-                       {
-                               // if not reply, replyall, nor forward 
"action", then we have NEW message
-                               // if this is set now then the above 
"orig_action" should preserve it
-                               $orig_action = 'new';
-                       }
-                       return $orig_action;
-               }
-               */
-
-               /*!
                @function get_compose_form_action_url
                @abstract makes the html action target for the send button on 
the compose page
                @param $menuaction_target (string)
@@ -209,7 +160,7 @@
                so i though "hey, its time for a function" ... there... I know 
this is probably not the way to do it
                @access private
                */
-               function quote_inline_message($body,$msgball)
+               function quote_inline_message($body, $msgball, $quote_char='')
                {

                                        // ----  Quoted Bodystring of Re:,Fwd: 
Message is the "First Presentable" part  -----
@@ -298,7 +249,7 @@
                                                // NOTE: do NOT trim the LEFT 
part of the string, use RTRIM instead
                                                //$this_line = '>' . 
rtrim($body_array[$bodyidx]) ."\r\n";
                                                //$this_line = 
$this->reply_prefix . rtrim($body_array[$bodyidx]) ."\r\n";
-                                               $this_line = 
$GLOBALS['phpgw']->msg->reply_prefix . rtrim($body_array[$bodyidx]) ."\r\n";
+                                               $this_line = $quote_char . 
rtrim($body_array[$bodyidx]) ."\r\n";
                                                $body .= $this_line;
                                        }
                                        // cleanup
@@ -308,7 +259,7 @@
                                        // it's up to the endusers MUA to 
handle any htmlspecialchars
                                        // as for 7-bit vs. 8-bit, we prefer to 
leave body chars as-is and send out as 8-bit mail
                                        // Later Note: see RFCs 2045-2049 for 
what MTA's (note "T") can and can not handle
-                                       return 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($body);
+                                       return 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode(trim($body));
                }

                /*!
@@ -320,7 +271,7 @@
                */
                function compose($special_instructions='')
                {
-                       if ($this->debug) { echo 'ENTERING: 
email.bocompose.compose :: $special_instructions: 
'.$special_instructions.'<br>'; }
+                       if ($this->debug) { echo 'ENTERING: 
email.bocompose.compose :: $special_instructions: '.$special_instructions.'<br 
/>'; }

                        // this function is in class.msg_bootstrap.inc.php, we 
created in the constructor for this class.
                        
$this->msg_bootstrap->ensure_mail_msg_exists('email.bocompose.compose', 
$this->debug);
@@ -351,8 +302,8 @@
                        }
                        elseif 
($GLOBALS['phpgw']->msg->get_isset_arg('["msgball"]["msgnum"]'))
                        {
-                               if ($this->debug > 1) { echo 
'email.bocompose.compose: get_isset_arg ["msgball"]["msgnum"] is TRUE <br>'; }
-                               if ($this->debug > 1) { echo 
'email.bocompose.compose: $GLOBALS[phpgw]->msg->get_arg_value(action) : 
['.$GLOBALS['phpgw']->msg->get_arg_value('action').'] <br>'; }
+                               if ($this->debug > 1) { echo 
'email.bocompose.compose: get_isset_arg ["msgball"]["msgnum"] is TRUE <br />'; }
+                               if ($this->debug > 1) { echo 
'email.bocompose.compose: $GLOBALS[phpgw]->msg->get_arg_value(action) : 
['.$GLOBALS['phpgw']->msg->get_arg_value('action').'] <br />'; }
                                $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
                                $msg_headers = 
$GLOBALS['phpgw']->msg->phpgw_header($msgball);
                                $msg_struct = 
$GLOBALS['phpgw']->msg->phpgw_fetchstructure($msgball);
@@ -452,130 +403,14 @@
                                        // ----  Begin The Message Body  (of 
the body we are replying to) -----
                                        $who_wrote = 
$GLOBALS['phpgw']->msg->get_who_wrote($msg_headers);
                                        $lang_wrote = lang('wrote');
-                                       // 2 blank lines (humm, why 3 crlf  
then)
-                                       $body =  "\r\n"
-                                               ."\r\n"
-                                               ."\r\n"
-                                               // the who wrote line
-                                               .$who_wrote .' '.$lang_wrote.': 
'."\r\n"
-                                               // then one blank quoted line 
b4 the quoted body
-                                               
.$GLOBALS['phpgw']->msg->reply_prefix."\r\n";
-
-                                       // ----  Quoted Bodystring of Re: 
Message is the "First Presentable" part  -----
-                                       // as determimed in class.bomessage and 
passed in the uri as "msgball[part_no]=X.X"
-                                       // most emails have many MIME parts, 
some may actually be blank, we do not want to
-                                       // reply to a blank part, that would 
look dumb and is not correct behavior. Instead, we want
-                                       // to quote the first body port that 
has some text, which could be anywhere.
-                                       // NOTE: we should ALWAYS get a "First 
Presentable" value from class.bomessage
-                                       // if not (a rare and screwed up 
situation) then assume msgball[part_no]=1
-                                       // Also, if the first presentable part 
is encoded as qprint or base64, or is subtype html
-                                       // class.bomessage should pass that 
info along as well
-                                       if ((!isset($msgball['part_no']))
-                                       || ($msgball['part_no'] == ''))
-                                       {
-                                               // this *should* never happen, 
we should always get a good "First Presentable"
-                                               // value in $msgball['part_no'] 
, but we can assume the first part if not specified
-                                               $msgball['part_no'] = '1';
-                                       }
-
-                                       $bodystring = '';
-                                       $bodystring = 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
-                                       // see if we have to un-do qprint (or 
other) encoding of the part we are about to quote
-                                       if 
(($GLOBALS['phpgw']->msg->get_isset_arg('encoding'))
-                                       || 
($GLOBALS['phpgw']->msg->get_isset_arg('subtype')))
-                                       {
-                                               // see if we have to un-do 
qprint encoding (fairly common)
-                                               if 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'qprint')
-                                               {
-                                                       $bodystring = 
$GLOBALS['phpgw']->msg->qprint($bodystring);
-                                               }
-                                               // *rare, maybe never seen* see 
if we have to un-do base64 encoding
-                                               elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'base64')
-                                               {
-                                                       // a human readable 
body part (non-attachment) should NOT be base64 encoded
-                                                       // but you can never 
account for idiots
-                                                       $bodystring = 
$GLOBALS['phpgw']->msg->de_base64($bodystring);
-                                               }
-                                               // after that idiot check, we 
need another now as well...
-                                               // *TOTALLY IDIOTIC* 
hotmail.com may send HTML ONLY mail
-                                               // without the rfc REQUIRED 
text only part, so we have to strip html
-                                               if 
($GLOBALS['phpgw']->msg->get_arg_value('subtype') == 'html')
-                                               {
-                                                       // class validator has 
the required function
-                                                       $this->my_validator = 
CreateObject("phpgwapi.validator");
-                                                       // you can never 
account for idiots, there should be a plain version of this IN THE MAIL
-                                                       $bodystring = 
$this->my_validator->strip_html($bodystring);
-                                               }
-                                       }
-                                       // "normalize" all line breaks into 
CRLF pairs
-                                       $bodystring = 
$GLOBALS['phpgw']->msg->normalize_crlf($bodystring);
-
-                                       // ----- Remove Email "Personal 
Signature" from Quoted Body  -----
-                                       // RFC's unofficially suggest you 
remove the "personal signature" before quoting the body
-                                       // a standard sig begins with "-- 
CRFL", that's [dash][dash][space][CRLF]
-                                       // and *should* be no more than 4 lines 
in length, followed by a CFLF
-                                       //$bodystring = 
preg_replace("/--\s{0,1}\r\n.{1,}\r\n\r\n/smx", "BLAA", $bodystring);
-                                       //$bodystring = 
preg_replace("/--\s{0,1}\r\n(.{1,}\r\n){1,5}/smx", "", $bodystring);
-                                       // sig = "dash dash space CRLF 
(anything and CRLF) repeated 1 to 5 times"
-                                       //$bodystring = 
preg_replace("/--\s{0,1}\r\n.(?!>)(.{1,}\r\n){1,5}/smx", "", $bodystring);
-                                       // THIS ONE DOES IT - USE THIS ONE
-                                       $bodystring = 
preg_replace("/\r\n[-]{2}\s{0,1}\r\n\w.{0,}\r\n(.{1,}\r\n){0,4}/", "\r\n", 
$bodystring);
-                                       // sig = "CRLF dash dash space(0or1) 
CRLF anyWordChar anything CRLF (anything and CRLF) repeated 0 to 4 times"
-
-                                       //now is a good time to trim the 
retireved bodystring
-                                       trim($bodystring);
-
-                                       // ----- Quote The Body You Are 
Replying To With ">"  ------
-                                       $body_array = array();
-                                       // NOTE compose page html has a 
textarea with "cols" set to 84
-                                       // this means on submit the text 
automatically is hardwrapped to 84 chars
-                                       // NEW - NOT ANY MORE, no more 
wrap=hard in the html-textbox tags
-                                       // I did this so replies to messages 
already having "> " added will not wrap to early
-                                       // because the message lines are 
lengthened by 1 or 2 chars already due to the
-                                       // already existing "> " and there may 
be many of them already.
-                                       // HOWEVER a new message should go out 
with standard 78 char line length (see below)
-
-                                       // we need *some* line breaks in the 
body so we know where to add the ">" quoting char(s)
-                                       // some relatively short emails may not 
have any CRLF pairs, but may have a few real long lines
-                                       //so, add linebreaks to the body if 
none are already existing
-                                       if (!ereg("\r\n", $bodystring))
-                                       {
-                                               // aim for a 74-80 char line 
length
-                                               //$bodystring = 
$GLOBALS['phpgw']->msg->body_hard_wrap($bodystring, 74);
-                                               $bodystring = 
$GLOBALS['phpgw']->msg->body_hard_wrap($bodystring, 78);
-                                       }
-                                       else
-                                       {
-                                               // NEW CHANGE: compose page no 
longer wraps hard
-                                               // this bodystring is the text 
we are about to add reply quotes to
-                                               // it may already have CRLF but 
the line lengths could be too darn long
-                                               // AND so we need to have 
somewhat sane line lengths fed to the textbox
-                                               // AND we need to have sane 
line lengths before we add the quote char
-                                               // since textbox will happily 
submit any length line to the send code and look stupid maybe
-                                               $bodystring = 
$GLOBALS['phpgw']->msg->body_hard_wrap($bodystring, 88);
-                                       }
-                                       $body_array = explode("\r\n", 
$bodystring);
-                                       // cleanup, we do not need $bodystring 
var anymore
-                                       $bodystring = '';
-                                       // add the ">" quoting char to the 
beginning of each line
-                                       // note, this *will* loop at least once 
assuming the body has one line at least
-                                       // therefor the var "body" *will* get 
filled
-                                       $body_array_count = count($body_array);
-                                       for ($bodyidx = 0; $bodyidx < 
$body_array_count; ++$bodyidx)
-                                       {
-                                               // add the ">" so called 
"quoting" char to the original body text
-                                               // NOTE: do NOT trim the LEFT 
part of the string, use RTRIM instead
-                                               $this_line = 
$GLOBALS['phpgw']->msg->reply_prefix . rtrim($body_array[$bodyidx]) ."\r\n";
-                                               $body .= $this_line;
-                                       }
-                                       // cleanup
-                                       $body_array = array();
-
-                                       // email needs to be sent with NO 
ENCODED HTML ENTITIES
-                                       // it's up to the endusers MUA to 
handle any htmlspecialchars
-                                       // as for 7-bit vs. 8-bit, we prefer to 
leave body chars as-is and send out as 8-bit mail
-                                       // Later Note: see RFCs 2045-2049 for 
what MTA's (note "T") can and can not handle
-                                       $body = 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($body);
+
+                                       $body   = "\r\n"
+                                               . "\r\n"
+                                               . "\r\n"
+                                               . $who_wrote .' 
'.$lang_wrote.': '."\r\n" // the who wrote line
+                                               . 
$GLOBALS['phpgw']->msg->reply_prefix."\r\n" // then one blank quoted line b4 
the quoted body
+                                               . 
$this->quote_inline_message('', $msgball, $GLOBALS['phpgw']->msg->reply_prefix)
+                                               . "\r\n";
                                }
                                elseif 
($GLOBALS['phpgw']->msg->get_arg_value('action') == 'forward')
                                {
@@ -595,51 +430,115 @@
                                        //Check to see if they want us to quote 
the forwarded message's body and inlude it
                                        //in the mail we are going to compose
                                        
$fwd_as_inline_pref=$GLOBALS['phpgw']->msg->get_pref_value('fwd_inline_text');
-                                       //print "<br>$fwd_as_inline_pref<br>";
+                                       //print "<br />$fwd_as_inline_pref<br 
/>";
                                        if($fwd_as_inline_pref)
                                        {
-                                               
$body=$this->quote_inline_message($body."\r\n",$msgball);
+                                               $body = 
$this->quote_inline_message($body."\r\n",$msgball, 
$GLOBALS['phpgw']->msg->reply_prefix);
                                        }
-                                       /*
-                                       $part_nice = 
pgw_msg_struct($msg_struct, $not_set, '1', 1, 1, 1, 
$GLOBALS['phpgw']->msg->get_arg_value('folder'), 
$GLOBALS['phpgw']->msg->get_arg_value('msgnum'));
-                                       // see if one of the params if the 
boundry
-                                       $part_nice['boundary'] = $not_set;  // 
initialize
-                                       for ($p = 0; $p < 
$part_nice['ex_num_param_pairs']; $p++)
+
+
+                                       //echo '<br />orig_headers <br /><pre>' 
.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($orig_headers) .'</pre><br />';
+                                       //echo '<br />reg_matches ' 
.serialize($reg_matches) .'<br />';
+                                       //echo '<br />orig_boundary ' 
.$orig_boundary .'<br />';
+                                       //echo '<br />struct: <br />' 
.$GLOBALS['phpgw']->msg->htmlspecialchars_encode(serialize($msg_struct)) .'<br 
/>';
+                               }
+                               elseif 
($GLOBALS['phpgw']->msg->get_arg_value('action') == 'edit')
+                               {
+
+                                       //FIXME: Doesn't handle attachments atm 
- will fix that soon :)
+                                       $to = $cc = $bcc = '';
+                                       if($msg_headers->to)
                                        {
-                                               //echo '<br>params['.$p.']: 
'.$part_nice['params'][$p]['attribute'].'='.$part_nice['params'][$p]['value'] 
.'<br>';
-                                               if 
(($part_nice['params'][$p]['attribute'] == 'boundary')
-                                                 && 
($part_nice['params'][$p]['value'] != $not_set))
+                                               $tolist = array();
+                                               foreach($msg_headers->to as 
$recip)
                                                {
-                                                       $part_nice['boundary'] 
= $part_nice['params'][$p]['value'];
-                                                       break;
+                                                       $tolist[] = 
$GLOBALS['phpgw']->msg->make_rfc2822_address($recip);
                                                }
+                                               $to = implode(',', $tolist);
                                        }
-                                       echo '<br>part_nice[boundary] ' 
.$part_nice['boundary'] .'<br>';
-                                       //echo '<br>part_nice: <br>' 
.$GLOBALS['phpgw']->msg->htmlspecialchars_encode(serialize($part_nice)) .'<br>';
-                                       */
-
-                                       /*
-                                       $orig_boundary = '';
-                                       // we are going to re-use the original 
message's mime boundry from the main headers
-                                       //$orig_headers = 
$GLOBALS['phpgw']->dcom->fetchheader($mailbox, 
$GLOBALS['phpgw']->msg->get_arg_value('msgnum'));
-                                       $orig_headers = 
$GLOBALS['phpgw']->dcom->fetchheader($GLOBALS['phpgw']->msg->get_arg_value('mailsvr_stream'),
 $GLOBALS['phpgw']->msg->get_arg_value('msgnum'));
-                                       $did_match = 
preg_match('/(boundary=["]?)(.*)(["]?.*(\r|\n))/ix', $orig_headers, 
$reg_matches);
-                                       if (($did_match) && 
(isset($reg_matches[1])) && (isset($reg_matches[2]))
-                                       && (stristr($reg_matches[1], 
'boundary')) && ($reg_matches[2] != ''))
+
+                                       if($msg_headers->cc)
                                        {
-                                               $orig_boundary = 
trim($reg_matches[2]);
-                                               if 
($orig_boundary[strlen($orig_boundary)-1] == '"')
+                                               $tolist = array();
+                                               foreach($msg_headers->cc as 
$recip)
                                                {
-                                                       $grab_to = 
strlen($orig_boundary) - 1;
-                                                       $orig_boundary = 
substr($orig_boundary, 0, $grab_to);
+                                                       $cclist[] = 
$GLOBALS['phpgw']->msg->make_rfc2822_address($recip);
                                                }
+                                               $cc = implode(',', $cclist);
                                        }

-                                       //echo '<br>orig_headers <br><pre>' 
.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($orig_headers) .'</pre><br>';
-                                       //echo '<br>reg_matches ' 
.serialize($reg_matches) .'<br>';
-                                       //echo '<br>orig_boundary ' 
.$orig_boundary .'<br>';
-                                       //echo '<br>struct: <br>' 
.$GLOBALS['phpgw']->msg->htmlspecialchars_encode(serialize($msg_struct)) 
.'<br>';
-                                       */
+                                       $subject = 
$GLOBALS['phpgw']->msg->get_subject($msg_headers, '');
+                                       $body = 
$this->quote_inline_message($body, $msgball);
+
+                                       if($msg_struct->parts && 
count($msg_struct->parts) > 1)
+                                       {
+                                               $mimemajors = array(
+                                                                       'text',
+                                                                       
'multipart',
+                                                                       
'message',
+                                                                       
'application',
+                                                                       'audio',
+                                                                       'image',
+                                                                       'video',
+                                                                       'other'
+                                                               );
+                                               if( 
!is_dir($GLOBALS['phpgw']->msg->att_files_dir) )
+                                               {
+                                                       
mkdir($GLOBALS['phpgw']->msg->att_files_dir, 0700);
+                                               }
+
+                                               $parts = $msg_struct->parts;
+                                               unset($parts[0]);//the ignore 
main body
+                                               foreach($parts as $id => $part)
+                                               {
+                                                       $partball = $msgball;
+                                                       $partball['part_no'] = 
$id + 1;
+                                                       //echo '<pre>'; 
print_r($part); echo '</pre>';
+
+                                                       $filename = '';
+                                                       if($part->ifdparameters)
+                                                       {
+                                                               
foreach($part->dparameters as $param)
+                                                               {
+                                                                       
if(strtolower($param->attribute) == 'filename')
+                                                                       {
+                                                                               
$filename = $param->value;
+                                                                               
break;
+                                                                       }
+                                                               }
+                                                       }
+                                                       if($filename == '' && 
$part->ifdescription)
+                                                       {
+                                                               $filename = 
$part->description;
+                                                       }
+
+                                                       if($filename == '')
+                                                       {
+                                                               $filename = 
lang('attachment') . $id;
+                                                       }
+
+
+                                                       $random_number = 
mt_rand(1000,999999999);
+                                                       $newfilename = 
md5($filename.', 
'.$GLOBALS['phpgw_info']['user']['sessionid'].time().$_SERVER['REMOTE_ADDR'].$random_number);
+                                                       $part_string = 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($partball);
+                                                       if($part->encoding == 
3)//base64
+                                                       {
+                                                               $part_string = 
base64_decode($part_string);
+                                                       }
+
+                                                       $fpart = 
fopen($GLOBALS['phpgw']->msg->att_files_dir . SEP . $newfilename,'wb');
+                                                       fputs($fpart, 
$part_string);
+                                                       fclose($fpart);
+                                                       unset($fpart);
+                                                       unset($part_string);
+
+                                                       $finfo = 
fopen($GLOBALS['phpgw']->msg->att_files_dir . SEP . $newfilename . 
'.info','wb');
+                                                       fputs($finfo, 
strtolower($mimemajors[$part->type] . '/' . $part->subtype) ."\n"
+                                                               . $filename . 
"\n");
+                                                       fclose($finfo);
+                                                       unset($finfo);
+                                               }
+                                       }
                                }

                                // so what goes in the to and cc box
@@ -705,7 +604,7 @@
                                                "bogusarg" => "0"
                                        )
                        );
-                       //echo '$addylink_orig: '.$addylink_orig .'<br>';
+                       //echo '$addylink_orig: '.$addylink_orig .'<br />';

                        // (2) the new addressbook "lex"
                        $addylink_lex = $GLOBALS['phpgw']->link(
@@ -717,7 +616,7 @@
                                                "update_opener" => "1"
                                        )
                        );
-                       //echo '$addylink_lex: '.$addylink_lex.'<br>';
+                       //echo '$addylink_lex: '.$addylink_lex.'<br />';

                        // grab your value from the prefs
                        // $this->addybook_choice (string) [ "orig" | "lex" ]
@@ -854,7 +753,12 @@
                        //$this->xi['checkbox_req_notify_desc']= lang('Request 
delivery notification');
                        $this->xi['checkbox_req_notify_name']= 'req_notify';
                        $this->xi['checkbox_req_notify_value']= 'true';
-
+
+                       $save_text = lang('save');
+                       $save_image = 
$GLOBALS['phpgw']->msg->img_maketag($GLOBALS['phpgw']->msg->_image_on('email','save','_on'),$save_text,'','','0');
+                       $save_onclick = 'save()';
+                       // Set Variables for Save button
+                       $this->xi['save_button'] = '<a 
href="javascript:'.$save_onclick.'">'.$save_image.'&nbsp;'.$save_text.'</a>';

                        //$this->xi['attachfile_js_link'] = 
$GLOBALS['phpgw']->link(
                        //      
'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/attach_file.php');

====================================================
Index: email/inc/class.boattach_file.inc.php
diff -u email/inc/class.boattach_file.inc.php:1.5 
email/inc/class.boattach_file.inc.php:1.6
--- email/inc/class.boattach_file.inc.php:1.5   Thu Dec 30 23:13:50 2004
+++ email/inc/class.boattach_file.inc.php       Sun Mar 13 23:22:43 2005
@@ -25,7 +25,6 @@
        {
                var $public_functions = array(
                        'attach'        => True
-                       //'show_ui'     => True
                );
                var $debug = 0;
                //var $debug = 3;
@@ -95,7 +94,7 @@
                function set_ref_var_holder(&$ref_template)
                {
                        // NOT IMPLEMENTED YET
-                       if ($this->debug > 1) { echo 
'emai1.boattach_file.set_ref_var_holder ('.__LINE__.'): param (a reference) is 
gettype '.serialize(gettype($ref_template)).' and param\'s class name is 
['.get_class($ref_template).'] <br>'; }
+                       if ($this->debug > 1) { echo 
'emai1.boattach_file.set_ref_var_holder ('.__LINE__.'): param (a reference) is 
gettype '.serialize(gettype($ref_template)).' and param\'s class name is 
['.get_class($ref_template).'] <br />'; }
                        if ($this->debug > 2) { echo 
'emai1.boattach_file.set_ref_var_holder ('.__LINE__.'): param (a reference) 
DUMP<pre>'; print_r($ref_template);  echo '</pre>'; }
                        if ( (isset($ref_template))
                        && ($this->var_holder != '##NOTHING') )
@@ -137,102 +136,43 @@
                        return substr($input, $lastpos + 1, strlen($input));
                }

-               /*!
-               @function fill_control_data_gpc
-               @abstract grab gpc POST vars used in this script for 
"this->action" and "this->delete" values.
-               @authors Angles
-               @param none
-               @return none, this is a class OOP call.
-               @abstract there are 2 vars this script needs to do somethig, 
"this->action" and "this->delete", so
-               we use this function to fill those vars from GPC values here, 
but in the future they could be filled
-               via some external method.  In the days before superglobals, 
these were simple vars "$action" and
-               also "$delete", but such simple days are over.
+               /**
+               * Grab gpc POST vars used in this script for "this->action" and 
"this->delete" values.
+               *
+               * @author Angles
                */
                function fill_control_data_gpc()
                {
                        if ($this->debug > 2) { echo 'emai.boattach_file.attach 
('.__LINE__.'): $GLOBALS[phpgw]->msg->ref_POST data DUMP<pre>'; 
print_r($GLOBALS['phpgw']->msg->ref_POST);  echo '</pre>'; }

-                       $this->control_data['action'] = 
htmlentities($GLOBALS['phpgw']->msg->ref_POST['action']);
-                       $this->control_data['delete'] = 
$GLOBALS['phpgw']->msg->ref_POST['delete'];
+                       $this->control_data['action'] = 
htmlentities(get_var('action', array('POST') ) );
+                       $this->control_data['delete'] = get_var('delete', 
array('POST') );

                        if ($this->debug > 2) { echo 'emai.boattach_file.attach 
('.__LINE__.'): $this->control_data DUMP<pre>'; print_r($this->control_data);  
echo '</pre>'; }
                }

-
-               /*!
-               @function fill_file_data_gpc
-               @abstract fill this->file_data array from gpc sources, php 
FILES POST data
-               @authors Angles, Chris Wiess, Dave Hall, Lex
-               @discussion UNDER DEVELOPMENT Some server side attachment 
upload handling code is borrowed from
-               Squirrelmail <Luke Ehresman> http://www.squirrelmail.org, 
particularly the
-               moving, temporary naming, and the ".info" file code.
+               /**
+               * Fill this->file_data array from gpc sources, php FILES POST 
data
+               *
+               * @internal This has been gutted - skwashd
+               * @internal Some server side attachment upload handling code is 
borrowed from  Squirrelmail Luke Ehresman, particularly the moving, temporary 
naming, and the ".info" file code.
+               * @author Angles
+               * @author Chris Wiess
+               * @author skwashd
+               * @author Lex
                */
                function fill_file_data_gpc()
                {
-                       if ($this->debug > 0) { echo 'ENTERING 
emai.boattach_file.fill_file_data_gpc ('.__LINE__.') <br>'; }
-                       /*
-                       //PHP VARIABLES NOTES:
-                       // $uploadedfile was the name of the file box in the 
submitted form, and php3 gives it additional properties:
-                       // $uploadedfile_name   $uploadedfile_size   
$uploadedfile_type
-                       // php4 also does this, but the preffered way is to use 
the new (for php4) $HTTP_POST_FILES global array
-                       // $HTTP_POST_FILES['uploadedfile']['name']   .. 
.['type']   ... ['size']  ... ['tmp_name']
-                       // note that $uploadedfile_type and 
$HTTP_POST_FILES['uploadedfile']['type'] *may* not be correct filled
-                       // UPDATE: php > 4.2 prefers "superglobal" $_FILES, 
actually 4.1+ can use that $_FILES
-                       //
-                       // FILE SIZE NOTES:
-                       // file size limits may depend on: (a) <input 
type="hidden" name="MAX_FILE_SIZE" value="whatever">
-                       // (b) these values in php.ini: "post_max_size" 
"upload_max_filesize" "memory_limit" "max_execution_time"
-                       // also see http://www.php.net/bugs.php?id=8377  for 
the status of an upload bug not fixed as of 4.0.4
-                       // also note that uploading file to *memory* is wasteful
-                       */
+                       if ($this->debug > 0) { echo 'ENTERING 
emai.boattach_file.fill_file_data_gpc ('.__LINE__.') <br />'; }

-                       // probably UNNECESSARY debug code, delete it after 
this is all stable
-                       if (($GLOBALS['phpgw']->msg->minimum_version("4.1.0"))
-                       && (!isset($GLOBALS['phpgw']->msg->ref_FILES)))
-                       {
-                               echo 'emai1.boattach_file.fill_file_data_gpc 
('.__LINE__.'): ERROR: $GLOBALS[phpgw]->msg->ref_FILES should be set here, but 
it IS NOT set<br>';
-                       }
-
-                       // the following code only applies to php < 4.1.0 where 
that superglobal was not available
-                       // thanks Dave Hall for this code suggestion
-                       if (
-                         (! (isset($HTTP_POST_FILES) || 
isset($GLOBALS['HTTP_POST_FILES'])) )
-                         && ($GLOBALS['phpgw']->msg->minimum_version("4.1.0") 
== False)
-                       )
-                       {
-                               $_FILES = $GLOBALS['HTTP_POST_FILES'];
-                               global $_FILES;
-                               // REDEFINE THE REFERENCE TO THE FILES DATA
-                               $GLOBALS['phpgw']->msg->ref_FILES = &$_FILES;
-                       }
-                       // yes I am aware that the above code and the below 
code kind of deal with the same thing
-                       // if  the above code still does not give a good 
reference to FILES data, below there is "oldschool" fallback code
-                       // also I do not want to force global something every 
script run when it is only needed here
-
-
-                       // clean / prepare PHP provided file info
-                       // note that "uploadedfile" is the POST submit form 
identification for the file
-                       if ( ($GLOBALS['phpgw']->msg->minimum_version("4.1.0"))
-                       // or we may have otherwise obtained a good reference 
above
-                       || 
(isset($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile'])) )
-                       {
-                               if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): using msg->ref_FILES to 
fill $this->file_data[] <br>'; }
-                               if ($this->debug > 2) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): msg->ref_FILE dump: 
'.htmlspecialchars(serialize($GLOBALS['phpgw']->msg->ref_FILES)).'<br>'; }
-                               $this->file_data['file_tmp_name'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']['tmp_name']));
-                               $this->file_data['file_name'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']['name']));
-                               $this->file_data['file_size'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']['size']));
-                               $this->file_data['file_type'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']['type']));
-                       }
-                       else
+                       if( isset($_FILES['uploadedfile']) )
                        {
-                               // real OLD STYLE way to get this info
-                               if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): no valid msg->ref_FILES 
available, using ANCIENT old, bad (we have to global 4 vars) to fill 
this->file_data[] <br>'; }
-                               global $uploadedfile, $uploadedfile_name, 
$uploadedfile_size, $uploadedfile_type;
-                               // php less then 4.1 uses these 
pre-superglobals enviornment vars
-                               $this->file_data['file_tmp_name'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile));
-                               $this->file_data['file_name'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile_name));
-                               $this->file_data['file_size'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile_size));
-                               $this->file_data['file_type'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile_type));
+                               if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): using msg->ref_FILES to 
fill $this->file_data[] <br />'; }
+                               if ($this->debug > 2) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): msg->ref_FILE dump: 
'.htmlspecialchars(serialize($_FILES)).'<br />'; }
+                               $this->file_data['file_tmp_name'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($_FILES['uploadedfile']['tmp_name']));
+                               $this->file_data['file_name'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($_FILES['uploadedfile']['name']));
+                               $this->file_data['file_size'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($_FILES['uploadedfile']['size']));
+                               $this->file_data['file_type'] = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($_FILES['uploadedfile']['type']));
                        }

                        // sometimes PHP is very clue-less about MIME types, 
and gives NO file_type
@@ -245,12 +185,12 @@
                        }

                        // Netscape 6 passes file_name with a full path, we 
need to extract just the filename
-                       if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): file_name 
(pre-wbasename): ' .$this->file_data['file_name'] .'<br>'; }
+                       if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): file_name 
(pre-wbasename): ' .$this->file_data['file_name'] .'<br />'; }
                        $this->file_data['file_name'] = 
$this->wbasename($this->file_data['file_name']);
-                       if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): file_name 
(post-wbasename): ' .$this->file_data['file_name'] .'<br>'; }
+                       if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): file_name 
(post-wbasename): ' .$this->file_data['file_name'] .'<br />'; }

                        if ($this->debug > 2) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): filled $this->file_data 
DUMP<pre>'; print_r($this->file_data);  echo '</pre>'; }
-                       if ($this->debug > 0) { echo 'LEAVING 
emai.boattach_file.fill_file_data_gpc ('.__LINE__.')<br>'; }
+                       if ($this->debug > 0) { echo 'LEAVING 
emai.boattach_file.fill_file_data_gpc ('.__LINE__.')<br />'; }
                }


@@ -264,7 +204,7 @@
                */
                function attach()
                {
-                       if ($this->debug > 0) { echo 'ENTERING 
emai.boattach_file.attach'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING 
emai.boattach_file.attach'.'<br />'; }
                        if ($this->debug > 2) { echo 
'emai.boattach_file.attach: initial $GLOBALS[phpgw_info][flags] DUMP<pre>'; 
print_r($GLOBALS['phpgw_info']['flags']);  echo '</pre>'; }

                        // TRICK1: use the GLOBAL template established in the 
UI file (called first)
@@ -276,7 +216,7 @@
                        // probably should remove this line later on
                        if (isset($this->var_holder) == False)
                        {
-                               echo 'emai.boattach_file.attach ('.__LINE__.'): 
ERROR: initial $this->var_holder needs to be set by this point in the code 
<br>';
+                               echo 'emai.boattach_file.attach ('.__LINE__.'): 
ERROR: initial $this->var_holder needs to be set by this point in the code <br 
/>';
                        }

                        // initialize some variables
@@ -285,7 +225,6 @@

                        // ensure existance of PHPGROUPWARE temp dir
                        // note: this is different from apache temp dir, and 
different from any other temp file location set in php.ini
-                       //if 
(!file_exists($GLOBALS['phpgw_info']['server']['temp_dir']))
                        if 
(!is_dir($GLOBALS['phpgw_info']['server']['temp_dir']))
                        {
                                
mkdir($GLOBALS['phpgw_info']['server']['temp_dir'],0700);
@@ -295,20 +234,13 @@
                        //if 
(!file_exists($GLOBALS['phpgw_info']['server']['temp_dir']))
                        if 
(!is_dir($GLOBALS['phpgw_info']['server']['temp_dir']))
                        {
-                               $alert_msg .= 'Error:'.'<br>'
-                                       . 'Server is unable to access phpgw tmp 
directory'.'<br>'
-                                       . 
$GLOBALS['phpgw_info']['server']['temp_dir'].'<br>'
-                                       . 'Please check your 
configuration'.'<br>'
-                                       . '<br>';
+                               $alert_msg .= 'Error:'.'<br />'
+                                       . 'Server is unable to access phpgw tmp 
directory'.'<br />'
+                                       . 
$GLOBALS['phpgw_info']['server']['temp_dir'].'<br />'
+                                       . 'Please check your 
configuration'.'<br />'
+                                       . '<br />';
                        }

-                       //if 
(!file_exists($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['phpgw_info']['user']['sessionid']))
-                       //if 
(!is_dir($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['phpgw_info']['user']['sessionid']))
-                       //{
-                       //      
mkdir($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['phpgw_info']['user']['sessionid'],0700);
-                       //}
-
-                       //$this->uploaddir = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['phpgw_info']['user']['sessionid'] . SEP;
                        $this->uploaddir = 
$GLOBALS['phpgw']->msg->att_files_dir;
                        if (!is_dir($this->uploaddir))
                        {
@@ -319,11 +251,11 @@
                        //if (!file_exists($this->uploaddir))
                        if (!is_dir($this->uploaddir))
                        {
-                               $alert_msg .= 'Error:'.'<br>'
-                                       . 'Server is unable to access phpgw 
email tmp directory'.'<br>'
-                                       . $this->uploaddir.'<br>'
-                                       . 'Please check your 
configuration'.'<br>'
-                                       . '<br>';
+                               $alert_msg .= 'Error:'.'<br />'
+                                       . 'Server is unable to access phpgw 
email tmp directory'.'<br />'
+                                       . $this->uploaddir.'<br />'
+                                       . 'Please check your 
configuration'.'<br />'
+                                       . '<br />';
                        }

                        // grab externally provided information
@@ -337,7 +269,7 @@
                        if ($this->control_data['action'] == lang('Delete')
                        || $this->control_data['action'] == 
htmlentities(lang('Delete')))
                        {
-                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): <b>REQUEST TO DELETE</b> detected 
$this->control_data[action] ('.$this->control_data['action'].') == lang(Delete) 
('.lang('Delete').'): <br>'; }
+                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): <b>REQUEST TO DELETE</b> detected 
$this->control_data[action] ('.$this->control_data['action'].') == lang(Delete) 
('.lang('Delete').'): <br />'; }
                                // sometimes $this->control_data[delete][] 
seems to have multiple entries for the same filename
                                for ($i=0; 
$i<count($this->control_data['delete']); $i++)
                                {
@@ -345,22 +277,22 @@
                                        $full_fname_metafile = 
$this->uploaddir.SEP.$this->control_data['delete'][$i] . '.info';
                                        if (file_exists($full_fname_attachment))
                                        {
-                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] deleting file: 
['.$full_fname_attachment.']: <br>'; }
+                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] deleting file: 
['.$full_fname_attachment.']: <br />'; }
                                                unlink($full_fname_attachment);
                                        }
                                        else
                                        {
-                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] request to deleting 
NON-EXISTING file: ['.$full_fname_attachment.']: <br>'; }
+                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] request to deleting 
NON-EXISTING file: ['.$full_fname_attachment.']: <br />'; }
                                        }
                                        // and the associated ".info" metafile
                                        if (file_exists($full_fname_metafile))
                                        {
-                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] deleting related meta file: 
['.$full_fname_metafile.']: <br>'; }
+                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] deleting related meta file: 
['.$full_fname_metafile.']: <br />'; }
                                                unlink($full_fname_metafile);
                                        }
                                        else
                                        {
-                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] request to deleting 
NON-EXISTING file: ['.$full_fname_metafile.']: <br>'; }
+                                               if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] request to deleting 
NON-EXISTING file: ['.$full_fname_metafile.']: <br />'; }
                                        }
                                }
                        }
@@ -393,10 +325,10 @@
                                (($this->file_data['file_tmp_name'] == '') || 
($this->file_data['file_tmp_name'] == 'none')))
                        {
                                $langed_attach_file = lang("Attach File");
-                               $alert_msg = lang('Input Error:').'<br>'
-                                       . lang('Please submit a filename to 
attach').'<br>'
-                                       . lang('You must click %1 for the file 
to actually upload','"'.lang('Attach File').'"').'.<br>'
-                                       . '<br>';
+                               $alert_msg = lang('Input Error:').'<br />'
+                                       . lang('Please submit a filename to 
attach').'<br />'
+                                       . lang('You must click %1 for the file 
to actually upload','"'.lang('Attach File').'"').'.<br />'
+                                       . '<br />';
                        }

                        $dh = opendir($this->uploaddir);
@@ -458,25 +390,25 @@
                        }

                        // begin DEBUG INFO (this is old, needs updating)
-                       $debuginfo .= '--uploadedfile info: <br>'
-                               . '$GLOBALS[phpgw_info][server][temp_dir]: 
'.$GLOBALS['phpgw_info']['server']['temp_dir'].'<br>'
-                               . '$GLOBALS[phpgw_info][user][sessionid]: 
'.$GLOBALS['phpgw_info']['user']['sessionid'].'<br>'
-                               . '$this->uploaddir: '.$this->uploaddir.'<br>'
-                               . 'file_tmp_name: ' 
.$this->file_data['file_tmp_name'] .'<br>'
-                               . 'file_name: ' .$this->file_data['file_name'] 
.'<br>'
-                               . 'file_size: ' .$this->file_data['file_size'] 
.'<br>'
-                               . 'file_type: ' .$this->file_data['file_type'] 
.'<br>'
-                               . '<br>'
-                               . 'totalfiles: ' .$totalfiles .'<br>'
-                               . 'file_info_count: '.count($file_info) .'<br>'
-                               . '<br>';
+                       $debuginfo .= '--uploadedfile info: <br />'
+                               . '$GLOBALS[phpgw_info][server][temp_dir]: 
'.$GLOBALS['phpgw_info']['server']['temp_dir'].'<br />'
+                               . '$GLOBALS[phpgw_info][user][sessionid]: 
'.$GLOBALS['phpgw_info']['user']['sessionid'].'<br />'
+                               . '$this->uploaddir: '.$this->uploaddir.'<br />'
+                               . 'file_tmp_name: ' 
.$this->file_data['file_tmp_name'] .'<br />'
+                               . 'file_name: ' .$this->file_data['file_name'] 
.'<br />'
+                               . 'file_size: ' .$this->file_data['file_size'] 
.'<br />'
+                               . 'file_type: ' .$this->file_data['file_type'] 
.'<br />'
+                               . '<br />'
+                               . 'totalfiles: ' .$totalfiles .'<br />'
+                               . 'file_info_count: '.count($file_info) .'<br 
/>'
+                               . '<br />';
                        if (count($file_info) > 0)
                        {
-                               $debuginfo .= '<br> 
file_info[0]='.$file_info[0] .'<br> file_info[1]='.$file_info[1];
+                               $debuginfo .= '<br /> 
file_info[0]='.$file_info[0] .'<br /> file_info[1]='.$file_info[1];
                        }
-                       $debuginfo .= '<br>';
+                       $debuginfo .= '<br />';
                        //print_debug('$debuginfo', $debuginfo);
-                       if ($this->debug > 1) { echo '$debuginfo: 
'.$debuginfo.'<br>'; }
+                       if ($this->debug > 1) { echo '$debuginfo: 
'.$debuginfo.'<br />'; }
                        // end DEBUG INFO

                        // where to submit the form to
@@ -532,7 +464,7 @@
                        $GLOBALS['phpgw']->common->phpgw_exit(False);
                        */

-                       if ($this->debug > 0) { echo 'LEAVING 
emai.boattach_file.attach'.'<br>'; }
+                       if ($this->debug > 0) { echo 'LEAVING 
emai.boattach_file.attach'.'<br />'; }

                }


====================================================
Index: email/inc/class.boaction.inc.php
diff -u email/inc/class.boaction.inc.php:1.18 
email/inc/class.boaction.inc.php:1.19
--- email/inc/class.boaction.inc.php:1.18       Thu Dec 30 23:13:50 2004
+++ email/inc/class.boaction.inc.php    Sun Mar 13 23:22:43 2005
@@ -22,6 +22,7 @@
        {
                var $public_functions = array(
                        'delmov'        => True,
+                       'empty_trash'   => True,
                        'get_attach'    => True,
                        'view_html'     => True
                );
@@ -78,7 +79,7 @@
                */
                function delmov()
                {
-                       //if ($this->debug > 0) { echo 'ENTERING 
email.boaction.delmov'.'<br>'; }
+                       //if ($this->debug > 0) { echo 'ENTERING 
email.boaction.delmov'.'<br />'; }

                        if( $GLOBALS['phpgw']->session->is_repost() ) //stop 
double deletion
                        {
@@ -89,7 +90,7 @@
                        // make sure we have msg object and a server stream
                        $this->msg_bootstrap = 
CreateObject("email.msg_bootstrap");
                        
$this->msg_bootstrap->ensure_mail_msg_exists('email.boaction.delmov', 
$this->debug);
-                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('ENTERING email.boaction.delmov'.'<br>'); }
+                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('ENTERING email.boaction.delmov'.'<br />'); }

                        // initialize this to an "ignore me" value, we change 
it later only if it should have a meaning
                        // MOVED TO MSG CLASS
@@ -150,7 +151,7 @@
                                "nextmatches" view, then the code _SHOULD_ page 
back to where there are messages to show,
                                BUT this is not done yet.
                                */
-                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: get_arg_value(what) 
== "move") <br>'); }
+                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: get_arg_value(what) 
== "move") <br />'); }

                                /*
                                $fromacctnum = 
(int)$GLOBALS['phpgw']->msg->get_arg_value('acctnum');
@@ -187,7 +188,7 @@
                                // MOVED TO MSG CLASS
                                //if (count($delmov_list) > 
$this->big_move_threshold)
                                //{
-                               //      if ($this->debug > 0) { echo 
'email.boaction.delmov: LINE '.__LINE__.' $this->big_move_threshold 
['.$this->big_move_threshold.'] exceeded, call "->msg->event_begin_big_move" to 
notice event of impending big batch moves or deletes<br>'; }
+                               //      if ($this->debug > 0) { echo 
'email.boaction.delmov: LINE '.__LINE__.' $this->big_move_threshold 
['.$this->big_move_threshold.'] exceeded, call "->msg->event_begin_big_move" to 
notice event of impending big batch moves or deletes<br />'; }
                                //      $initial_session_cache_extreme = 
$GLOBALS['phpgw']->msg->event_begin_big_move(array(), 'email.boaction.delmov: 
LINE '.__LINE__);
                                //}
                                //else
@@ -198,48 +199,48 @@

                                for ($i = 0; $i < count($delmov_list); $i++)
                                {
-                                       if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: in mail move loop 
['.(string)($i+1).'] of ['.$tm.']<br>'); }
+                                       if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: in mail move loop 
['.(string)($i+1).'] of ['.$tm.']<br />'); }
                                        $mov_msgball = $delmov_list[$i];
                                        // WHY URLDECODE SO SOON?
                                        //$mov_msgball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_in($mov_msgball['folder']);
                                        $mov_msgball['acctnum'] = 
(int)$mov_msgball['acctnum'];
                                        $did_move = False;
-                                       //if ($this->debug > 2) { echo 
'email.boaction.delmov: calling  
$GLOBALS[phpgw]->msg->interacct_mail_move('.serialize($mov_msgball).', 
'.serialize($to_fldball).'<br>'; }
+                                       //if ($this->debug > 2) { echo 
'email.boaction.delmov: calling  
$GLOBALS[phpgw]->msg->interacct_mail_move('.serialize($mov_msgball).', 
'.serialize($to_fldball).'<br />'; }
                                        //$did_move = 
$GLOBALS['phpgw']->msg->interacct_mail_move($mov_msgball, $to_fldball);
-                                       if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: calling  
$GLOBALS[phpgw]->msg->industrial_interacct_mail_move('.serialize($mov_msgball).',
 '.serialize($to_fldball).'<br>'); }
+                                       if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: calling  
$GLOBALS[phpgw]->msg->industrial_interacct_mail_move('.serialize($mov_msgball).',
 '.serialize($to_fldball).'<br />'); }
                                        // single move, NO NEED to use the move 
grouping stuff, NOTE $tm was filled above as count($delmov_list)
                                        // MOVED TO FLUSH MOVES LOGIG
                                        //if ($tm == 1)
                                        //{
-                                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov: (single move $tm: ['.$tm.']) calling  
$GLOBALS[phpgw]->msg->single_interacct_mail_move('.serialize($mov_msgball).', 
'.serialize($to_fldball).'<br>'; }
+                                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov: (single move $tm: ['.$tm.']) calling  
$GLOBALS[phpgw]->msg->single_interacct_mail_move('.serialize($mov_msgball).', 
'.serialize($to_fldball).'<br />'; }
                                        //      $did_move = 
$GLOBALS['phpgw']->msg->single_interacct_mail_move($mov_msgball, $to_fldball);
                                        //}
                                        //else
                                        //{
-                                               if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: calling  
$GLOBALS[phpgw]->msg->industrial_interacct_mail_move('.serialize($mov_msgball).',
 '.serialize($to_fldball).'<br>'); }
+                                               if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: calling  
$GLOBALS[phpgw]->msg->industrial_interacct_mail_move('.serialize($mov_msgball).',
 '.serialize($to_fldball).'<br />'); }
                                                $did_move = 
$GLOBALS['phpgw']->msg->industrial_interacct_mail_move($mov_msgball, 
$to_fldball);
                                        //}
                                        if ($did_move == False)
                                        {
                                                // error
-                                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
***ERROR**** $GLOBALS[phpgw]->msg->industrial_interacct_mail_move() returns 
FALSE, ERROR, break out of loop<br>'
-                                                               .' * * Server 
reports error: '.$GLOBALS['phpgw']->msg->phpgw_server_last_error().'<br>'); }
+                                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
***ERROR**** $GLOBALS[phpgw]->msg->industrial_interacct_mail_move() returns 
FALSE, ERROR, break out of loop<br />'
+                                                               .' * * Server 
reports error: '.$GLOBALS['phpgw']->msg->phpgw_server_last_error().'<br />'); }
                                                break;
                                        }
                                        else
                                        {
-                                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$GLOBALS[phpgw]->msg->industrial_interacct_mail_move() returns True<br>'); }
+                                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$GLOBALS[phpgw]->msg->industrial_interacct_mail_move() returns True<br />'); }
                                                //$did_expunge = False;
                                                //$did_expunge = 
$GLOBALS['phpgw']->msg->phpgw_expunge($mov_msgball['acctnum'], $mov_msgball);
-                                               //if ($this->debug > 2) { echo 
'email.boaction.delmov: $GLOBALS[phpgw]->msg->phpgw_expunge() returns 
'.serialize($did_expunge).'<br>'; }
+                                               //if ($this->debug > 2) { echo 
'email.boaction.delmov: $GLOBALS[phpgw]->msg->phpgw_expunge() returns 
'.serialize($did_expunge).'<br />'; }
                                        }
                                }

                                // ok, done moving, now expunge, 
"industrial_interacct_mail_move" uses ""
-                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): done 
moving, now call $GLOBALS[phpgw]->msg->expunge_expungable_folders<br>'); }
+                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): done 
moving, now call $GLOBALS[phpgw]->msg->expunge_expungable_folders<br />'); }
                                $did_expunge = False;
                                $did_expunge = 
$GLOBALS['phpgw']->msg->expunge_expungable_folders('email.boaction.delmov LINE 
'.__LINE__);
-                               if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br>'); }
+                               if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br />'); }

                                if (! $did_move)
                                {
@@ -251,7 +252,7 @@
                                //$tf = 
$GLOBALS['phpgw']->msg->prep_folder_out($to_fldball['folder']);
                                // folder in this array was never changed from 
its "prepped out" state, it is still urlencoded from when we first picked it up
                                $tf = $to_fldball['folder'];
-                               //echo 'boaction: $tf ['.$tf.'] <br>';
+                               //echo 'boaction: $tf ['.$tf.'] <br />';

                                // folder or message we should go back to
                                if 
(($GLOBALS['phpgw']->msg->get_isset_arg('move_postmove_goto'))
@@ -260,18 +261,18 @@
                                        // THIS MEANS WE WERE CALLED BY 
UIMESSAGE
                                        // treat the post-move navigation like 
a "delete_single_msg", as per data passed to us from that page
                                        $move_postmove_goto = 
$GLOBALS['phpgw']->msg->get_arg_value('move_postmove_goto');
-                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): move 
single *called by uimessage*: $move_postmove_goto: : 
'.$move_postmove_goto.'<br>'); }
+                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): move 
single *called by uimessage*: $move_postmove_goto: : '.$move_postmove_goto.'<br 
/>'); }
                                        // ----  "Go To Previous Message" 
Handling  -----
                                        // these insrustions passed from 
uimessage when prev_next_navigation is obtained anyway
                                        $this->redirect_to = 
$move_postmove_goto;
-                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: ('.__LINE__.') move 
single *called by uimessage*: determination of $this->redirect_to : 
['.$this->redirect_to.']<br>'); }
+                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: ('.__LINE__.') move 
single *called by uimessage*: determination of $this->redirect_to : 
['.$this->redirect_to.']<br />'); }
                                }
                                else
                                {
                                        //$return_to_fldball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_out($delmov_list[0]['folder']);
                                        // folder in this array was never 
changed from its "prepped out" state, it is still urlencoded from when we first 
picked it up
                                        $return_to_fldball['folder'] = 
$delmov_list[0]['folder'];
-                                       //echo 'boaction: 
$return_to_fldball[folder] ['.$return_to_fldball['folder'].'] <br>';
+                                       //echo 'boaction: 
$return_to_fldball[folder] ['.$return_to_fldball['folder'].'] <br />';
                                        $return_to_fldball['acctnum'] = 
$delmov_list[0]['acctnum'];

                                        $this->redirect_to = 
$GLOBALS['phpgw']->link(
@@ -285,7 +286,7 @@
                                                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));

-                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): NOT 
called by uimessage, determination of $this->redirect_to : 
['.$this->redirect_to.']<br>'); }
+                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): NOT 
called by uimessage, determination of $this->redirect_to : 
['.$this->redirect_to.']<br />'); }
                                }
                        }
                        // ---- DELETE (MULTIPLE) MESSAGES ----
@@ -300,7 +301,7 @@
                                using its "folder" and "acctnum" values.
                                */

-                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: get_arg_value(what) 
== "delall") <br>'); }
+                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: get_arg_value(what) 
== "delall") <br />'); }
                                // this is called from the index pge after you 
check some boxes and click "delete" button

                                $delmov_list = 
$GLOBALS['phpgw']->msg->get_arg_value('delmov_list');
@@ -308,7 +309,7 @@
                                // MOVED TOP MSG CLASS
                                //if (count($delmov_list) > 
$this->big_move_threshold)
                                //{
-                               //      if ($this->debug > 0) { echo 
'email.boaction.delmov: LINE '.__LINE__.' $this->big_move_threshold 
['.$this->big_move_threshold.'] exceeded, call "->msg->event_begin_big_move" to 
notice event of impending big batch moves or deletes<br>'; }
+                               //      if ($this->debug > 0) { echo 
'email.boaction.delmov: LINE '.__LINE__.' $this->big_move_threshold 
['.$this->big_move_threshold.'] exceeded, call "->msg->event_begin_big_move" to 
notice event of impending big batch moves or deletes<br />'; }
                                //      $initial_session_cache_extreme = 
$GLOBALS['phpgw']->msg->event_begin_big_move(array(), 'email.boaction.delmov: 
LINE '.__LINE__);
                                //}
                                //else
@@ -320,7 +321,7 @@
                                $loops = count($delmov_list);
                                for ($i = 0; $i < $loops; $i++)
                                {
-                                       if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: (delete) in mail 
delete loop ['.(string)($i+1).'] of ['.$loops.']<br>'); }
+                                       if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: (delete) in mail 
delete loop ['.(string)($i+1).'] of ['.$loops.']<br />'); }
                                        $this_msgnum = 
$delmov_list[$i]['msgnum'];
                                        // was_in_folder is used in Trash 
handling in the ->phpgw_delete function
                                        // if a message "was_in_folder" Trash, 
it gets deleted for real, no option to move to Trash in that case
@@ -330,26 +331,26 @@
                                        if ($did_delete == False)
                                        {
                                                // error
-                                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: (delete) ***ERROR**** 
$GLOBALS[phpgw]->msg->phpgw_delete() returns FALSE, ERROR, break out of 
loop<br>'
-                                                               .' * * Server 
reports error: '.$GLOBALS['phpgw']->msg->phpgw_server_last_error().'<br>'); }
+                                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: (delete) ***ERROR**** 
$GLOBALS[phpgw]->msg->phpgw_delete() returns FALSE, ERROR, break out of loop<br 
/>'
+                                                               .' * * Server 
reports error: '.$GLOBALS['phpgw']->msg->phpgw_server_last_error().'<br />'); }
                                                break;
                                        }
                                        else
                                        {
-                                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: (delete) 
$GLOBALS[phpgw]->msg->phpgw_delete() returns True (so it buffered the command, 
really does not mean anything not that we buffer commands)<br>'); }
+                                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: (delete) 
$GLOBALS[phpgw]->msg->phpgw_delete() returns True (so it buffered the command, 
really does not mean anything not that we buffer commands)<br />'); }

-                                               //if ($this->debug > 0) { echo 
'email.boaction.delmov: (delete) calling 
$GLOBALS[phpgw]->msg->phpgw_expunge('.$delmov_list[$i]['acctnum'].', 
$delmov_list[$i])<br>'; }
+                                               //if ($this->debug > 0) { echo 
'email.boaction.delmov: (delete) calling 
$GLOBALS[phpgw]->msg->phpgw_expunge('.$delmov_list[$i]['acctnum'].', 
$delmov_list[$i])<br />'; }
                                                //$did_expunge = False;
                                                //$did_expunge = 
$GLOBALS['phpgw']->msg->phpgw_expunge((int)$delmov_list[$i]['acctnum'], 
$delmov_list[$i]);
-                                               //if ($this->debug > 2) { echo 
'email.boaction.delmov: (delete) 
$GLOBALS[phpgw]->msg->phpgw_expunge('.$delmov_list[$i]['acctnum'].') returns 
'.serialize($did_expunge).'<br>'; }
+                                               //if ($this->debug > 2) { echo 
'email.boaction.delmov: (delete) 
$GLOBALS[phpgw]->msg->phpgw_expunge('.$delmov_list[$i]['acctnum'].') returns 
'.serialize($did_expunge).'<br />'; }
                                        }
                                }

                                // ok, done deleting, now expunge
-                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): done 
deleting, now call $GLOBALS[phpgw]->msg->expunge_expungable_folders<br>'); }
+                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): done 
deleting, now call $GLOBALS[phpgw]->msg->expunge_expungable_folders<br />'); }
                                $did_expunge = False;
                                $did_expunge = 
$GLOBALS['phpgw']->msg->expunge_expungable_folders('email.boaction.delmov LINE 
'.__LINE__);
-                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br>'); }
+                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br />'); }

                                $totaldeleted = $i;
                                //$GLOBALS['phpgw']->msg->phpgw_expunge();
@@ -435,7 +436,7 @@
                                {
                                        $this->no_fmt = '&no_fmt=1';
                                }
-                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
get_arg_value(what) == "delete_single_msg") <br>'); }
+                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
get_arg_value(what) == "delete_single_msg") <br />'); }
                                // called by clicking the "X" dutton while 
reading an individual message
                                $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
                                if ($this->debug > 2) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
delete_single_msg: pre-delete $msgball[] DUMP:', $msgball); }
@@ -471,12 +472,12 @@
                                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
                                }
-                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
delete_single_msg: pre-delete determination of $this->redirect_to : 
['.$this->redirect_to.']<br>'); }
+                               if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
delete_single_msg: pre-delete determination of $this->redirect_to : 
['.$this->redirect_to.']<br />'); }


                                if ($this->debug > 3)
                                {
-                                       
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: delete_single_msg 
('.__LINE__.'): debug flag = 4 or higher, _SKIP_ the delete and expunge 
action<br>');
+                                       
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: delete_single_msg 
('.__LINE__.'): debug flag = 4 or higher, _SKIP_ the delete and expunge 
action<br />');
                                }
                                else
                                {
@@ -492,23 +493,23 @@
                                        
//$GLOBALS['phpgw']->msg->phpgw_expunge((int)$msgball['acctnum'], $msgball);

                                        // ok, done deleting, now expunge
-                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: delete_single_msg: 
('.__LINE__.'): done deleting, now call 
$GLOBALS[phpgw]->msg->expunge_expungable_folders<br>'); }
+                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: delete_single_msg: 
('.__LINE__.'): done deleting, now call 
$GLOBALS[phpgw]->msg->expunge_expungable_folders<br />'); }
                                        $did_expunge = False;
                                        $did_expunge = 
$GLOBALS['phpgw']->msg->expunge_expungable_folders('email.boaction.delmov 
(delete_single_msg) LINE '.__LINE__);
-                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: delete_single_msg: 
('.__LINE__.'): $GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br>'); }
+                                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov: delete_single_msg: 
('.__LINE__.'): $GLOBALS[phpgw]->msg->expunge_expungable_folders() returns 
['.serialize($did_expunge).']<br />'); }
                                }
                        }
                        else
                        {
-                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
get_arg_value(what) == unknown_value<br>'); }
-                               $error_str = '<p><center><b>'.lang('UNKNOWN 
ACTION')."<br> \r\n"
-                                               .'called from 
'.$GLOBALS['PHP_SELF'].', delmov()'."<br> \r\n"
-                                               .'</b></center></p>'."<br> 
\r\n";
+                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
get_arg_value(what) == unknown_value<br />'); }
+                               $error_str = '<p><center><b>'.lang('UNKNOWN 
ACTION')."<br /> \r\n"
+                                               .'called from 
'.$GLOBALS['PHP_SELF'].', delmov()'."<br /> \r\n"
+                                               .'</b></center></p>'."<br /> 
\r\n";
                                $this->redirect_to = $this->redirect_if_error;
                        }

                        // GOTO NECT PAGEVIEW VIA REDIRECT OR OBJECT CALL
-                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): about 
to enter logic to display page defined in this URI: $this->redirect_to 
['.$this->redirect_to.']<br>'); }
+                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): about 
to enter logic to display page defined in this URI: $this->redirect_to 
['.$this->redirect_to.']<br />'); }

                        /*!
                        @capability use_old_redirect_method
@@ -519,7 +520,7 @@
                        */
                        if ($this->use_old_redirect_method == True)
                        {
-                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
EXITING with OLD REDIRECT CODE : $this->use_old_redirect_method: 
['.serialize($this->use_old_redirect_method).']<br>'); }
+                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
EXITING with OLD REDIRECT CODE : $this->use_old_redirect_method: 
['.serialize($this->use_old_redirect_method).']<br />'); }
                                $GLOBALS['phpgw']->redirect($this->redirect_to);
                                // kill this script, we re outa here...
                                if (is_object($GLOBALS['phpgw']->msg))
@@ -552,29 +553,29 @@
                        if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
calling $this->set_expected_args($expected_args) ; $expected_args DUMP:', 
$expected_args); }
                        $this->set_expected_args($expected_args);
                        // the URI of the redirect string contains data needed 
for the next page view
-                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
calling $this->set_new_args_uri($this->redirect_to) ; $this->redirect_to 
['.$this->redirect_to.']<br>'); }
+                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
calling $this->set_new_args_uri($this->redirect_to) ; $this->redirect_to 
['.$this->redirect_to.']<br />'); }
                        $this->set_new_args_uri($this->redirect_to);
                        // clear existing args, apply the new arg enviornment,
                        // we get back the menuaction the redirect would have 
asked for
-                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
calling $this->apply_new_args_env()<br>'); }
+                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
calling $this->apply_new_args_env()<br />'); }
                        $my_menuaction = $this->apply_new_args_env();
-                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$my_menuaction is ['.$my_menuaction.'] which was returned from 
$this->apply_new_args_env()<br>'); }
+                       if ($this->debug > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
$my_menuaction is ['.$my_menuaction.'] which was returned from 
$this->apply_new_args_env()<br />'); }
                        // (c) IF A "BIG MOVE", THEN TURN BACK ON THE SMART 
CACHE
                        // MOVED TO MSG CLASS
                        //if ((isset($initial_session_cache_extreme))
                        //&& ($initial_session_cache_extreme != '-1'))
                        //{
-                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): $initial_session_cache_extreme is set 
and is NOT "-1", meaning we issued a "big move" cache event, 
$initial_session_cache_extreme is 
['.serialize($initial_session_cache_extreme).'] <br>'; }
-                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): "big move" will turn off 
session_cache_extreme if it was TRUE, so we undo that for the next page view 
with: $GLOBALS[phpgw]->msg->session_cache_extreme = 
$initial_session_cache_extreme<br>'; }
+                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): $initial_session_cache_extreme is set 
and is NOT "-1", meaning we issued a "big move" cache event, 
$initial_session_cache_extreme is 
['.serialize($initial_session_cache_extreme).'] <br />'; }
+                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): "big move" will turn off 
session_cache_extreme if it was TRUE, so we undo that for the next page view 
with: $GLOBALS[phpgw]->msg->session_cache_extreme = 
$initial_session_cache_extreme<br />'; }
                        //      $GLOBALS['phpgw']->msg->session_cache_extreme = 
$initial_session_cache_extreme;
                        //}
                        //else
                        //{
-                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): $initial_session_cache_extreme is either 
NOT set or is "-1", meaning we did NOT issued a "big move" cache event 
earlier<br>'; }
+                       //      if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): $initial_session_cache_extreme is either 
NOT set or is "-1", meaning we did NOT issued a "big move" cache event 
earlier<br />'; }
                        //}

                        // imitate the next menuaction command with direct 
object calls
-                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
LEAVING by creating "next_obj" and calling its menuaction verb ...<br>'); }
+                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
LEAVING by creating "next_obj" and calling its menuaction verb ...<br />'); }
                        if (stristr($my_menuaction, 'uimessage'))
                        {
                                //// NEW: mail so object group fill may need to 
be reset
@@ -608,7 +609,7 @@
                        // (e) cleanup
                        if (is_object($GLOBALS['phpgw']->msg))
                        {
-                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): oops, 
not LEFT yet, cleanup and unset ->msg object<br>'); }
+                               if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): oops, 
not LEFT yet, cleanup and unset ->msg object<br />'); }
                                // close down ALL mailserver streams
                                $GLOBALS['phpgw']->msg->end_request();
                                // destroy the object
@@ -616,163 +617,37 @@
                                unset($GLOBALS['phpgw']->msg);
                        }
                        // shut down this transaction
-                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
LEAVING for <b>real</b> with $GLOBALS[phpgw]->common->phpgw_exit(False)<br>'); }
+                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.delmov ('.__LINE__.'): 
LEAVING for <b>real</b> with $GLOBALS[phpgw]->common->phpgw_exit(False)<br 
/>'); }
                        $GLOBALS['phpgw']->common->phpgw_exit(False);
                }
-
-               /*
-               // placeholder for previous test code
-               function just_a_placeholder()
-               {
-                       // NOW GOTO THE NEXT PAGE SPECIFIED IN THIS->REDIRECT_TO
-                       // VIA REDIRECT OR DIRECT OBJECT CALL
-                       if ($this->redirect_to != '')
-                       {
-                               if ($this->debug > 0) { echo 
'email.boaction.delmov ('.__LINE__.'): next pageview redirect data to use is: 
['.$this->redirect_to.']<br>'; }
-
-                               // Experimental:
-                               // NO REDIRECT - DIRECTLY MANUFACTURE THE NEXT 
PAGE VIEW RIGHT NOW
-                               // RECOVED ENV DATA FROM THE REDIRECT URI STRING
-                               $recovered_data = array();
-                               parse_str($this->redirect_to, $recovered_data);
-
-                               if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): redirect_to parsed_str $recovered_data 
DUMP:<pre>'; print_r($recovered_data); echo '</pre>'; }
-                               // ALL POSSIBLE VARS WE MIGHT FIND IN THE 
REDIRECT URI:
-                               $new_args_env = array(
-                                       '/mail/index_php?menuaction'  => '-1',
-                                       'fldball'       => '-1',
-                                       'msgball'       => '-1',
-                                       'td'            => '-1',
-                                       'tm'            => '-1',
-                                       'tf'            => '-1',
-                                       'sort'          => '-1',
-                                       'order'         => '-1',
-                                       'start'         => '-1'
-                               );
-                               if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): known possible recovered_data elements 
init $new_args_env DUMP:<pre>'; print_r($new_args_env); echo '</pre>'; }
-                               // loop thru KNOWN POSSIBLE new_args_env 
elements, GATHER the ones that are filled for later use
-                               reset($new_args_env);
-                               while(list($key,$value) = each($new_args_env))
-                               {
-                                       $known_arg = $key;
-                                       if ((isset($recovered_data[$known_arg]))
-                                       && ((string)$recovered_data[$known_arg] 
!= ''))
-                                       {
-                                               // we have a arg to use for the 
next page view
-                                               $new_args_env[$key] = 
$recovered_data[$known_arg];
-                                       }
-                               }
-                               reset($new_args_env);
-
-                               // GET GOOD ACCTNUM FOR THE UNSET COMMANDS BELOW
-                               // (and also get other useful info while we are 
at it
-                               if ($new_args_env['fldball'] != '-1')
-                               {
-                                       $new_acctnum = 
(int)$new_args_env['fldball']['acctnum'];
-                                       $new_folder = 
$new_args_env['fldball']['folder'];
-                               }
-                               elseif ($new_args_env['msgball'] != '-1')
-                               {
-                                       $new_acctnum = 
(int)$new_args_env['msgball']['acctnum'];
-                                       $new_folder = 
$new_args_env['msgball']['folder'];
-                                       // IMITATION: during grab_args_gpc, the 
code add an element [uri] to the existing msgball
-                                       // NOTE that for this uri element, the 
"folder" string shoulf be urlencoded
-                                       $new_uri_element =       
'msgball[msgnum]='.$new_args_env['msgball']['msgnum']
-                                                                       
.'&msgball[folder]='.urlencode($new_args_env['msgball']['folder'])
-                                                                       
.'&msgball[acctnum]='.$new_args_env['msgball']['acctnum'];
-                                       $new_args_env['msgball']['uri'] = 
$new_uri_element;
-                               }
-                               else
-                               {
-                                       echo 'email.boaction.delmov: LINE 
'.__LINE__.': ERROR getting valid acctnum for goto pageview, NO fldball NO 
msgball found <br>';
-                               }
-                               if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): known possible recovered_data elements 
<b>Post-Gather</b> $new_args_env DUMP:<pre>'; print_r($new_args_env); echo 
'</pre>'; }
-                               if ($this->debug > 1) { echo 
'email.boaction.delmov ('.__LINE__.'): will use $new_acctnum 
['.$new_acctnum.'];  and $new_folder ['.$new_folder.'], BUT FIRST unset 
selected existing class args <br>'; }
-
-                               // UNSET ARGS WE USED IN THIS PAGE BUT ARE NO 
LONGER NEEDED
-                               
$GLOBALS['phpgw']->msg->unset_arg('delmov_list', $new_acctnum);
-                               
$GLOBALS['phpgw']->msg->unset_arg('to_fldball_fake_uri', $new_acctnum);
-                               $GLOBALS['phpgw']->msg->unset_arg('to_fldball', 
$new_acctnum);
-                               
$GLOBALS['phpgw']->msg->unset_arg('move_postmove_goto', $new_acctnum);
-                               $GLOBALS['phpgw']->msg->unset_arg('sort', 
$new_acctnum);
-                               $GLOBALS['phpgw']->msg->unset_arg('order', 
$new_acctnum);
-                               $GLOBALS['phpgw']->msg->unset_arg('start', 
$new_acctnum);
-                               $GLOBALS['phpgw']->msg->unset_arg('what', 
$new_acctnum);
-                               $GLOBALS['phpgw']->msg->unset_arg('folder', 
$new_acctnum);
-                               $GLOBALS['phpgw']->msg->unset_arg('acctnum', 
$new_acctnum);
-
-                               // REFILL ARGS WITH NEW PAGE VIEW VALUES
-                               // (a) set the very important acctnum arg we 
collected earlier, and also the folder arg, because these values are _derived_ 
values
-                               // they are not plainly in the $new_args_env as 
simple key and value elements, they were derived from some of them, though
-                               
$GLOBALS['phpgw']->msg->set_acctnum($new_acctnum);
-                               $GLOBALS['phpgw']->msg->set_arg_value('folder', 
$new_folder, $new_acctnum);
-
-                               // (b) LOOP thru Gathered Args, setting the 
class args to those values
-                               reset($new_args_env);
-                               while(list($key,$value) = each($new_args_env))
-                               {
-                                       $arg_name = $key;
-                                       $arg_value = $new_args_env[$key];
-                                       // we do not set mail_msg class arg for 
'index_php?menuaction'
-                                       if (($arg_name != 
'index_php?menuaction')
-                                       && ($arg_value != '-1'))
-                                       {
-                                               
$GLOBALS['phpgw']->msg->set_arg_value($arg_name, $arg_value, $new_acctnum);
-                                       }
-                               }
-                               // (c) IF A "BIG MOVE", THEN TURN BACK ON THE 
SMART CACHE
-                               // MOVED TO MSG CLASS
-                               //if ((isset($initial_session_cache_extreme))
-                               //&& ($initial_session_cache_extreme != '-1'))
-                               //{
-                               //      
$GLOBALS['phpgw']->msg->session_cache_extreme = $initial_session_cache_extreme;
-                               //}
-                               // (d) make object and issue command
-                               $new_menuaction = 
$new_args_env['index_php?menuaction'];
-                               if ($this->debug > 1 || $this->debug_new_env > 
1) { echo 'email.boaction.delmov ('.__LINE__.'): $new_menuaction 
['.$new_menuaction.'] <br>'; }
-                               if (stristr($new_menuaction, 'uimessage'))
-                               {
-                                       // MAKE THE UIMESSAGE PAGE OBJECT
-                                       $this->next_obj = 
CreateObject('email.uimessage');
-                                       // CALL THE FUNCTION THAT DISPLAYS THE 
PAGE VIEW
-                                       $this->next_obj->message();
-                               }
-                               // else just ASSUME uiindex, it is the most 
forgiving about missing values, it has fallback defaults to use if needed
-                               else
-                               {
-                                       // MAKE THE INDEX PAGE OBJECT
-                                       $this->next_obj = 
CreateObject('email.uiindex');
-                                       // CALL THE FUNCTION THAT DISPLAYS THE 
PAGE VIEW
-                                       $this->next_obj->index();
-                               }
-                               // (e) cleanup
-                               if (is_object($GLOBALS['phpgw']->msg))
-                               {
-                                       // close down ALL mailserver streams
-                                       $GLOBALS['phpgw']->msg->end_request();
-                                       // destroy the object
-                                       $GLOBALS['phpgw']->msg = '';
-                                       unset($GLOBALS['phpgw']->msg);
-                               }
-                               // shut down this transaction
-                               $GLOBALS['phpgw']->common->phpgw_exit(False);
-                       }
-                       else
-                       {
-                               if ($this->debug > 0) { echo 
'email.boaction.delmov ('.__LINE__.'): LEAVING, with ERROR, unhandled "where to 
go from here" condition<br>'; }
-                               echo 'error: no redirect specified in 
'.$GLOBALS['PHP_SELF'].', delmov()'."<br> \r\n"
-                                       .'error_str: '.$error_str."<br> \r\n";
-                               // close down ALL mailserver streams
-                               $GLOBALS['phpgw']->msg->end_request();
-                               // destroy the object
-                               $GLOBALS['phpgw']->msg = '';
-                               unset($GLOBALS['phpgw']->msg);
-                               // shut down this transaction
-                               $GLOBALS['phpgw']->common->phpgw_exit(False);
-                       }
-               }
+
+               /**
+               * Empty "trash" folder
+               *
+               * @internal This is sh!t design - but I didn't do the class 
model :P
+               * @author skwashd
                */
-
+               function empty_trash()
+               {
+                       $this->msg_bootstrap = 
CreateObject('email.msg_bootstrap');
+                       
$this->msg_bootstrap->ensure_mail_msg_exists('email.boaction.empty_trash', 
$this->debug);
+
+                       $acctnum = $GLOBALS['phpgw']->msg->get_acctnum();
+                       $folder = 
$GLOBALS['phpgw']->msg->get_folder_long($GLOBALS['phpgw']->msg->get_pref_value('trash_folder_name',
 $acctnum));
+                       
$GLOBALS['phpgw']->msg->event_begin_big_move(array('folder' => $folder, 
'acctnum' => $acctnum), 'bo_action::empty_trash');
+                       $GLOBALS['phpgw']->msg->empty_trash( $acctnum );
+                       
$GLOBALS['phpgw']->msg->event_begin_big_end('bo_action::empty_trash');
+
+                       $folder = 'INBOX.' . 
$GLOBALS['phpgw']->msg->get_pref_value('trash_folder_name', $acctnum);
+                       $GLOBALS['phpgw']->redirect_link('/index.php',
+                                                       array(
+                                                               'menuaction'    
        => 'email.uiindex.index',
+                                                               
'fldball[folder]'       => $folder,
+                                                               
'fldball[acctnum]'      => $acctnum
+                                                       )
+                                               );
+               }
+
                /*!
                @function set_expected_args
                @abstract Tells "new_args_env" what args may be present in the 
"set_new_args_uri" data. WHY
@@ -791,8 +666,8 @@
                */
                function set_expected_args($comma_set_str='-1')
                {
-                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): ENTERING<br>'); }
-                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): param $comma_set_str: ['.$comma_set_str.'] <br>'); }
+                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): ENTERING<br />'); }
+                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): param $comma_set_str: ['.$comma_set_str.'] <br />'); }
                        $exploded_expected_args = array();
                        $exploded_expected_args = explode(',',$comma_set_str);
                        if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): $exploded_expected_args DUMP:', $exploded_expected_args); }
@@ -806,7 +681,7 @@
                                $this->expected_args[$arg_name] = '-1';
                        }
                        if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): $this->expected_args DUMP:', $this->expected_args); }
-                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): LEAVING<br>'); }
+                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_expected_args 
('.__LINE__.'): LEAVING<br />'); }
                }

                /*!
@@ -821,9 +696,9 @@
                */
                function set_new_args_uri($new_args_uri='-1')
                {
-                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_new_args_uri 
('.__LINE__.'): ENTERING, $new_args_uri ['.$new_args_uri.']<br>'); }
+                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.set_new_args_uri 
('.__LINE__.'): ENTERING, $new_args_uri ['.$new_args_uri.']<br />'); }
                        $this->new_args_uri = $new_args_uri;
-                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): LEAVING<br>'); }
+                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): LEAVING<br />'); }
                }

                /*!
@@ -852,7 +727,7 @@
                */
                function apply_new_args_env()
                {
-                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): ENTERING<br>'); }
+                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): ENTERING<br />'); }
                        $recovered_data = array();
                        if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): source data is $this->new_args_uri DUMP:', 
$this->new_args_uri); }
                        parse_str($this->new_args_uri, $recovered_data);
@@ -860,7 +735,7 @@

                        // NOTE PARSE_STR ***WILL ADD SLASHES*** TO ESCAPE 
QUOTES
                        // NO MATTER WHAT YOUR MAGIC SLASHES SETTING IS
-                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): NOTE PARSE_STR ***WILL ADD SLASHES*** TO ESCAPE QUOTES NO 
MATTER WHAT YOUR MAGIC SLASHES SETTING IS **stripping slashes NOW*** from any 
folder names'.'<br>'); }
+                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): NOTE PARSE_STR ***WILL ADD SLASHES*** TO ESCAPE QUOTES NO 
MATTER WHAT YOUR MAGIC SLASHES SETTING IS **stripping slashes NOW*** from any 
folder names'.'<br />'); }
                        if (isset($recovered_data['fldball']['folder']))
                        {
                                $recovered_data['fldball']['folder'] = 
stripslashes($recovered_data['fldball']['folder']);
@@ -887,7 +762,7 @@
                        reset($new_args_env);
                        while(list($key,$value) = each($new_args_env))
                        {
-                               if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out(' * ('.__LINE__.') $key: ['.$key.']  $value: 
['.$value.']<br>'); }
+                               if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out(' * ('.__LINE__.') $key: ['.$key.']  $value: 
['.$value.']<br />'); }
                                $known_arg = $key;
                                //handle the special URI not match case
                                if ($key == 'index_php?menuaction')
@@ -896,7 +771,7 @@
                                        reset($recovered_data);
                                        
while(list($recovered_key,$recovered_value) = each($recovered_data))
                                        {
-                                               if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out(' * * ('.__LINE__.') $recovered_key: 
['.$recovered_key.']  $recovered_value: ['.$recovered_value.']<br>'); }
+                                               if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out(' * * ('.__LINE__.') $recovered_key: 
['.$recovered_key.']  $recovered_value: ['.$recovered_value.']<br />'); }
                                                if (stristr($recovered_key, 
'menuaction'))
                                                {
                                                        $new_args_env[$key] = 
$recovered_data[$recovered_key];
@@ -904,7 +779,7 @@
                                                        break;
                                                }
                                        }
-                                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out(' ** found menuaction ** ('.__LINE__.') 
['.$recovered_data[$recovered_key].']<br>'); }
+                                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out(' ** found menuaction ** ('.__LINE__.') 
['.$recovered_data[$recovered_key].']<br />'); }
                                }
                                elseif ((isset($recovered_data[$known_arg]))
                                && ((string)$recovered_data[$known_arg] != ''))
@@ -917,7 +792,7 @@
                        if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): FIRST PASS filled available known possible recovered_data 
elements <b>Post-Gather</b> $new_args_env DUMP:', $new_args_env); }

                        // we are NOT DONE yet, extract some more args that we 
derive from what we gathered so far
-                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): ADDITIONALLY extract embedded "*ball" items "acctnum" and 
"folder" AND if a "msgball", add a "uri" element to it<br>'); }
+                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): ADDITIONALLY extract embedded "*ball" items "acctnum" and 
"folder" AND if a "msgball", add a "uri" element to it<br />'); }
                        // GET GOOD ACCTNUM FOR THE UNSET COMMANDS BELOW
                        // and also get other useful info while we are at it 
(folder), and if we find a "msgball", make and add to it a "uri" element
                        if ($new_args_env['fldball'] != '-1')
@@ -940,39 +815,39 @@
                        }
                        else
                        {
-                               echo 'email.boaction.apply_new_args_env: LINE 
'.__LINE__.': ERROR getting valid acctnum for goto pageview, NO fldball NO 
msgball found <br>';
-                               
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env: LINE 
'.__LINE__.': ERROR getting valid acctnum for goto pageview, NO fldball NO 
msgball found <br>');
+                               echo 'email.boaction.apply_new_args_env: LINE 
'.__LINE__.': ERROR getting valid acctnum for goto pageview, NO fldball NO 
msgball found <br />';
+                               
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env: LINE 
'.__LINE__.': ERROR getting valid acctnum for goto pageview, NO fldball NO 
msgball found <br />');
                        }
-                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): extracted additional data: will use $new_acctnum 
['.$new_acctnum.'];  and $new_folder ['.$new_folder.'] <br>'); }
+                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): extracted additional data: will use $new_acctnum 
['.$new_acctnum.'];  and $new_folder ['.$new_folder.'] <br />'); }
                        if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): FINAL filled available known possible recovered_data elements 
<b>Post-Gather</b> $new_args_env DUMP:', $new_args_env); }

                        // UNSET ARGS WE USED IN THIS PAGE BUT ARE NO LONGER 
NEEDED
                        // HELL, JUST UNSET ALL EXTERNAL ARGS
-                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): unset ALL known external class args as defined in array 
$GLOBALS[phpgw]->msg->known_external_args<br>'); }
+                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): unset ALL known external class args as defined in array 
$GLOBALS[phpgw]->msg->known_external_args<br />'); }
                        $loops = 
count($GLOBALS['phpgw']->msg->known_external_args);
                        for ($i = 0; $i < $loops; $i++)
                        {
                                $arg_name = 
$GLOBALS['phpgw']->msg->known_external_args[$i];
                                if 
($GLOBALS['phpgw']->msg->get_isset_arg($arg_name, $new_acctnum) == True)
                                {
-                                       if ($this->debug_new_env > 2) { 
$GLOBALS['phpgw']->msg->dbug->out(' * email.boaction.apply_new_args_env 
('.__LINE__.'):UNSETTING with $GLOBALS[phpgw]->msg->unset_arg('.$arg_name.', 
'.$new_acctnum.') <br>'); }
+                                       if ($this->debug_new_env > 2) { 
$GLOBALS['phpgw']->msg->dbug->out(' * email.boaction.apply_new_args_env 
('.__LINE__.'):UNSETTING with $GLOBALS[phpgw]->msg->unset_arg('.$arg_name.', 
'.$new_acctnum.') <br />'); }
                                        
$GLOBALS['phpgw']->msg->unset_arg($arg_name, $new_acctnum);
                                }
                                else
                                {
-                                       if ($this->debug_new_env > 2) { 
$GLOBALS['phpgw']->msg->dbug->out(' * email.boaction.apply_new_args_env 
('.__LINE__.'): <i>was not set $arg_name ['.$arg_name.'];  and $new_acctnum 
['.$new_acctnum.']</i><br>'); }
+                                       if ($this->debug_new_env > 2) { 
$GLOBALS['phpgw']->msg->dbug->out(' * email.boaction.apply_new_args_env 
('.__LINE__.'): <i>was not set $arg_name ['.$arg_name.'];  and $new_acctnum 
['.$new_acctnum.']</i><br />'); }
                                }
                        }

                        // REFILL ARGS WITH NEW PAGE VIEW VALUES
                        // (a) set the very important acctnum arg we collected 
earlier, and also the folder arg, because these values are _derived_ values
                        // they are not plainly in the $new_args_env as simple 
key and value elements, they were derived from some of them, though
-                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): BEGIN setting new arg env by setting the "new_acctnum" and 
"new_folder"<br>'); }
+                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): BEGIN setting new arg env by setting the "new_acctnum" and 
"new_folder"<br />'); }
                        $GLOBALS['phpgw']->msg->set_acctnum($new_acctnum);
                        $GLOBALS['phpgw']->msg->set_arg_value('folder', 
$new_folder, $new_acctnum);

                        // (b) LOOP thru Gathered Args, setting the class args 
to those values
-                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): continue by LOOPING thru Final Gathered Args, setting the class 
args to those values that are not still "-1" (that data was found for)<br>'); }
+                       if ($this->debug_new_env > 1) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): continue by LOOPING thru Final Gathered Args, setting the class 
args to those values that are not still "-1" (that data was found for)<br />'); 
}
                        reset($new_args_env);
                        while(list($key,$value) = each($new_args_env))
                        {
@@ -982,12 +857,12 @@
                                if ((!stristr($arg_name, 
'index_php?menuaction'))
                                && ($arg_value != '-1'))
                                {
-                                       if ($this->debug_new_env > 2) { 
$GLOBALS['phpgw']->msg->dbug->out(' * email.boaction.apply_new_args_env 
('.__LINE__.'): calling $GLOBALS[phpgw]->msg->set_arg_value('.$arg_name.', 
'.$arg_value.', '.$new_acctnum.') <br>'); }
+                                       if ($this->debug_new_env > 2) { 
$GLOBALS['phpgw']->msg->dbug->out(' * email.boaction.apply_new_args_env 
('.__LINE__.'): calling $GLOBALS[phpgw]->msg->set_arg_value('.$arg_name.', 
'.$arg_value.', '.$new_acctnum.') <br />'); }
                                        
$GLOBALS['phpgw']->msg->set_arg_value($arg_name, $arg_value, $new_acctnum);
                                }
                        }
                        //$my_menuaction = 
$new_args_env['/mail/index_php?menuaction'];
-                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): LEAVING, returning next menuaction command $my_menuaction 
['.$my_menuaction.'] <br>'); }
+                       if ($this->debug_new_env > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.apply_new_args_env 
('.__LINE__.'): LEAVING, returning next menuaction command $my_menuaction 
['.$my_menuaction.'] <br />'); }
                        return $my_menuaction;
                }

@@ -1013,7 +888,7 @@
                        $this->msg_bootstrap = 
CreateObject('email.msg_bootstrap');
                        
$this->msg_bootstrap->ensure_mail_msg_exists('email.boaction.get_attach', 
$this->debug);

-                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.get_attach: creating 
$this->browser <br>'); }
+                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.get_attach: creating 
$this->browser <br />'); }
                        $this->browser = CreateObject('phpgwapi.browser');

                        $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
@@ -1040,8 +915,8 @@
                        
//$this->browser->content_header($GLOBALS['phpgw']->msg->get_arg_value('name'), 
$mime);

                        ////echo 'get all args dump<pre>'; 
print_r($GLOBALS['phpgw']->msg->get_all_args()); echo '</pre>';
-                       ////echo '$mime: ['.$mime.']<br>';
-                       ////echo 
'$GLOBALS[phpgw]->msg->get_arg_value(encoding): 
['.$GLOBALS['phpgw']->msg->get_arg_value('encoding').']<br>';
+                       ////echo '$mime: ['.$mime.']<br />';
+                       ////echo 
'$GLOBALS[phpgw]->msg->get_arg_value(encoding): 
['.$GLOBALS['phpgw']->msg->get_arg_value('encoding').']<br />';

                        // ----  'irregular' "view raw message" functionality  
----
                        if ($msgball['part_no'] == 'raw_message')
@@ -1129,7 +1004,7 @@
                        $this->msg_bootstrap = 
CreateObject('email.msg_bootstrap');
                        
$this->msg_bootstrap->ensure_mail_msg_exists('email.boaction.get_attach', 
$this->debug);

-                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.view_html: creating 
$this->browser <br>'); }
+                       if ($this->debug > 0) { 
$GLOBALS['phpgw']->msg->dbug->out('email.boaction.view_html: creating 
$this->browser <br />'); }
                        $this->browser = CreateObject('phpgwapi.browser');

                        //$this->browser->content_header($name,$mime);

====================================================

====================================================
Index: email/inc/class.mail_dcom_pop3_sock.inc.php
diff -u email/inc/class.mail_dcom_pop3_sock.inc.php:1.20 
email/inc/class.mail_dcom_pop3_sock.inc.php:1.21
--- email/inc/class.mail_dcom_pop3_sock.inc.php:1.20    Fri Mar 14 04:00:55 2003
+++ email/inc/class.mail_dcom_pop3_sock.inc.php Sun Mar 13 23:22:44 2005
@@ -45,7 +45,7 @@
                function createmailbox($stream,$mailbox)
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: createmailbox<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: createmailbox<br />'; }
                        return true;
                }
                /*!
@@ -55,7 +55,7 @@
                function deletemailbox($stream,$mailbox)
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: deletemailbox<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: deletemailbox<br />'; }
                        return true;
                }
                /*!
@@ -65,7 +65,7 @@
                function expunge($stream)
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: expunge<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: expunge<br />'; }
                        return true;
                }
                /*!
@@ -75,7 +75,7 @@
                function listmailbox($stream,$ref,$pattern)
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: listmailbox (probable namespace discovery 
attempt)<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: listmailbox (probable namespace discovery attempt)<br 
/>'; }
                        return False;
                }
                /*!
@@ -85,7 +85,7 @@
                function mailcopy($stream,$msg_list,$mailbox,$flags)
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: mailcopy<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: mailcopy<br />'; }
                        return False;
                }
                /*!
@@ -95,7 +95,7 @@
                function mail_move($stream,$msg_list,$mailbox)
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: mail_move<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: mail_move<br />'; }
                        return False;
                }
                /*!
@@ -105,7 +105,7 @@
                function reopen($stream,$mailbox,$flags = "")
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: reopen<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: reopen<br />'; }
                        return False;
                }
                /*!
@@ -115,7 +115,7 @@
                function append($stream, $folder = "Sent", $header, $body, 
$flags = "")
                {
                        // N/A for pop3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: append<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unused function in POP3: append<br />'; }
                        return False;
                }
                
/**************************************************************************\
@@ -128,7 +128,7 @@
                function fetch_overview($stream,$sequence,$flags)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
not-yet-implemented function in POP3: fetch_overview<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
not-yet-implemented function in POP3: fetch_overview<br />'; }
                        return False;
                }
                /*!
@@ -138,7 +138,7 @@
                function noop_ping_test($stream)
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unimplemented socket function: noop_ping_test<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
unimplemented socket function: noop_ping_test<br />'; }
                        return False;
                }
                /*!
@@ -148,7 +148,7 @@
                function server_last_error()
                {
                        // not yet implemented
-                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
not-yet-implemented socket function: server_last_error<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: call to 
not-yet-implemented socket function: server_last_error<br />'; }
                        return '';
                }

@@ -169,7 +169,7 @@
                */
                function open ($fq_folder, $user, $pass, $flags='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
open<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
open<br />'; }

                        // fq_folder is a "fully qualified folder", seperate 
the parts:
                        $svr_data = array();
@@ -177,12 +177,12 @@
                        $folder = $svr_data['folder'];
                        $server = $svr_data['server'];
                        $port = $svr_data['port'];
-                       if ($this->debug_dcom >= 1) { echo 'pop3: open: 
svr_data:<br>'.serialize($svr_data).'<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: open: 
svr_data:<br />'.serialize($svr_data).'<br />'; }

                        //$port = 110;
                        if (!$this->open_port($server,$port,15))
                        {
-                               echo '<p><center><b>' . lang('There was an 
error trying to connect to your POP3 server.<br>Please contact your admin to 
check the servername, username or password.').'</b></center>';
+                               echo '<p><center><b>' . lang('There was an 
error trying to connect to your POP3 server.<br />Please contact your admin to 
check the servername, username or password.').'</b></center>';
                                echo('<CENTER><A 
HREF="'.$GLOBALS['phpgw']->link('/home.php').'">'.lang('Click here to 
continue').'...</A></CENTER>'); //cbsman
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
@@ -190,14 +190,14 @@
                        if(!$this->msg2socket('USER '.$user,"^\+ok",&$response) 
|| !$this->msg2socket('PASS '.$pass,"^\+ok",&$response))
                        {
                                $this->error();
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving open with Error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving open with Error<br />'; }
                                return False;
                        }
                        else
                        {
-                               //echo "Successful POP3 Login.<br>\n";
-                               if ($this->debug_dcom >= 1) { echo 'pop3: open: 
Successful POP3 Login<br>'; }
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving open<br>'; }
+                               //echo "Successful POP3 Login.<br />\n";
+                               if ($this->debug_dcom >= 1) { echo 'pop3: open: 
Successful POP3 Login<br />'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving open<br />'; }
                                return $this->socket;
                        }
                }
@@ -217,12 +217,12 @@
                        if (!$this->msg2socket('QUIT',"^\+ok",&$response))
                        {
                                $this->error();
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
close: Error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
close: Error<br />'; }
                                return False;
                        }
                        else
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
close: Successful POP3 Logout<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
close: Successful POP3 Logout<br />'; }
                                return True;
                        }
                }
@@ -241,12 +241,12 @@
                */
                function mailboxmsginfo($stream_notused='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
mailboxmsginfo<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
mailboxmsginfo<br />'; }
                        // caching this with POP3 is OK but will cause HAVOC 
with IMAP or NNTP
                        // do we have a cached header_array  ?
                        //if ($this->mailbox_msg_info != '')
                        //{
-                       //      if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving mailboxmsginfo returning cached data<br>'; }
+                       //      if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving mailboxmsginfo returning cached data<br />'; }
                        //      return $this->mailbox_msg_info;
                        //}
                        // NO cached data, so go get it
@@ -276,18 +276,18 @@
                        {
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'pop3: mailboxmsginfo: 
info->Nmsgs: '.$info->Nmsgs.'<br>';
-                                       echo 'pop3: mailboxmsginfo: info->Size: 
'.$info->Size.'<br>';
+                                       echo 'pop3: mailboxmsginfo: 
info->Nmsgs: '.$info->Nmsgs.'<br />';
+                                       echo 'pop3: mailboxmsginfo: info->Size: 
'.$info->Size.'<br />';
                                }
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving mailboxmsginfo<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving mailboxmsginfo<br />'; }
                                // save this data for future use
                                //$this->mailbox_msg_info = $info;
                                return $info;
                        }
                        else
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
mailboxmsginfo: returining False<br>'; }
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving mailboxmsginfo<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
mailboxmsginfo: returining False<br />'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving mailboxmsginfo<br />'; }
                                return False;
                        }
                }
@@ -304,7 +304,7 @@
                */
                function status($stream_notused='', 
$fq_folder='',$options=SA_ALL)
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
status<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
status<br />'; }
                        // POP3 has only INBOX so ignore $fq_folder
                        // assume option is SA_ALL for POP3 because POP3 
returns so little info anyway
                        // initialize structure
@@ -325,8 +325,8 @@
                        $mailbox_msg_info = 
$this->mailboxmsginfo($stream_notused);
                        // all POP3 can return from imap_status is messages
                        $info->messages = $mailbox_msg_info->Nmsgs;
-                       if ($this->debug_dcom >= 1) { echo 'pop3: status: 
info->messages: '.$info->messages.'<br>'; }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
status<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: status: 
info->messages: '.$info->messages.'<br />'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
status<br />'; }
                        return $info;
                }

@@ -340,13 +340,13 @@
                */
                function num_msg($stream_notused='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
num_msg<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
num_msg<br />'; }
                        // Most Efficient Method:
                        //      call mailboxmsginfo and fill THIS size data 
from that
                        $mailbox_msg_info = 
$this->mailboxmsginfo($stream_notused);
                        $return_num_msg = $mailbox_msg_info->Nmsgs;
-                       if ($this->debug_dcom >= 1) { echo 'pop3: num_msg: 
'.$return_num_msg.'<br>'; }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
num_msg<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: num_msg: 
'.$return_num_msg.'<br />'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
num_msg<br />'; }
                        return $return_num_msg;
                }

@@ -378,7 +378,7 @@
                */
                function 
sort($stream_notused='',$criteria=SORTARRIVAL,$reverse=False,$options='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
sort<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
sort<br />'; }

                        // nr_of_msgs on pop server
                        $msg_num = $this->num_msg($stream_notused);
@@ -386,20 +386,20 @@
                        // no msgs - no sort.
                        if (!$msg_num)
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving sort with Error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving sort with Error<br />'; }
                                return false;
                        }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: sort: Number 
of Msgs:'.$msg_num.'<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: sort: Number 
of Msgs:'.$msg_num.'<br />'; }
                        switch($criteria)
                        {
                                case SORTDATE:
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTDATE<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTDATE<br />'; }
                                        $old_list = 
$this->fetch_header_element(1,$msg_num,'Date');
                                        $field_list = 
$this->convert_date_array($old_list);
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: sort: field_list: '.serialize($field_list).'<br><br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: sort: field_list: '.serialize($field_list).'<br /><br />'; }
                                        break;
                                case SORTARRIVAL:
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTARRIVAL<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTARRIVAL<br />'; }
                                        // TEST
                                        if 
(!$this->msg2socket('LIST',"^\+ok",&$response))
                                        {
@@ -408,26 +408,26 @@
                                        $response = $this->read_port_glob('.');
                                        // expected array should NOT start at 
element 0, instead start it at element 1
                                        $field_list = 
$this->glob_to_array($response, False, ' ',True,1);
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: sort: field_list: '.serialize($field_list).'<br><br><br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: sort: field_list: '.serialize($field_list).'<br /><br /><br />'; }
                                        break;
                                case SORTFROM:
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTFROM<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTFROM<br />'; }
                                        $field_list = 
$this->fetch_header_element(1,$msg_num,'From');
                                        break;
                                case SORTSUBJECT:
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTSUBJECT<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTSUBJECT<br />'; }
                                        $field_list = 
$this->fetch_header_element(1,$msg_num,'Subject');
                                        break;
                                case SORTTO:
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTTO<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTTO<br />'; }
                                        $field_list = 
$this->fetch_header_element(1,$msg_num,'To');
                                        break;
                                case SORTCC:
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTCC<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTCC<br />'; }
                                        $field_list = 
$this->fetch_header_element(1,$msg_num,'cc');
                                        break;
                                case SORTSIZE:
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTSIZE<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTSIZE<br />'; }
                                        $field_list = 
$this->fetch_header_element(1,$msg_num,'Size');
                                        break;
                        }
@@ -457,12 +457,12 @@
                        while(list($key,$value) = each($field_list))
                        {
                                $return_array[] = $key;
-                               //echo '('.$i.') Field: 
<b>'.$value."</b>\t\tMsg Num: <b>".$key."</b><br>\n";
+                               //echo '('.$i.') Field: 
<b>'.$value."</b>\t\tMsg Num: <b>".$key."</b><br />\n";
                                $i++;
                        }
                        @reset($return_array);
-                       if ($this->debug_dcom >= 2) { echo 'pop3: sort: 
return_array: '.serialize($return_array).'<br><br>'; }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
sort<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'pop3: sort: 
return_array: '.serialize($return_array).'<br /><br />'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
sort<br />'; }
                        return $return_array;
                }

@@ -472,10 +472,10 @@
                */
                function fetch_header_element($start,$stop,$element)
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetch_header_element<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetch_header_element<br />'; }
                        for($i=$start;$i<=$stop;$i++)
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetch_header_element: issue "TOP '.$i.' 0"<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetch_header_element: issue "TOP '.$i.' 0"<br />'; }
                                if(!$this->write_port('TOP '.$i.' 0'))
                                {
                                        $this->error();
@@ -484,19 +484,19 @@
                                if($this->header[$element])
                                {
                                        $field_element[$i] = 
$this->phpGW_quoted_printable_decode2($this->header[$element]);
-                                       //echo $field_element[$i].' = 
'.$this->phpGW_quoted_printable_decode2($this->header[$element])."<br>\n";
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetch_header_element: field_element['.$i.']: 
'.$field_element[$i].'<br>'; }
+                                       //echo $field_element[$i].' = 
'.$this->phpGW_quoted_printable_decode2($this->header[$element])."<br />\n";
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetch_header_element: field_element['.$i.']: '.$field_element[$i].'<br 
/>'; }
                                }
                                else
                                {
                                        $field_element[$i] = 
$this->phpGW_quoted_printable_decode2($this->header[strtoupper($element)]);
-                                       //echo $field_element[$i].' = 
'.$this->phpGW_quoted_printable_decode2($this->header[strtoupper($element)])."<br>\n";
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetch_header_element: field_element['.$i.']: 
'.$field_element[$i].'<br>'; }
+                                       //echo $field_element[$i].' = 
'.$this->phpGW_quoted_printable_decode2($this->header[strtoupper($element)])."<br
 />\n";
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetch_header_element: field_element['.$i.']: '.$field_element[$i].'<br 
/>'; }
                                }

                        }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: 
fetch_header_element: field_element: 
'.serialize($field_element).'<br><br><br>'; }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetch_header_element<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: 
fetch_header_element: field_element: '.serialize($field_element).'<br /><br 
/><br />'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetch_header_element<br />'; }
                        return $field_element;
                }

@@ -519,21 +519,21 @@
                function fetchstructure($stream_notused,$msg_num,$flags="")
                {
                        // outer control structure for the multi-pass functions
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetchstructure<br />'; }

                        // do we have a cached fetchstructure ?
                        if (($this->msg_structure != '')
                        && ((int)$this->msg_structure_msgnum == 
(int)($msg_num)))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchstructure: using cached msg_structure data<br>'; }
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fetchstructure<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchstructure: using cached msg_structure data<br />'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fetchstructure<br />'; }
                                return $this->msg_structure;
                        }
                        // NO cached fetchstructure data - so make it
                        // this will fill $this->msg_structure *TopLevel* only
                        if 
($this->fill_toplevel_fetchstructure($stream_notused,$msg_num,$flags) == False)
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fetchstructure with Error from Toplevel<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fetchstructure with Error from Toplevel<br />'; }
                                return False;
                        }
                        // by now we have these created and stored (cached)
@@ -555,14 +555,14 @@
                                if (count($this->msg_structure->parts[$i]) > 0)
                                {
                                        // grap 3rd level embedded data (if any)
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: fetchstructure: attempting ['.$i.'] 3rd level parts embedded 
discovery<br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: fetchstructure: attempting ['.$i.'] 3rd level parts embedded 
discovery<br />'; }
                                        // ---  Create 3rd Level Sub-Parts 
FetchStructure Data  (if necessary)  ---
                                        // NOTE: param to  
create_embeded_fetchstructure  is a REFERENCE
                                        
$this->create_embeded_fetchstructure(&$this->msg_structure->parts[$i]);
                                }
                                else
                                {
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: fetchstructure: this ['.$i.'] 3rd level part is empty<br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: fetchstructure: this ['.$i.'] 3rd level part is empty<br />'; }
                                }
                        }
                        */
@@ -582,7 +582,7 @@
                                for ($lev_1=0; $lev_1 < 
count($this->msg_structure->parts) ;$lev_1++)
                                {
                                        // grap 1st level embedded data (if any)
-                                       if ($this->debug_dcom >= 2) { echo 
'<br>***<br>* * * * * * * * *<br>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.'] of 
['.(string)(count($this->msg_structure->parts)-1).'] embedded parts discovery * 
* * * *<br>'; }
+                                       if ($this->debug_dcom >= 2) { echo '<br 
/>***<br />* * * * * * * * *<br />pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.'] of 
['.(string)(count($this->msg_structure->parts)-1).'] embedded parts discovery * 
* * * *<br />'; }
                                        // Create Sub-Parts FetchStructure Data 
 (if necessary)  ---
                                        // NOTE: param to  
create_embeded_fetchstructure  is a REFERENCE
                                        
$this->create_embeded_fetchstructure(&$this->msg_structure->parts[$lev_1]);
@@ -594,7 +594,7 @@
                                                for ($lev_2=0; $lev_2 < 
count($tmp_lev_1->parts) ;$lev_2++)
                                                {
                                                        // grap 2nd level 
embedded data (if any)
-                                                       if ($this->debug_dcom 
>= 2) { echo '<br>***<br>* * * * * * * * *<br>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.'] of 
['.(string)(count($tmp_lev_1->parts)-1).'] embedded parts discovery * * * * 
*<br>'; }
+                                                       if ($this->debug_dcom 
>= 2) { echo '<br />***<br />* * * * * * * * *<br />pop3: fetchstructure: 
attempting this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.'] of 
['.(string)(count($tmp_lev_1->parts)-1).'] embedded parts discovery * * * * 
*<br />'; }
                                                        // Create Sub-Parts 
FetchStructure Data  (if necessary)  ---
                                                        // NOTE: param to  
create_embeded_fetchstructure  is a REFERENCE
                                                        
$this->create_embeded_fetchstructure(&$tmp_lev_1->parts[$lev_2]);
@@ -606,7 +606,7 @@
                                                                for ($lev_3=0; 
$lev_3 < count($tmp_lev_2->parts) ;$lev_3++)
                                                                {
                                                                        // grap 
3rd level embedded data (if any)
-                                                                       if 
($this->debug_dcom >= 2) { echo '<br>***<br>* * * * * * * * *<br>pop3: 
fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.'] of 
['.(string)(count($tmp_lev_2->parts)-1).'] embedded parts discovery * * * * 
*<br>'; }
+                                                                       if 
($this->debug_dcom >= 2) { echo '<br />***<br />* * * * * * * * *<br />pop3: 
fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.'] of 
['.(string)(count($tmp_lev_2->parts)-1).'] embedded parts discovery * * * * 
*<br />'; }
                                                                        // 
Create 3rd Level Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                        // 
NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
                                                                        
$this->create_embeded_fetchstructure(&$tmp_lev_2->parts[$lev_3]);
@@ -618,7 +618,7 @@
                                                                                
for ($lev_4=0; $lev_4 < count($tmp_lev_3->parts) ;$lev_4++)
                                                                                
{
                                                                                
        // grap 3rd level embedded data (if any)
-                                                                               
        if ($this->debug_dcom >= 2) { echo '<br>***<br>* * * * * * * * 
*<br>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.']->parts['.$lev_4.']
 of ['.(string)(count($tmp_lev_3->parts)-1).'] embedded parts discovery * * * * 
*<br>'; }
+                                                                               
        if ($this->debug_dcom >= 2) { echo '<br />***<br />* * * * * * * * *<br 
/>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.']->parts['.$lev_4.']
 of ['.(string)(count($tmp_lev_3->parts)-1).'] embedded parts discovery * * * * 
*<br />'; }
                                                                                
        // Create Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                                
        // NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
                                                                                
        $this->create_embeded_fetchstructure(&$tmp_lev_3->parts[$lev_4]);
@@ -626,37 +626,37 @@
                                                                        }
                                                                        else
                                                                        {
-                                                                               
if ($this->debug_dcom >= 2) { echo '<br>***<br>pop3: fetchstructure: Traversal 
SKIP FOUTRH PASS level parts NOT SET<br>'; }
+                                                                               
if ($this->debug_dcom >= 2) { echo '<br />***<br />pop3: fetchstructure: 
Traversal SKIP FOUTRH PASS level parts NOT SET<br />'; }
                                                                        }
                                                                }
                                                        }
                                                        else
                                                        {
-                                                               if 
($this->debug_dcom >= 2) { echo '<br>***<br>pop3: fetchstructure: Traversal 
SKIP THIRD PASS level parts NOT SET<br>'; }
+                                                               if 
($this->debug_dcom >= 2) { echo '<br />***<br />pop3: fetchstructure: Traversal 
SKIP THIRD PASS level parts NOT SET<br />'; }
                                                        }
                                                }
                                        }
                                        else
                                        {
-                                               if ($this->debug_dcom >= 2) { 
echo '<br>***<br>pop3: fetchstructure: Traversal SKIP SECOND PASS level parts 
NOT SET<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo '<br />***<br />pop3: fetchstructure: Traversal SKIP SECOND PASS level 
parts NOT SET<br />'; }
                                        }
                                }
                        }
                        else
                        {
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
fetchstructure: Traversal SKIP FIRST PARTS level parts NOT SET<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
fetchstructure: Traversal SKIP FIRST PARTS level parts NOT SET<br />'; }
                        }

-                       if ($this->debug_dcom >= 2) { echo '<br>***<br>pop3: 
fetchstructure: * * * * * * Traversal OVER * * * * * * * * * * <br>'; }
+                       if ($this->debug_dcom >= 2) { echo '<br />***<br 
/>pop3: fetchstructure: * * * * * * Traversal OVER * * * * * * * * * * <br />'; 
}

                        if ($this->debug_dcom >= 2)
                        {
-                               echo '<br>dumping fetchstructure FINAL data: 
<br>';
+                               echo '<br />dumping fetchstructure FINAL data: 
<br />';
                                var_dump($this->msg_structure);
-                               echo '<br><br><br>';
+                               echo '<br /><br /><br />';
                        }

-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetchstructure<br />'; }
                        return $this->msg_structure;
                }

@@ -673,7 +673,7 @@
                */
                function 
fill_toplevel_fetchstructure($stream_notused,$msg_num,$flags="")
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fill_toplevel_fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fill_toplevel_fetchstructure<br />'; }

                        // --- Header Array  ---
                        $header_array = 
$this->get_header_array($stream_notused,$msg_num,$flags);
@@ -682,7 +682,7 @@
                        if ((count($this->body_array) > 0)
                        && ((int)$this->body_array_msgnum == (int)($msg_num)))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fill_toplevel_fetchstructure: using cached body_array data<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fill_toplevel_fetchstructure: using cached body_array data<br />'; }
                                $body_array = $this->body_array;
                        }
                        else
@@ -699,20 +699,20 @@
                                        {
                                                echo '+['.$i.'] 
'.htmlspecialchars($this->body_array[$i])."\r\n";
                                        }
-                                       echo '</pre><br><br>';
+                                       echo '</pre><br /><br />';
                                }
                        }
                        if ($this->debug_dcom >= 2)
                        {
-                               echo 'pop3: fill_toplevel_fetchstructure 
header_array iteration:<br>';
+                               echo 'pop3: fill_toplevel_fetchstructure 
header_array iteration:<br />';
                                for($i=0;$i < count($header_array);$i++)
                                {
-                                       echo 
'+'.htmlspecialchars($header_array[$i]).'<br>';
+                                       echo 
'+'.htmlspecialchars($header_array[$i]).'<br />';
                                }
                        }
                        if (!$header_array)
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fill_toplevel_fetchstructure with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fill_toplevel_fetchstructure with error<br />'; }
                                return False;
                        }

@@ -732,7 +732,7 @@
                        if (!$this->msg2socket('LIST 
'.$msg_num,"^\+ok",&$response))
                        {
                                $this->error();
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fill_toplevel_fetchstructure with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fill_toplevel_fetchstructure with error<br />'; }
                                return False;
                        }
                        $list_response = explode(' ',$response);
@@ -771,11 +771,11 @@
                        
$this->unset_unfilled_fetchstructure(&$this->msg_structure);
                        if ($this->debug_dcom >= 2)
                        {
-                               echo '<br>dumping fill_toplevel_fetchstructure 
TOP-LEVEL data: <br>';
+                               echo '<br />dumping 
fill_toplevel_fetchstructure TOP-LEVEL data: <br />';
                                var_dump($this->msg_structure);
-                               echo '<br><br><br>';
+                               echo '<br /><br /><br />';
                        }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fill_toplevel_fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fill_toplevel_fetchstructure<br />'; }
                        return True;
                }

@@ -790,7 +790,7 @@
                */
                function create_embeded_fetchstructure($info)
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
create_embeded_fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
create_embeded_fetchstructure<br />'; }
                        // --- Do We Have SubParts To Discover  ---

                        // Test 1: Detect Boundary Paramaters
@@ -815,14 +815,14 @@
                        && (count($info->parts) == 0))
                        {
                                // Boundry Based Multi-Part MIME In Need Of 
Discovered
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
create_embeded_fetchstructure: Discovery Needed for boundary param: 
'.$info->custom['my_cookie'].'<br>'; }
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: begin "mime loop", iterate thru body_array<br>'; 
}
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
create_embeded_fetchstructure: Discovery Needed for boundary param: 
'.$info->custom['my_cookie'].'<br />'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: begin "mime loop", iterate thru body_array<br 
/>'; }
                                // look for any parts using this boundary/cookie
                                for ($x=0; $x < count($this->body_array) ;$x++)
                                {
                                        // search line by line thru the body
                                        $body_line = $this->body_array[$x];
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: mime loop ['.$x.']: 
'.htmlspecialchars($body_line).'<br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: mime loop ['.$x.']: 
'.htmlspecialchars($body_line).'<br />'; }
                                        if 
((strstr($body_line,'--'.$info->custom['my_cookie']))
                                        && 
(strpos($body_line,'--'.$info->custom['my_cookie']) == 0)
                                        // but NOT the final boundary
@@ -849,7 +849,7 @@
                                                        
$tmp_cur_part_idx->custom['part_end'] = $x-1;
                                                        // --Lines-- we know 
beginning line and ending line, so calculate # lines for this part
                                                        
$tmp_cur_part_idx->lines = (int)$tmp_cur_part_idx->custom['part_end'] - 
(int)$tmp_cur_part_idx->custom['part_start'];
-                                                       if ($this->debug_dcom 
>= 2) { echo 'pop3: create_embeded_fetchstructure: mime loop: current part end 
at ['.(string)($x-1).'] byte cumula: ['.$tmp_cur_part_idx->bytes.'] lines: 
['.$tmp_cur_part_idx->lines.']<br>'; }
+                                                       if ($this->debug_dcom 
>= 2) { echo 'pop3: create_embeded_fetchstructure: mime loop: current part end 
at ['.(string)($x-1).'] byte cumula: ['.$tmp_cur_part_idx->bytes.'] lines: 
['.$tmp_cur_part_idx->lines.']<br />'; }
                                                        // this individual part 
has completed discovery, it os now "OUT"
                                                        
$tmp_cur_part_idx->custom['detect_state'] = 'out';
                                                        // we are DONE with 
this part for now
@@ -860,7 +860,7 @@
                                                        
unset($tmp_cur_part_idx);
                                                }
                                                // so now deal with this NEW 
part we just discovered
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: begin part 
discovery<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: begin part discovery<br 
/>'; }
                                                // Create New Sub Part Object
                                                $new_part_idx = 
count($info->parts);
                                                $info->parts[$new_part_idx] = 
new msg_structure;
@@ -882,7 +882,7 @@
                                                        {
                                                                // grap this 
part header line
                                                                
$part_header_blob .= $this->body_array[$y]."\r\n";
-                                                               if 
($this->debug_dcom >= 2) { echo 'pop3: create_embeded_fetchstructure: mime 
loop: part part_header_blob line['.$y.']: '.$this->body_array[$y].'<br>'; }
+                                                               if 
($this->debug_dcom >= 2) { echo 'pop3: create_embeded_fetchstructure: mime 
loop: part part_header_blob line['.$y.']: '.$this->body_array[$y].'<br />'; }
                                                        }
                                                        else
                                                        {
@@ -903,7 +903,7 @@
                                                // make the header blob into an 
array of strings, one array element per header line, throw away blank lines
                                                $part_header_array = Array();
                                                $part_header_array = 
$this->glob_to_array($part_header_blob, False, '', True);
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: 
part_header_array:'.serialize($part_header_array).'<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: 
part_header_array:'.serialize($part_header_array).'<br />'; }
                                                // since we just passed the 
headers, and this is NOT a final boundary
                                                // this MUST be a start point 
for the next part
                                                
$tmp_new_part_idx->custom['part_start'] = (int)($y+1);
@@ -914,7 +914,7 @@
                                                unset($tmp_new_part_idx);

                                                // ADVANCE INDEX $x TO AFTER 
WHAT WE'VE ALREADY LOOKED AT
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: advance x from ['.$x.'] 
to ['.$y.']<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: advance x from ['.$x.'] 
to ['.$y.']<br />'; }
                                                $x = $y;
                                        }
                                        elseif 
((strstr($body_line,'--'.$info->custom['my_cookie'].'--'))
@@ -931,7 +931,7 @@
                                                $tmp_cur_part_idx->lines = 
$tmp_cur_part_idx->custom['part_end'] - $tmp_cur_part_idx->custom['part_start'];
                                                
$tmp_cur_part_idx->custom['detect_state'] = 'out';
                                                // we are DONE with this part 
for now
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: final boundary at 
['.(string)($x-1).'] byte cumula: ['.$tmp_cur_part_idx->bytes.'] lines: 
['.$tmp_cur_part_idx->lines.']<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: final boundary at 
['.(string)($x-1).'] byte cumula: ['.$tmp_cur_part_idx->bytes.'] lines: 
['.$tmp_cur_part_idx->lines.']<br />'; }
                                                // unset any unfilled elements
                                                // NOTE: param to  
unset_unfilled_fetchstructure  is a REFERENCE
                                                
$this->unset_unfilled_fetchstructure(&$tmp_cur_part_idx);
@@ -968,7 +968,7 @@
                        && (count($info->parts) == 0))
                        {
                                // Encapsulated "message/rfc822" MIME Part In 
Need Of Discovered
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
create_embeded_fetchstructure: Discovery Needed for Encapsulated 
"message/rfc822" MIME Part<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
create_embeded_fetchstructure: Discovery Needed for Encapsulated 
"message/rfc822" MIME Part<br />'; }
                                $range_start = $info->custom['part_start'];
                                $range_end = $info->custom['part_end'];
                                // is this range data valid
@@ -976,12 +976,12 @@
                                || (!isset($info->custom['part_end']))
                                || ($info->custom['part_end'] <= 
$info->custom['part_start']))
                                {
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving create_embeded_fetchstructure with Error in "message/rfc2822" 
range<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving create_embeded_fetchstructure with Error in "message/rfc2822" 
range<br />'; }
                                        return False;
                                }

                                // note that below we will iterate thru this 
range
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: "mime loop", will iterate thru parents 
body_array range ['.$range_start.'] to ['.$range_end.']<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: "mime loop", will iterate thru parents 
body_array range ['.$range_start.'] to ['.$range_end.']<br />'; }

                                // encapsulated is not that tricky, we must so 
this
                                // 1) Create New Sub Part Object
@@ -1006,7 +1006,7 @@
                                        {
                                                // grap this part header line
                                                $part_header_blob .= 
$this->body_array[$y]."\r\n";
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: enc mime loop: part part_header_blob line['.$y.']: 
'.htmlspecialchars($this->body_array[$y]).'<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: enc mime loop: part part_header_blob line['.$y.']: 
'.htmlspecialchars($this->body_array[$y]).'<br />'; }
                                        }
                                        else
                                        {
@@ -1027,7 +1027,7 @@
                                // make the header blob into an array of 
strings, one array element per header line, throw away blank lines
                                $part_header_array = Array();
                                $part_header_array = 
$this->glob_to_array($part_header_blob, False, '', True);
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: enc mime loop: 
part_header_array:'.serialize($part_header_array).'<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: enc mime loop: 
part_header_array:'.serialize($part_header_array).'<br />'; }

                                // 2) Feed these Headers thru 
"sub_get_structure"
                                // fill the conventional info on this 
fetchstructure sub-part
@@ -1044,7 +1044,7 @@
                                if ((!isset($tmp_enc_part_idx->subtype))
                                || ((string)$tmp_enc_part_idx->subtype == ''))
                                {
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding subtype "plain" to immediate RFC822 child part, none was 
specified<br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding subtype "plain" to immediate RFC822 child part, none was 
specified<br />'; }
                                        $tmp_enc_part_idx->ifsubtype = True;
                                        $tmp_enc_part_idx->subtype = 'plain';
                                }
@@ -1066,7 +1066,7 @@
                                // do that crappy adding of charset param if 
necessary
                                if ($found_charset == False)
                                {
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding param "charset=US-ASCII" to immediate RFC822 child part, none 
was specified<br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding param "charset=US-ASCII" to immediate RFC822 child part, none 
was specified<br />'; }
                                        $new_idx = 
count($tmp_enc_part_idx->parameters);
                                        $tmp_enc_part_idx->parameters[$new_idx] 
= new msg_params('charset','US-ASCII');
                                        $tmp_enc_part_idx->ifparameters = true;
@@ -1082,12 +1082,12 @@
                                // 4) calculate byte size and # of lines of the 
content within this parts start and end
                                $my_start = 
$tmp_enc_part_idx->custom['part_start'];
                                $my_end = $tmp_enc_part_idx->custom['part_end'];
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: enc mime loop: this body range ['.$my_start.'] 
to ['.$my_end.']<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: enc mime loop: this body range ['.$my_start.'] 
to ['.$my_end.']<br />'; }
                                for ($x=$my_start; $x < $my_end+1 ;$x++)
                                {
                                        // running byte size of this part
                                        $body_line = $this->body_array[$x];
-                                       if ($this->debug_dcom >= 2) { echo 
'pop3: encap mime size loop ['.$x.']: '.htmlspecialchars($body_line).'<br>'; }
+                                       if ($this->debug_dcom >= 2) { echo 
'pop3: encap mime size loop ['.$x.']: '.htmlspecialchars($body_line).'<br />'; }
                                        // prevoius count
                                        $prev_bytes = $tmp_enc_part_idx->bytes;
                                        // add new count, +2 for the \r\n that 
will end the line when we feed it to the client
@@ -1100,7 +1100,7 @@
                                $tmp_enc_part_idx->lines = $my_end - $my_start;

                                // we're done with the loop so the bytes have 
been calculated in that loop
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: this part range byte size 
['.$tmp_enc_part_idx->bytes.'] lines: ['.$tmp_enc_part_idx->lines.']<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: this part range byte size 
['.$tmp_enc_part_idx->bytes.'] lines: ['.$tmp_enc_part_idx->lines.']<br />'; }
                                $info->parts[$enc_part_idx] = $tmp_enc_part_idx;
                                unset($tmp_enc_part_idx);
                        }
@@ -1112,18 +1112,18 @@
                        && (count($info->parts) == 0))
                        {
                                // do NOTHING - this level has ALREADY been 
filled
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: feed info encapsulated "message/rfc822" ALREADY 
filled<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: feed info encapsulated "message/rfc822" ALREADY 
filled<br />'; }
                                return False;
                        }
                        elseif ($info->custom['my_cookie'] == '')
                        {
                                // do NOTHING - this is NOT multipart
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: feed info not multipart<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: feed info not multipart<br />'; }
                                if ($this->debug_dcom >= 2)
                                {
-                                       echo 'pop3: 
create_embeded_fetchstructure: feed info not multipart DUMP EXAMINE:<br>';
+                                       echo 'pop3: 
create_embeded_fetchstructure: feed info not multipart DUMP EXAMINE:<br />';
                                        var_dump($info);
-                                       echo '<br><br>';
+                                       echo '<br /><br />';
                                }
                                return False;
                        }
@@ -1131,20 +1131,20 @@
                        && (count($info->parts) > 0))
                        {
                                // do NOTHING - this level has ALREADY been 
filled
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: feed info multipart ALREADY filled<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: feed info multipart ALREADY filled<br />'; }
                                return False;
                        }
                        else
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
create_embeded_fetchstructure: * * no mans land * *<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
create_embeded_fetchstructure: * * no mans land * *<br />'; }
                        }
                        //if ($this->debug_dcom >= 2)
                        //{
-                       //      echo '<br>dumping create_embeded_fetchstructure 
return info: <br>';
+                       //      echo '<br />dumping 
create_embeded_fetchstructure return info: <br />';
                        //      var_dump($info);
-                       //      echo '<br><br>';
+                       //      echo '<br /><br />';
                        //}
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
create_embeded_fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
create_embeded_fetchstructure<br />'; }
                        return True;
                }

@@ -1170,7 +1170,7 @@
                                $debug_mime = False;
                        }

-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
sub_get_structure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
sub_get_structure<br />'; }
                        /*
                        // initialize the structure
                        $info->custom['top_level'] = $extra_args['top_level'];
@@ -1187,7 +1187,7 @@
                        for ($i=0; $i < count($header_array) ;$i++)
                        {
                                $pos = strpos($header_array[$i],' ');
-                               //if ($debug_mime) { echo 
'header_array['.$i.']: '.$header_array[$i].'<br>'; }
+                               //if ($debug_mime) { echo 
'header_array['.$i.']: '.$header_array[$i].'<br />'; }
                                if (is_int($pos) && ($pos==0))
                                {
                                        continue;
@@ -1196,9 +1196,9 @@
                                $content = 
trim(substr($header_array[$i],$pos+1));
                                if ($debug_mime)
                                {
-                                       //echo 'pos: '.$pos.'<br>';
+                                       //echo 'pos: '.$pos.'<br />';
                                        echo 'pop3: sub_get_structure: keyword: 
['.htmlspecialchars($keyword).']'
-                                               .' content: 
['.htmlspecialchars($content).']<br>';
+                                               .' content: 
['.htmlspecialchars($content).']<br />';
                                }
                                switch ($keyword)
                                {
@@ -1210,10 +1210,10 @@
                                        $pos_param = strpos($content,';');
                                        if ($pos_param > 0)
                                        {
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: sub_get_structure: apparent params exist in content 
['.$content.']<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: sub_get_structure: apparent params exist in content 
['.$content.']<br />'; }
                                                // feed the whole param line 
into this function
                                                $content = 
substr($content,$pos_param+1);
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: sub_get_structure: calling parse_msg_params, feeding content 
['.$content.']<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: sub_get_structure: calling parse_msg_params, feeding content 
['.$content.']<br />'; }
                                                // False = this is NOT a 
disposition param, this is the more common regular param
                                                // NOTE: first param to  
parse_msg_params  is a REFERENCE
                                                
$this->parse_msg_params(&$info,$content,False);
@@ -1282,9 +1282,9 @@

                        if ($this->debug_dcom >= 2)
                        {
-                               echo 'pop3: sub_get_structure: info->encoding 
['.(string)$info->encoding.'] (if empty here it will get a default value 
later)<br>';
+                               echo 'pop3: sub_get_structure: info->encoding 
['.(string)$info->encoding.'] (if empty here it will get a default value 
later)<br />';
                        }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
sub_get_structure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
sub_get_structure<br />'; }
                        return $info;
                }

@@ -1301,7 +1301,7 @@
                */
                function unset_unfilled_fetchstructure($info)
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
unset_unfilled_fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
unset_unfilled_fetchstructure<br />'; }
                        // unset any unfilled elements, ALWAYS leave parts and 
custom
                        if ((string)$info->type == '')
                        {
@@ -1361,7 +1361,7 @@
                        }
                        //$info->custom = array();
                        //$info->parts = array();
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
unset_unfilled_fetchstructure<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
unset_unfilled_fetchstructure<br />'; }
                }

                /*!
@@ -1377,7 +1377,7 @@
                */
                function parse_type_subtype($info,$content)
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
parse_type_subtype<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
parse_type_subtype<br />'; }
                        // used by pop_fetchstructure only
                        // get rid of any other params that might be here
                        $pos = strpos($content,';');
@@ -1397,7 +1397,7 @@
                        {
                                $prim_type = strtolower($content);
                        }
-                       if ($this->debug_dcom >= 2) { echo 'pop3: 
parse_type_subtype: prim_type: '.$prim_type.'<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'pop3: 
parse_type_subtype: prim_type: '.$prim_type.'<br />'; }
                        $info->type = $this->type_str_to_int($prim_type);
                        if ($info->ifsubtype == False)
                        {
@@ -1407,11 +1407,11 @@
                        }
                        if ($this->debug_dcom >= 2)
                        {
-                               echo 'pop3: parse_type_subtype: info->type 
['.$info->type.'] aka "'.$this->type_int_to_str($info->type).'"<br>';
-                               echo 'pop3: parse_type_subtype: info->ifsubtype 
['.$info->ifsubtype.']<br>';
-                               echo 'pop3: parse_type_subtype: info->subtype 
"'.$info->subtype.'"<br>';
+                               echo 'pop3: parse_type_subtype: info->type 
['.$info->type.'] aka "'.$this->type_int_to_str($info->type).'"<br />';
+                               echo 'pop3: parse_type_subtype: info->ifsubtype 
['.$info->ifsubtype.']<br />';
+                               echo 'pop3: parse_type_subtype: info->subtype 
"'.$info->subtype.'"<br />';
                        }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
parse_type_subtype<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
parse_type_subtype<br />'; }
                }

                /*!
@@ -1431,9 +1431,9 @@
                function 
parse_msg_params($info,$content,$is_disposition_param=False)
                {
                        if ($this->debug_dcom >= 2) {
-                               //echo 'pop3: *in parse_msg_params<br>';
-                               echo 'pop3: *in parse_msg_params: content 
['.$content.']<br>';
-                               echo 'pop3: *in parse_msg_params: 
is_disposition_param ['.(string)$is_disposition_param.']<br>';
+                               //echo 'pop3: *in parse_msg_params<br />';
+                               echo 'pop3: *in parse_msg_params: content 
['.$content.']<br />';
+                               echo 'pop3: *in parse_msg_params: 
is_disposition_param ['.(string)$is_disposition_param.']<br />';
                        }
                        // bogus data detection
                        if (trim($content) == '')
@@ -1601,7 +1601,7 @@
                */
                function size_msg($stream_notused,$msg_num)
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
size_msg<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
size_msg<br />'; }
                        if (!$this->msg2socket('LIST 
'.$msg_num,"^\+ok",&$response))
                        {
                                $this->error();
@@ -1610,8 +1610,8 @@
                        $list_response = explode(' ',$response);
                        $return_size = trim($list_response[2]);
                        $return_size = (int)$return_size * 1;
-                       if ($this->debug_dcom >= 1) { echo 'pop3: size_msg: 
'.$return_size.'<br>'; }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
size_msg<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: size_msg: 
'.$return_size.'<br />'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
size_msg<br />'; }
                        return $return_size;
                }

@@ -1633,14 +1633,14 @@
                */
                function 
header($stream_notused,$msg_num,$fromlength='',$tolength='',$defaulthost='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
header<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
header<br />'; }
                        $info = new hdr_info_envelope;
                        $info->Size = $this->size_msg($stream_notused,$msg_num);
                        $info->size = $info->Size;
                        $header_array = 
$this->get_header_array($stream_notused,$msg_num);
                        if (!$header_array)
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving header with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving header with error<br />'; }
                                return False;
                        }
                        for ($i=0; $i < count($header_array); $i++)
@@ -1730,7 +1730,7 @@
                        }
                        if ($this->debug_dcom >= 1)
                        {
-                               echo 'pop3: Leaving header<br>';
+                               echo 'pop3: Leaving header<br />';
                        }
                        return $info;
                }
@@ -1748,7 +1748,7 @@
                */
                function get_addr_details($people,$address,$header,$count)
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_addr_details<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_addr_details<br />'; }
                        if (!trim($address))
                        {
                                return False;
@@ -1873,7 +1873,7 @@
                */
                function delete($stream_notused,$msg_num,$flags="")
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
delete<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
delete<br />'; }
                        // in PHP 4 msg_num can be
                        // a) an integer referencing a single message
                        // b1) a comma seperated list of message numbers "1,2,6"
@@ -1886,7 +1886,7 @@
                        for($i=0;$i < count($tmp_array);$i++)
                        {
                                $this_element = (string)$tmp_array[$i];
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
delete prep: this_element: '.$this_element.'<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
delete prep: this_element: '.$this_element.'<br />'; }
                                $this_element = trim($this_element);
                                // do nothing if this is an empty array element
                                if ($this_element != '')
@@ -1912,7 +1912,7 @@
                                                        // add to the 
msg_num_array
                                                        $new_idx = 
count($msg_num_array);
                                                        
$msg_num_array[$new_idx] = (int)$z;
-                                                       if ($this->debug_dcom 
>= 2) { echo 'pop3: delete prep: range: msg_num_array['.$new_idx.'] = 
'.$z.'<br>'; }
+                                                       if ($this->debug_dcom 
>= 2) { echo 'pop3: delete prep: range: msg_num_array['.$new_idx.'] = '.$z.'<br 
/>'; }
                                                }
                                        }
                                        else
@@ -1921,7 +1921,7 @@
                                                // add to the msg_num_array
                                                $new_idx = 
count($msg_num_array);
                                                $msg_num_array[$new_idx] = 
(int)$this_element;
-                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: delete prep: msg_num_array['.$new_idx.'] = '.$this_element.'<br>'; }
+                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: delete prep: msg_num_array['.$new_idx.'] = '.$this_element.'<br 
/>'; }
                                        }
                                }
                        }
@@ -1929,18 +1929,18 @@
                        for($i=0;$i < count($msg_num_array);$i++)
                        {
                                $this_msg_num = $msg_num_array[$i];
-                               if ($this->debug_dcom >= 2) { echo 'pop3: 
delete: deleting this_msg_num '.$this_msg_num.'<br>'; }
+                               if ($this->debug_dcom >= 2) { echo 'pop3: 
delete: deleting this_msg_num '.$this_msg_num.'<br />'; }
                                if (!$this->msg2socket('DELE 
'.$this_msg_num,"^\+ok",&$response))
                                {
                                        $this->error();
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving delete with error deleting msgnum '.$this_msg_num.'<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving delete with error deleting msgnum '.$this_msg_num.'<br />'; }
                                        return False;
                                }
                        }
                        // these messages are now marked for deletion by the 
POP3 server
                        // they will be expunged when user sucessfully 
explicitly logs out
                        // if we make it here I have to assume no errors
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
delete<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
delete<br />'; }
                        return True;
                }

@@ -1962,7 +1962,7 @@
                function fetchheader($stream_notused,$msg_num,$flags='')
                {
                        // NEEDED: code for flags: FT_UID; FT_INTERNAL; 
FT_PREFETCHTEXT
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetchheader<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetchheader<br />'; }

                        $header_glob = 
$this->get_header_raw($stream_notused,$msg_num,$flags);

@@ -1975,7 +1975,7 @@
                                        
.$this->get_body($stream_notused,$msg_num,$flags);
                        }

-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetchheader<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetchheader<br />'; }
                        return $header_glob;
                }

@@ -1993,12 +1993,12 @@
                */
                function get_header_array($stream_notused,$msg_num,$flags='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_header_array<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_header_array<br />'; }
                        // do we have a cached header_array  ?
                        if ((count($this->header_array) > 0)
                        && ((int)$this->header_array_msgnum == (int)($msg_num)))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_array returning cached data<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_array returning cached data<br />'; }
                                return $this->header_array;
                        }
                        // NO cached data, get it
@@ -2014,7 +2014,7 @@
                        // cache this data for future use
                        $this->header_array = $header_array;
                        $this->header_array_msgnum = (int)($msg_num);
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
get_header_array<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
get_header_array<br />'; }
                        return $header_array;
                }

@@ -2032,33 +2032,33 @@
                */
                function get_header_raw($stream_notused,$msg_num,$flags='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_header_raw<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_header_raw<br />'; }
                        if ((!isset($msg_num))
                        || (trim((string)$msg_num) == ''))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_raw with error: Invalid msg_num<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_raw with error: Invalid msg_num<br />'; }
                                return False;
                        }
                        // do we have a cached header_glob ?
                        if (($this->header_glob != '')
                        && ((int)$this->header_glob_msgnum == (int)($msg_num)))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_raw returning cached data<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_raw returning cached data<br />'; }
                                return $this->header_glob;
                        }
                        // NO cached data, get it
-                       if ($this->debug_dcom >= 1) { echo 'pop3: 
get_header_raw: issuing: TOP '.$msg_num.' 0 <br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: 
get_header_raw: issuing: TOP '.$msg_num.' 0 <br />'; }
                        if (!$this->msg2socket('TOP '.$msg_num.' 
0',"^\+ok",&$response))
                        {
                                $this->error();
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_raw with error<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_raw with error<br />'; }
                                return False;
                        }
                        $glob = $this->read_port_glob('.');
                        // save this info for future ues
                        $this->header_glob = $glob;
                        $this->header_glob_msgnum = (int)$msg_num;
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
get_header_raw<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
get_header_raw<br />'; }
                        return $glob;
                }

@@ -2091,19 +2091,19 @@
                */
                function 
fetchbody($stream_notused,$msg_num,$part_num='',$flags='')
                {
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetchbody<br>'; }
-                       if ($this->debug_dcom >= 1) { echo 'pop3: fetchbody: 
attempt to return part '.$part_num.'<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
fetchbody<br />'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: fetchbody: 
attempt to return part '.$part_num.'<br />'; }
                        // totally under construction

                        // FORCE a pass thru fetchstructure to ENSURE all 
necessary data is present and cached
-                       if ($this->debug_dcom >= 2) { echo 'pop3: fetchbody: 
force a pass thru fetchstructure to ensure necessary data is present and 
cached<br>'; }
+                       if ($this->debug_dcom >= 2) { echo 'pop3: fetchbody: 
force a pass thru fetchstructure to ensure necessary data is present and 
cached<br />'; }
                        $bogus_data = 
$this->fetchstructure($stream_notused,$msg_num,$flags);

                        // EXTREMELY BASIC part handling
                        // handle request for top level message headers
                        if ((int)$part_num == 0)
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning top-level headers, part '.$part_num.', internally 
['.$the_part.']<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning top-level headers, part '.$part_num.', internally 
['.$the_part.']<br />'; }
                                // grab the headers, as a glob, i.e. a string 
NOT an array
                                $header_glob = 
$this->get_header_raw($stream_notused,$msg_num,'');
                                // put this data in the var we will return below
@@ -2116,16 +2116,16 @@
                                $the_part = (int)$part_num;
                                $the_part = $the_part - 1;
                                // return part one
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning part '.$part_num.', internally ['.$the_part.']<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning part '.$part_num.', internally ['.$the_part.']<br />'; }

                                $tmp_msg_structure_parts = 
$this->msg_structure->parts[$the_part];

                                if 
((address@hidden($tmp_msg_structure_parts->custom['part_start']))
                                || 
(!isset($tmp_msg_structure_parts->custom['part_start'])))
                                {
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: ERROR: required part data not present for '.$part_num.', 
internally ['.$the_part.']<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: ERROR: required part data not present for '.$part_num.', 
internally ['.$the_part.']<br />'; }
                                        // screw it, just return the whole thing
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody - using fallback pass thru<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody - using fallback pass thru<br />'; }
                                        $body_blob = 
$this->get_body($stream_notused,$msg_num,$flags,False);
                                }
                                else
@@ -2133,7 +2133,7 @@
                                        // attempt to make the part
                                        $part_start = 
(int)$tmp_msg_structure_parts->custom['part_start'];
                                        $part_end = 
(int)$tmp_msg_structure_parts->custom['part_end'];
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: returning part '.$part_num.' starts ['.$part_start.'] ends 
['.$part_end.']<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: returning part '.$part_num.' starts ['.$part_start.'] ends 
['.$part_end.']<br />'; }
                                        // assemble the body [art part
                                        $body_blob = '';
                                        for($i=$part_start;$i < 
$part_end+1;$i++)
@@ -2165,13 +2165,13 @@
                                        $temp_part = $target_part;
                                }
                                // verify part data exists
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning part '.$part_num.', internally 
['.serialize($the_part_array).']<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning part '.$part_num.', internally 
['.serialize($the_part_array).']<br />'; }
                                if ((!isset($target_part->custom['part_start']))
                                || (!isset($target_part->custom['part_start'])))
                                {
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: ERROR: required part data not present for '.$part_num.', 
internally ['.serialize($the_part).']<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: ERROR: required part data not present for '.$part_num.', 
internally ['.serialize($the_part).']<br />'; }
                                        // screw it, just return the whole thing
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody - using fallback pass thru<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody - using fallback pass thru<br />'; }
                                        $body_blob = 
$this->get_body($stream_notused,$msg_num,$flags,False);
                                }
                                else
@@ -2179,7 +2179,7 @@
                                        // attempt to make the part
                                        $part_start = 
(int)$target_part->custom['part_start'];
                                        $part_end = 
(int)$target_part->custom['part_end'];
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: returning part '.$part_num.' starts ['.$part_start.'] ends 
['.$part_end.']<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: returning part '.$part_num.' starts ['.$part_start.'] ends 
['.$part_end.']<br />'; }
                                        // assemble the body [art part
                                        $body_blob = '';
                                        for($i=$part_start;$i < 
$part_end+1;$i++)
@@ -2191,12 +2191,12 @@
                        else
                        {
                                // screw it, just return the whole thing
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody - something is unsupported, using fallback pass thru<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody - something is unsupported, using fallback pass thru<br />'; }
                                // the false arg here is a temporary, custom 
option, says to NOT include the headers in the return
                                $body_blob = 
$this->get_body($stream_notused,$msg_num,$flags,False);
                        }

-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetchbody<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
fetchbody<br />'; }
                        return $body_blob;
                }

@@ -2217,7 +2217,7 @@
                function 
get_body($stream_notused,$msg_num,$flags='',$phpgw_include_header=True)
                {
                        // NEEDED: code for flags: FT_UID; maybe FT_INTERNAL; 
FT_NOT; flag FT_PEEK has no effect on POP3
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_body<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_body<br />'; }

                        // do we have a cached body_array ?
                        if ((count($this->body_array) > 0)
@@ -2226,7 +2226,7 @@
                        && (count($this->header_array) > 0)
                        && ((int)$this->header_array_msgnum == (int)($msg_num)))
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
get_body: using cached body_array and header_array data imploded into a 
glob<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
get_body: using cached body_array and header_array data imploded into a glob<br 
/>'; }
                                // implode the header_array into a glob
                                $header_glob = 
implode("\r\n",$this->header_array);
                                // implode the body_array into a glob
@@ -2234,13 +2234,13 @@
                        }
                        else
                        {
-                               if ($this->debug_dcom >= 1) { echo 'pop3: 
get_body: NO Cached Data<br>'; }
+                               if ($this->debug_dcom >= 1) { echo 'pop3: 
get_body: NO Cached Data<br />'; }
                                // NO cached data we can use
                                // issue command to retrieve body
                                if (!$this->msg2socket('RETR 
'.$msg_num,"^\+ok",&$response))
                                {
                                        $this->error();
-                                       if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving get_body with error<br>'; }
+                                       if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving get_body with error<br />'; }
                                        return False;
                                }
                                // ---  Get Header  ---
@@ -2274,13 +2274,13 @@
                        /*
                        if ($this->debug_dcom >= 2)
                        {
-                               echo 'pop3: get_body DUMP<br>= = = First DUMP: 
header_glob<br>';
-                               echo 
'<pre>'.htmlspecialchars($header_glob).'</pre><br><br>';
-                               echo 'pop3: get_body DUMP<br>= = = Second DUMP: 
body_glob<br>';
-                               echo 
'<pre>'.htmlspecialchars($body_glob).'</pre><br><br>';
+                               echo 'pop3: get_body DUMP<br />= = = First 
DUMP: header_glob<br />';
+                               echo 
'<pre>'.htmlspecialchars($header_glob).'</pre><br /><br />';
+                               echo 'pop3: get_body DUMP<br />= = = Second 
DUMP: body_glob<br />';
+                               echo 
'<pre>'.htmlspecialchars($body_glob).'</pre><br /><br />';
                        }
                        */
-                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
get_body<br>'; }
+                       if ($this->debug_dcom >= 1) { echo 'pop3: Leaving 
get_body<br />'; }
                        return $body_glob;
                }
        }

====================================================
Index: email/inc/class.uijsaddressbook.inc.php
diff -u email/inc/class.uijsaddressbook.inc.php:1.4 
email/inc/class.uijsaddressbook.inc.php:1.5
--- email/inc/class.uijsaddressbook.inc.php:1.4 Thu Dec 30 23:13:50 2004
+++ email/inc/class.uijsaddressbook.inc.php     Sun Mar 13 23:22:44 2005
@@ -468,7 +468,7 @@
                        }
                        //Get our category id
                        $this->cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? 
$GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
-                       //print "<br> ".$this->cat_id;
+                       //print "<br /> ".$this->cat_id;
                        //Check if we have to check in the cache
                        if($this->cat_id == -1)
                        {
@@ -620,7 +620,7 @@
                                                            'sort' => 
$this->sort,
                                                            'directory_uid' => 
$this->globaladduid
                                                            );
-       //              print "<BR>";
+       //              print "<br />";
        //              print_r($contactquery);



====================================================
Index: email/inc/class.uimessage.inc.php
diff -u email/inc/class.uimessage.inc.php:1.12 
email/inc/class.uimessage.inc.php:1.13
--- email/inc/class.uimessage.inc.php:1.12      Thu Dec 30 23:13:50 2004
+++ email/inc/class.uimessage.inc.php   Sun Mar 13 23:22:44 2005
@@ -35,13 +35,13 @@

                /*!
                @function message
-               @abstract display the message indicated by the msgball data.
+               @abstract display the message indicated by the msgball data.
                */
                function message()
                {
                        $this->bo = CreateObject("email.bomessage");
                        $this->bo->message_data();
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we point to the global template for this 
version of phpgw templatings
@@ -53,7 +53,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // NOW we can out the header, because 
"index_data()" filled this global
@@ -72,7 +72,7 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        // ---- BEGIN UIMESSAGE
                        $this->tpl->set_file(array(
                                'T_message_main' => 'message_main.tpl',
@@ -85,13 +85,13 @@
                        
$this->tpl->set_block('T_message_main','B_display_part','V_display_part');
                        
$this->tpl->set_block('T_message_echo_dump','B_setup_echo_dump','V_setup_echo_dump');
                        
$this->tpl->set_block('T_message_echo_dump','B_done_echo_dump','V_done_echo_dump');
-
-                       //= = = = TOOLBAR WIDGET = = =
+
+                       //= = = = TOOLBAR WIDGET = = =
                        $this->widgets = CreateObject('email.html_widgets');
                        
$this->tpl->set_var('widget_toolbar',$this->widgets->get_toolbar());
                        // geek_bar
                        
$this->tpl->set_var('geek_bar',$this->widgets->get_geek_bar());
-
+
                        if (!empty($this->xi['msgtype']))
                        {
                                
$this->tpl->set_var('application',$this->bo->xi['application']);
@@ -101,18 +101,18 @@
                        {
                                $this->tpl->set_var('V_x-phpgw-type','');
                        }
-
+
                        //  ----  TOOL BAR / MENU BAR ----
                        $tpl_vars = Array(
                                //'accounts_label'              => 
$this->bo->xi['accounts_label'],
                                //'ctrl_bar_font'                       => 
$this->bo->xi['ctrl_bar_font'],
                                //'ctrl_bar_font_size'  => 
$this->bo->xi['ctrl_bar_font_size'],
                                //'ctrl_bar_back1'              => 
$this->bo->xi['ctrl_bar_back1'],
-
+
                                'bar_back1'             => '',
                                //'bar_back1'           => 
$GLOBALS['phpgw_info']['theme']['table_bg'],
                                //'bar_back1'           => 
$GLOBALS['phpgw_info']['theme']['bg08'],
-
+
                                // ---- account switchbox  ----
                                //'acctbox_listbox'             => 
$this->bo->xi['acctbox_listbox'],
                                //'ilnk_accounts'                       => 
$this->bo->xi['ilnk_accounts'],
@@ -123,24 +123,24 @@
                                'move_current_order'    => 
$this->bo->xi['move_current_order'],
                                'move_current_start'    => 
$this->bo->xi['move_current_start'],
                                'mlist_checkbox_name'   => 
$this->bo->xi['mlist_checkbox_name'],
-
+
                                'mlist_embedded_uri'    => 
$this->bo->xi['mlist_embedded_uri'],
                                'frm_delmov_action'             => 
$this->bo->xi['frm_delmov_action'],
                                'frm_delmov_name'               => 
$this->bo->xi['frm_delmov_name'],
                                'delmov_listbox'                => 
$this->bo->xi['delmov_listbox'],
                                'move_postmove_goto_name'       => 
$this->bo->xi['move_postmove_goto_name'],
                                'move_postmove_goto_value'      => 
$this->bo->xi['move_postmove_goto_value'],
-
+
                                // moved to case block for text, image, or text 
and image pref
                                //'ilnk_prev_msg'                       => 
$this->bo->xi['ilnk_prev_msg'],
                                //'ilnk_next_msg'                       => 
$this->bo->xi['ilnk_next_msg'],
-
+
                                // ----  Labels and Colors for From, To, CC, 
Files, and Subject  -----
                                'tofrom_labels_bkcolor' => 
$this->bo->xi['tofrom_labels_bkcolor'],
                                'tofrom_labels_class'   => 
$this->bo->xi['tofrom_labels_class'],
                                'tofrom_data_bkcolor'   => 
$this->bo->xi['tofrom_data_bkcolor'],
                                'tofrom_data_class'     => 
$this->bo->xi['tofrom_data_class'],
-
+
                                'lang_inbox_folder'     => 
$this->bo->xi['lang_inbox'],
                                'lang_from'             => 
$this->bo->xi['lang_from'],
                                'lang_to'               => 
$this->bo->xi['lang_to'],
@@ -148,14 +148,14 @@
                                'lang_date'             => 
$this->bo->xi['lang_date'],
                                'lang_files'    => $this->bo->xi['lang_files'],
                                'lang_subject'  => 
$this->bo->xi['lang_subject'],
-
+
                                // ----  From:  Message Data  -----
                                'from_data_final'               => 
$this->bo->xi['from_data_final'],
                                // ----  To:  Message Data  -----
                                'to_data_final'                 => 
$this->bo->xi['to_data_final']
                        );
                        $this->tpl->set_var($tpl_vars);
-
+
                        // ----  Cc:  Message Data  -----
                        //if (isset($msg_headers->cc) && 
count($msg_headers->cc) > 0)
                        //      $this->bo->xi['
@@ -169,12 +169,12 @@
                        {
                                $this->tpl->set_var('V_cc_data','');
                        }
-
+
                        // ---- Message Date  (set above)  -----
                        
$this->tpl->set_var('message_date',$this->bo->xi['message_date']);
                        // ---- Message Subject  (set above)  -----
                        
$this->tpl->set_var('message_subject',$this->bo->xi['message_subject']);
-
+
                        // ---- Attachments List  -----
                        if ($this->bo->xi['list_of_files'] != '')
                        {
@@ -185,8 +185,8 @@
                        {
                                $this->tpl->set_var('V_attach_list','');
                        }
-
-
+
+
                        $tpl_vars = Array(
                                // ----  Images and Hrefs For Reply, ReplyAll, 
Forward, and Delete  -----
                                'theme_font'            => 
$this->bo->xi['theme_font'],
@@ -194,7 +194,7 @@
                                'theme_row_on'          => 
$this->bo->xi['theme_row_on'],
                                'reply_btns_bkcolor' => 
$this->bo->xi['reply_btns_bkcolor'],
                                'reply_btns_text'       => 
$this->bo->xi['reply_btns_text'],
-
+
                                'go_back_to'            => 
$this->bo->xi['lang_go_back_to'],
                                'lnk_goback_folder'     => 
$this->bo->xi['lnk_goback_folder'],
                                // moved to case block for text, image, or text 
and image pref
@@ -204,8 +204,8 @@
                                //'ilnk_delete'         => 
$this->bo->xi['ilnk_delete']
                        );
                        $this->tpl->set_var($tpl_vars);
-
-
+
+
                        // ---- DEBUG: Show Information About Each Part  -----
                        //  the debug output needs updating
                        if ($this->bo->debug > 0)
@@ -217,12 +217,12 @@
                        {
                                $this->tpl->set_var('V_debug_parts','');
                        }
-
+
                        // -----  Message_Display Template Handles it from here 
 -------
                        
$this->tpl->set_var('theme_font',$this->bo->xi['theme_font']);
                        
$this->tpl->set_var('theme_th_bg',$this->bo->xi['theme_th_bg']);
                        
$this->tpl->set_var('theme_row_on',$this->bo->xi['theme_row_on']);
-
+
                        // ----  so called "TOOLBAR" between the msg header 
data and the message siaplay
                        switch 
($GLOBALS['phpgw']->msg->get_pref_value('button_type'))
                        {
@@ -240,10 +240,12 @@
                                        
$this->tpl->set_var('href_replyall',$this->bo->xi['href_replyall']);
                                        
$this->tpl->set_var('href_forward',$this->bo->xi['href_forward']);
                                        
$this->tpl->set_var('href_delete',$this->bo->xi['href_delete']);
+                                       
$this->tpl->set_var('href_edit',$this->bo->xi['href_edit']);
                                        $this->tpl->set_var('ilnk_reply','');
                                        $this->tpl->set_var('ilnk_replyall','');
                                        $this->tpl->set_var('ilnk_forward','');
                                        $this->tpl->set_var('ilnk_delete','');
+                                       $this->tpl->set_var('ilnk_edit', '');
                                        
$this->tpl->set_var('href_prev_msg',$this->bo->xi['href_prev_msg']);
                                        
$this->tpl->set_var('href_next_msg',$this->bo->xi['href_next_msg']);
                                        
//$this->tpl->set_var('text_nbsp','&nbsp;');
@@ -264,10 +266,12 @@
                                        $this->tpl->set_var('href_replyall','');
                                        $this->tpl->set_var('href_forward','');
                                        $this->tpl->set_var('href_delete','');
+                                       $this->tpl->set_var('href_edit','');
                                        
$this->tpl->set_var('ilnk_reply',$this->bo->xi['ilnk_reply']);
                                        
$this->tpl->set_var('ilnk_replyall',$this->bo->xi['ilnk_replyall']);
                                        
$this->tpl->set_var('ilnk_forward',$this->bo->xi['ilnk_forward']);
                                        
$this->tpl->set_var('ilnk_delete',$this->bo->xi['ilnk_delete']);
+                                       $this->tpl->sey_var('ilnk_edit', 
$this->bo->xi['ilnk_edit']);
                                        $this->tpl->set_var('href_prev_msg','');
                                        $this->tpl->set_var('href_next_msg','');
                                        //$this->tpl->set_var('text_nbsp','');
@@ -289,10 +293,12 @@
                                        
$this->tpl->set_var('href_replyall',$this->bo->xi['href_replyall']);
                                        
$this->tpl->set_var('href_forward',$this->bo->xi['href_forward']);
                                        
$this->tpl->set_var('href_delete',$this->bo->xi['href_delete']);
+                                       
$this->tpl->set_var('href_edit',$this->bo->xi['href_edit']);
                                        
$this->tpl->set_var('ilnk_reply',$this->bo->xi['ilnk_reply']);
                                        
$this->tpl->set_var('ilnk_replyall',$this->bo->xi['ilnk_replyall']);
                                        
$this->tpl->set_var('ilnk_forward',$this->bo->xi['ilnk_forward']);
                                        
$this->tpl->set_var('ilnk_delete',$this->bo->xi['ilnk_delete']);
+                                       $this->tpl->set_var('ilnk_edit', 
$this->bo->xi['ilnk_edit']);
                                        $this->tpl->set_var('href_prev_msg','');
                                        $this->tpl->set_var('href_next_msg','');
                                        
//$this->tpl->set_var('href_prev_msg',$this->bo->xi['href_prev_msg']);
@@ -303,16 +309,29 @@
                                        break;
                        }

-
+                       if( !$this->bo->flags['Draft']
+                               && ( ( 
$GLOBALS['phpgw']->msg->get_pref_value('mail_server_type') != 'imap' //if not 
imap/s skip
+                                       && 
$GLOBALS['phpgw']->msg->get_pref_value('mail_server_type') == 'imaps' )
+                                       || ( 
!$GLOBALS['phpgw']->msg->get_pref_value('use_sent_folder')
+                                       || 
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_arg_value('folder'))
+                                               != 
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_pref_value('sent_folder_name'))
 )
+                               )
+                       )
+                       {
+                               $this->tpl->set_block('T_message_main', 
'edit_message', 'edit_msg');
+                               $this->tpl->set_var('edit_msg', '');
+                       }
+
+
                        // -----  SHOW MESSAGE  -------
                        //@set_time_limit(120);
-
+
                        //if ($GLOBALS['phpgw']->msg->phpgw_before_xslt == 
False)
                        //{
                                // fix a b0rk in template showing last item 2 
times under XSLT
                                $final_V_display_part = '';
                        //}
-
+
                        $count_part_nice = count($this->bo->part_nice);
                        for ($i = 0; $i < $count_part_nice; $i++)
                        {
@@ -338,18 +357,18 @@
                                        
$this->tpl->set_var('V_display_part','');
                                        // -----  Finished With Message_Mail 
Template, Output It
                                        $this->tpl->pfp('out','T_message_main');
-
+
                                        // -----  Prepare a Table for this Echo 
Dump
                                        
$this->tpl->set_var('title_text',$this->bo->part_nice[$i]['title_text']);
                                        
$this->tpl->set_var('display_str',$this->bo->part_nice[$i]['display_str']);
                                        
$this->tpl->parse('V_setup_echo_dump','B_setup_echo_dump');
                                        
$this->tpl->set_var('V_done_echo_dump','');
                                        
$this->tpl->pfp('out','T_message_echo_dump');
-
+
                                        // -----  Prepare $msgball data for 
phpgw_fetchbody()
                                        $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
                                        $msgball['part_no'] = 
$this->bo->part_nice[$i]['m_part_num_mime'];
-
+
                                        // -----  Echo This Data Directly to 
the Client
                                        // since the php version of this of 
b0rked for large msgs, perhaps use sockets code?
                                        echo '<pre>';
@@ -359,14 +378,14 @@
                                        
$this->tpl->set_var('V_setup_echo_dump','');
                                        
$this->tpl->parse('V_done_echo_dump','B_done_echo_dump');
                                        
$this->tpl->pfp('out','T_message_echo_dump');
-
+
                                        //  = = = =  = =======  CLEANUP AND 
EXIT PAGE ======= = = = = = =
                                        $did_echo_dump = True;
                                        break;
                                }
                        }
                        //@set_time_limit(0);
-
+
                        //if ($GLOBALS['phpgw']->msg->phpgw_before_xslt == 
False)
                        //{
                        //      // fix a b0rk in template showing last item 2 
times under XSLT
@@ -374,10 +393,10 @@
                                $final_V_display_part = '';
                                unset($final_V_display_part);
                        //}
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
-
+
                        if ((isset($did_echo_dump))
                        && ($did_echo_dump == True))
                        {
@@ -407,7 +426,7 @@
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
-
+
                        // ralfbecker patch dated 021124
                        if (isset($this->bo->xi['application']))
                        {
@@ -433,18 +452,18 @@
                        $GLOBALS['phpgw']->msg = '';
                        unset($GLOBALS['phpgw']->msg);
                }
-
+
                /*!
                @function printable
-               @abstract display the message indicated by the msgball data in 
Printer Friendly style.
-               @author Angles
+               @abstract display the message indicated by the msgball data in 
Printer Friendly style.
+               @author Angles
                */
                function printable()
                {
                        // get the data we need to fill the template
                        $this->bo = CreateObject("email.bomessage");
                        $this->bo->message_data();
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we point to the global template for this 
version of phpgw templatings
@@ -457,7 +476,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                $GLOBALS['phpgw_info']['flags']['noheader'] = 
True;
@@ -469,19 +488,19 @@
                        {
                                $GLOBALS['phpgw_info']['flags']['printview'] = 
True;
                                $GLOBALS['phpgw_info']['flags']['headonly'] = 
True;
-
+
                                //$GLOBALS['phpgw_info']['navbar'] = '';
-
+
                                
//$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
-
+
                                // FIXME how to get rid of other template stuff 
here for XSLT?
                                $GLOBALS['phpgw_info']['flags']['noheader'] = 
True;
                                $GLOBALS['phpgw_info']['flags']['nonavbar'] = 
True;
                                $GLOBALS['phpgw_info']['flags']['noappheader'] 
= True;
                                $GLOBALS['phpgw_info']['flags']['noappfooter'] 
= True;
                        }
-
-
+
+
                        $this->tpl->set_file(array(
                                'T_message_printable' => 
'message_printable.tpl',
                                'T_message_echo_dump' => 'message_echo_dump.tpl'
@@ -491,14 +510,14 @@
                        
$this->tpl->set_block('T_message_printable','B_display_part','V_display_part');
                        
$this->tpl->set_block('T_message_echo_dump','B_setup_echo_dump','V_setup_echo_dump');
                        
$this->tpl->set_block('T_message_echo_dump','B_done_echo_dump','V_done_echo_dump');
-
+
                        $tpl_vars = Array(
                                'user_fullname' => 
$GLOBALS['phpgw_info']['user']['fullname'],
                                'font_family'   => $this->bo->xi['theme_font'],
                                'theme_font'    => $this->bo->xi['theme_font'],
                                // in the echo out template, this is a TD 
background color
                                'theme_row_on'  => '#ffffff',
-
+
                                'lang_from'             => 
$this->bo->xi['lang_from'],
                                'lang_to'               => 
$this->bo->xi['lang_to'],
                                'lang_cc'               => 
$this->bo->xi['lang_cc'],
@@ -518,7 +537,7 @@
                                'page_title'    => 
$this->bo->xi['message_subject'],
                        );
                        $this->tpl->set_var($tpl_vars);
-
+
                        // ----  Cc:  Message Data  -----
                        //if (isset($msg_headers->cc) && 
count($msg_headers->cc) > 0)
                        //      $this->bo->xi['
@@ -532,7 +551,7 @@
                        {
                                $this->tpl->set_var('V_cc_data','');
                        }
-
+
                        // ---- Attachments List  -----
                        if ($this->bo->xi['list_of_files'] != '')
                        {
@@ -543,7 +562,7 @@
                        {
                                $this->tpl->set_var('V_attach_list','');
                        }
-
+
                        // -----  SHOW MESSAGE  -------
                        //@set_time_limit(120);
                        $count_part_nice = count($this->bo->part_nice);
@@ -562,18 +581,18 @@
                                        
$this->tpl->set_var('V_display_part','');
                                        // -----  Finished With Message_Mail 
Template, Output It
                                        
$this->tpl->pfp('out','T_message_printable');
-
+
                                        // -----  Prepare a Table for this Echo 
Dump
                                        
$this->tpl->set_var('title_text',$this->bo->part_nice[$i]['title_text']);
                                        
$this->tpl->set_var('display_str',$this->bo->part_nice[$i]['display_str']);
                                        
$this->tpl->parse('V_setup_echo_dump','B_setup_echo_dump');
                                        
$this->tpl->set_var('V_done_echo_dump','');
                                        
$this->tpl->pfp('out','T_message_echo_dump');
-
+
                                        // -----  Prepare $msgball data for 
phpgw_fetchbody()
                                        $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
                                        $msgball['part_no'] = 
$this->bo->part_nice[$i]['m_part_num_mime'];
-
+
                                        // -----  Echo This Data Directly to 
the Client
                                        // since the php version of this of 
b0rked for large msgs, perhaps use sockets code?
                                        echo '<pre>';
@@ -583,14 +602,14 @@
                                        
$this->tpl->set_var('V_setup_echo_dump','');
                                        
$this->tpl->parse('V_done_echo_dump','B_done_echo_dump');
                                        
$this->tpl->pfp('out','T_message_echo_dump');
-
+
                                        //  = = = =  = =======  CLEANUP AND 
EXIT PAGE ======= = = = = = =
                                        $did_echo_dump = True;
                                        break;
                                }
                        }
                        //@set_time_limit(0);
-
+
                        if ((isset($did_echo_dump))
                        && ($did_echo_dump == True))
                        {
@@ -613,14 +632,14 @@
                                echo "</body> \r\n";
                                echo "</html> \r\n";
                                ////$this->tpl->set_unknowns('remove');
-
+
                                $data = array();
                                //$data['appname'] = lang('E-Mail');
                                //$data['function_msg'] = lang('show message');
                                //$data['email_page'] = 
$this->tpl->parse('out','T_message_printable');
                                
//$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                        }
-
+
                        if (is_object($GLOBALS['phpgw']->msg))
                        {
                                // close down ALL mailserver streams
@@ -632,6 +651,6 @@
                        // shut down this transaction
                        $GLOBALS['phpgw']->common->phpgw_exit(False);
                }
-
+
        }
 ?>

====================================================
Index: email/inc/class.uiindex.inc.php
diff -u email/inc/class.uiindex.inc.php:1.23 
email/inc/class.uiindex.inc.php:1.24
--- email/inc/class.uiindex.inc.php:1.23        Thu Dec 30 23:13:50 2004
+++ email/inc/class.uiindex.inc.php     Sun Mar 13 23:22:44 2005
@@ -14,7 +14,7 @@

        class uiindex
        {
-               var $bo;
+               var $bo;
                var $debug = False;
                var $widgets;
                var $tpl;
@@ -28,22 +28,22 @@
                {
                        //return;
                }
-
+
                /*!
                @function index
                @abstract assembles data used for the index page, the list of 
messages in a folder
                @author Angles
-               @description Uses the BO to do the work, then this hands off 
the disply handling
-               to either the old phplib template handling or the new xslt 
handler index_ function.
+               @description Uses the BO to do the work, then this hands off 
the disply handling
+               to either the old phplib template handling or the new xslt 
handler index_ function.
                */
                function index()
                {
-                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'email';
+                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'email';
                        print_debug('relevant phpgw_info data', 
$GLOBALS['phpgw_info']['user']['preferences']['email']);
-
+
                        $this->bo = CreateObject('email.boindex');
                        $this->bo->index_data();
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                $this->index_old_tpl();
@@ -53,7 +53,7 @@
                                $this->index_xslt_tpl();
                        }
                }
-
+
                /*!
                @function index_old_tpl
                @abstract assembles data used for the index page, the list of 
messages in a folder
@@ -61,10 +61,10 @@
                @description ?
                */
                function index_old_tpl()
-               {
+               {
                        // we point to the global template for this version of 
phpgw templatings
                        $this->tpl =& $GLOBALS['phpgw']->template;
-
+
                        // NOW we can out the header, because "index_data()" 
filled this global
                        //      
$GLOBALS['phpgw_info']['flags']['email_refresh_uri']
                        // which is needed to preserve folder and sort settings 
during the auto-refresh-ing
@@ -77,11 +77,11 @@
                        // HOWEVER still this class must NOT invoke 
$GLOBALS['phpgw']->common->phpgw_header()
                        // even though we had to output the header (go 
figure... :)
                        // later: What does that mean ?
-
+
                        $this->bo->xi['my_layout'] = 
$GLOBALS['phpgw']->msg->get_pref_value('layout');
                        $this->bo->xi['my_browser'] = 
$GLOBALS['phpgw']->msg->browser;
-
-                       $this->tpl->set_file(array(
+
+                       $this->tpl->set_file(array(
                                //'T_form_delmov_init' => 
'index_form_delmov_init.tpl',
                                'T_index_blocks' => 'index_blocks.tpl',
                                'T_index_main' => 
'index_main_b'.$this->bo->xi['my_browser'].'_l'.$this->bo->xi['my_layout']. 
'.tpl'
@@ -90,17 +90,18 @@
                        
//$this->tpl->set_block('T_index_main','B_show_size','V_show_size');
                        
//$this->tpl->set_block('T_index_main','B_get_size','V_get_size');
                        
//$this->tpl->set_block('T_index_blocks','B_stats_layout2','V_stats_layout2');
+                       
$this->tpl->set_block('T_index_main','B_empty_trash','V_empty_trash');
                        
$this->tpl->set_block('T_index_main','B_no_messages','V_no_messages');
                        
$this->tpl->set_block('T_index_main','B_msg_list','V_msg_list');
                        
$this->tpl->set_block('T_index_blocks','B_mlist_form_init','V_mlist_form_init');
                        
$this->tpl->set_block('T_index_blocks','B_arrows_form_table','V_arrows_form_table');
-
+
                        
$this->tpl->set_var('frm_delmov_action',$this->bo->xi['frm_delmov_action']);
                        
$this->tpl->set_var('frm_delmov_name',$this->bo->xi['frm_delmov_name']);
                        
$this->tpl->parse('V_mlist_form_init','B_mlist_form_init');
-                       $this->bo->xi['V_mlist_form_init'] = 
$this->tpl->get_var('V_mlist_form_init');
-
-
+                       $this->bo->xi['V_mlist_form_init'] = 
$this->tpl->get_var('V_mlist_form_init');
+
+
                        $tpl_vars = Array(
                                // fonts and font sizes
                        //      'ctrl_bar_font'         => 
$this->bo->xi['ctrl_bar_font'],
@@ -115,7 +116,7 @@
                                'hdr_font_size'         => 
$this->bo->xi['hdr_font_size'],
                                'hdr_font_size_sm'      => 
$this->bo->xi['hdr_font_size_sm'],
                                'ftr_font'              => 
$this->bo->xi['ftr_font'],
-                               // other message list stuff, we parse the mlist 
block before the rest of the tpl vars are needed
+                               // other message list stuff, we parse the mlist 
block before the rest of the tpl vars are needed
                                'mlist_newmsg_char'     => 
$this->bo->xi['mlist_newmsg_char'],
                                'mlist_newmsg_color'    => 
$this->bo->xi['mlist_newmsg_color'],
                                'mlist_newmsg_txt'      => 
$this->bo->xi['mlist_newmsg_txt'],
@@ -127,13 +128,34 @@
                                'compose_text'          => 
$this->bo->xi['compose_text'],
                                'compose_link'          => 
$this->bo->xi['compose_link'],
                                'compose_img'           => 
$this->bo->xi['compose_img'],
-                               'compose_clickme'               => 
$this->bo->xi['compose_clickme'],
+                               'compose_clickme'       => 
$this->bo->xi['compose_clickme'],
                                'auto_refresh_widget'   => 
$this->bo->xi['auto_refresh_widget']
-
+
                        );
                        $this->tpl->set_var($tpl_vars);

-                       //= = = = TESTING NEW TOOLBAR WIDGET = = =
+                       if( 
($GLOBALS['phpgw']->msg->get_pref_value('mail_server_type') == 'imap' //if not 
imap/s skip
+                                       || 
$GLOBALS['phpgw']->msg->get_pref_value('mail_server_type') == 'imaps' )
+                               && 
$GLOBALS['phpgw']->msg->get_pref_value('use_trash_folder') //no trash then 
pointless
+                               && 
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_arg_value('folder'))
+                                        == 
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_pref_value('trash_folder_name')))//not
 trash folder then don't show
+                       {
+                               $this->tpl->set_var(
+                                               array(
+                                                       'lang_empty_trash'      
=> $this->bo->xi['lang_empty_trash'],
+                                                       'empty_trash_link'      
=> $this->bo->xi['empty_trash_link'],
+                                                       'lang_empty_trash_warn' 
=> $this->bo->xi['lang_empty_trash_warn']
+                                               )
+                                       );
+                               $this->tpl->parse('V_empty_trash', 
'B_empty_trash');
+                       }
+                       else
+                       {
+                               $this->tpl->set_var('V_empty_trash', '');
+                       }
+
+
+                       //= = = = TESTING NEW TOOLBAR WIDGET = = =
                        $this->widgets = CreateObject('email.html_widgets');
                        // this will have a msg to the user if messages were 
moved or deleted
                        
$this->widgets->set_toolbar_msg($GLOBALS['phpgw']->msg->report_moved_or_deleted());
@@ -141,7 +163,7 @@
                        
$this->tpl->set_var('geek_bar',$this->widgets->get_geek_bar());
                        // stats row, generated in a single function call
                        $this->tpl->set_var('stats_data_display', 
$this->bo->get_index_stats_block((string)$GLOBALS['phpgw']->msg->get_pref_value('layout')));
-
+
                        if ($this->bo->xi['folder_info']['number_all'] == 0)
                        {
                                $tpl_vars = Array(
@@ -157,9 +179,9 @@
                        else
                        {
                                $this->tpl->set_var('V_no_messages','');
-
+
                                
$this->tpl->set_var('stats_last',$this->bo->xi['totaltodisplay']);
-
+
                                for ($i=0; $i < 
count($this->bo->xi['msg_list_dsp']); $i++)
                                {
                                        if 
($this->bo->xi['msg_list_dsp'][$i]['first_item'])
@@ -170,7 +192,7 @@
                                        {
                                                
$this->tpl->set_var('V_mlist_form_init', '');
                                        }
-                                       // new, unseen
+                                       // new, unseen
                                        if 
($this->bo->xi['msg_list_dsp'][$i]['is_unseen'])
                                        {
                                                
$this->tpl->set_var('mlist_new_msg',$this->bo->xi['mlist_new_msg']);
@@ -223,7 +245,7 @@
                                                $all_flags_images .= 
$this->bo->xi['deleted_img'];
                                        }
                                        
$this->tpl->set_var('all_flags_images',$all_flags_images);
-
+
                                        // are we IN THE SENT folder or not
                                        if (    
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_arg_value('folder'))
                                         != 
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_pref_value('sent_folder_name')))
@@ -385,10 +407,10 @@
                                $this->tpl->set_var('V_show_size','');
                        }
                        */
-
+
                        // new way to handle debug data, if this array has 
anything, put it in the template source data vars
                        
$this->tpl->set_var('debugdata',$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
-
+
                        // COMMENT NEXT LINE OUT for producvtion use, (unknowns 
should be "remove"d in production use)
                        $this->tpl->set_unknowns('comment');
                        // production use, use this:    
$this->tpl->set_unknowns("remove");
@@ -396,7 +418,7 @@
                        $this->tpl->pfp('out','T_index_main');
                        // note, for some reason, eventhough it seems we 
*should* call common->phpgw_footer(),
                        // if we do that, the client browser will get TWO page 
footers, so we do not call it here
-
+
                        // close down ALL mailserver streams
                        $GLOBALS['phpgw']->msg->end_request();
                        // destroy the object
@@ -413,19 +435,19 @@
                function index_xslt_tpl()
                {
                        $GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
-
+
                        $this->bo->xi['my_layout'] = 
$GLOBALS['phpgw']->msg->get_pref_value('layout');
                        $this->bo->xi['my_browser'] = 
$GLOBALS['phpgw']->msg->browser;
-
+
                        //$this->bo->xi['compose_text'] = lang('Compose');
-
-                       //= = = =  TOOLBAR WIDGET = = =
+
+                       //= = = =  TOOLBAR WIDGET = = =
                        $this->widgets = CreateObject('email.html_widgets');
                        // this will have a msg to the user if messages were 
moved or deleted
                        
$this->widgets->set_toolbar_msg($GLOBALS['phpgw']->msg->report_moved_or_deleted());
                        $widget_toolbar = $this->widgets->get_toolbar();
                        $geek_bar = $this->widgets->get_geek_bar();
-
+
                        $data = array(
                                //'appname' => lang('E-Mail'),
                                //'function_msg' => lang('list messages'),
@@ -467,12 +489,12 @@
                        );
                        // new way to handle debug data, if this array has 
anything, put it in the template source data vars
                        $data['debugdata'] = 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone();
-
+
                        $GLOBALS['phpgw_info']['flags']['email']['app_header'] 
= lang('E-Mail') . ': ' . lang('list messages');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('E-Mail') . ': ' . lang('list messages');
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('index' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
-
+
                        // close down ALL mailserver streams
                        $GLOBALS['phpgw']->msg->end_request();
                        // destroy the object
@@ -482,13 +504,13 @@

                /*!
                @function index_xslt_javascript
-               @abstract xsl file does not seem to like this stuff in it, so 
put it here.
+               @abstract xsl file does not seem to like this stuff in it, so 
put it here.
                @author Angles
                @description ?
                */
                function index_xslt_javascript()
                {
-                       // I think indenting screws this up
+                       // I think indenting screws this up
 $index_js = <<<EOD

 <script type="text/javascript">
@@ -520,15 +542,15 @@
                        } else {
                                document.delmov.elements[i].checked = true;
                        }
-               }
+               }
        }
 }
 </script>
 EOD;
                        return $index_js;
                }
-
-
+
+
                // DISPLAY A PRE-DEFINED MESSAGE SET ARRAY
                /*!
                @function mlist  DEPRECIATED
@@ -539,11 +561,11 @@
                function mlist()
                {
                        //raw HTTP_POST_VARS dump
-                       //echo 'HTTP_POST_VARS print_r dump:<b><pre>'."\r\n"; 
print_r($GLOBALS['HTTP_POST_VARS']); echo '</pre><br><br>'."\r\n";
-
+                       //echo 'HTTP_POST_VARS print_r dump:<b><pre>'."\r\n"; 
print_r($GLOBALS['HTTP_POST_VARS']); echo '</pre><br /><br />'."\r\n";
+
                        $this->bo = CreateObject("email.boindex");
                        $this->bo->mlist_data();
-
+
                        // we are the BO and the UI, we take care of outputting 
the HTML to the client browser
                        // NOW we can out the header, because "index_data()" 
filled this global
                        //      
$GLOBALS['phpgw_info']['flags']['email_refresh_uri']
@@ -558,12 +580,12 @@
                        // HOWEVER still this class must NOT invoke 
$GLOBALS['phpgw']->common->phpgw_header()
                        // even though we had to output the header and navbar, 
(go figure... :)

-                       // MUCH of this data may not be necessary nor used for 
mlists
+                       // MUCH of this data may not be necessary nor used for 
mlists
                        $this->bo->xi['my_layout'] = 
$GLOBALS['phpgw']->msg->prefs['layout'];
                        $this->bo->xi['my_browser'] = 
$GLOBALS['phpgw']->msg->browser;
-
+
                        //$GLOBALS['phpgw']->template = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-                       $GLOBALS['phpgw']->template->set_file(array(
+                       $GLOBALS['phpgw']->template->set_file(array(
                                //'T_form_delmov_init' => 
'index_form_delmov_init.tpl',
                                'T_index_blocks' => 'index_blocks.tpl',
                                'T_mlist_main' => 'index_mlist.tpl'
@@ -575,17 +597,17 @@
                        
$GLOBALS['phpgw']->template->set_block('T_mlist_main','B_msg_list','V_msg_list');
                        
$GLOBALS['phpgw']->template->set_block('T_index_blocks','B_mlist_form_init','V_mlist_form_init');
                        
$GLOBALS['phpgw']->template->set_block('T_index_blocks','B_arrows_form_table','V_arrows_form_table');
-
+
                        
$GLOBALS['phpgw']->template->set_var('frm_delmov_action',$this->bo->xi['frm_delmov_action']);
                        
$GLOBALS['phpgw']->template->set_var('frm_delmov_name',$this->bo->xi['frm_delmov_name']);
                        
$GLOBALS['phpgw']->template->parse('V_mlist_form_init','B_mlist_form_init');
                        $this->bo->xi['V_mlist_form_init'] = 
$GLOBALS['phpgw']->template->get_var('V_mlist_form_init');
-
+
                        // font size options (this feature currently BROKEN)
                        $this->bo->xi['font_size_offset'] = 0;
                        //$this->bo->xi['font_size_offset'] = 2;
                        // FIXME:  font_size_offset  needs to be put into the 
prefs db, bo, and ui
-
+
                        $font_size = Array (
                                0 => ((-5) + $this->bo->xi['font_size_offset']),
                                1 => ((-4) + $this->bo->xi['font_size_offset']),
@@ -627,14 +649,14 @@
                                'hdr_font_size'         => 
$this->bo->xi['hdr_font_size'],
                                'hdr_font_size_sm'      => 
$this->bo->xi['hdr_font_size_sm'],
                                'ftr_font'              => 
$this->bo->xi['ftr_font'],
-                               // other message list stuff, we parse the mlist 
block before the rest of the tpl vars are needed
+                               // other message list stuff, we parse the mlist 
block before the rest of the tpl vars are needed
                                'mlist_newmsg_char'     => 
$this->bo->xi['mlist_newmsg_char'],
                                'mlist_newmsg_color'    => 
$this->bo->xi['mlist_newmsg_color'],
                                'mlist_newmsg_txt'      => 
$this->bo->xi['mlist_newmsg_txt'],
                                'images_dir'            => 
$this->bo->xi['svr_image_dir']
                        );
                        $GLOBALS['phpgw']->template->set_var($tpl_vars);
-
+
                        if ($this->bo->xi['folder_info']['number_all'] == 0)
                        {
                                $tpl_vars = Array(
@@ -650,9 +672,9 @@
                        else
                        {
                                
$GLOBALS['phpgw']->template->set_var('V_no_messages','');
-
+
                                
$GLOBALS['phpgw']->template->set_var('stats_last',$this->bo->xi['totaltodisplay']);
-
+
                                for ($i=0; $i < 
count($this->bo->xi['msg_list_dsp']); $i++)
                                {
                                        // NOT SUPPORTED YET IN MLIST
@@ -770,7 +792,7 @@
                                'delmov_listbox'        => 
$this->bo->xi['delmov_listbox']
                        );
                        $GLOBALS['phpgw']->template->set_var($tpl_vars);
-
+
                        // make the voluminous MLIST hidden vars array
                        $loop_to = 
count($GLOBALS['phpgw']->msg->args['mlist_set']);
                        $mlist_hidden_vars = '';
@@ -779,10 +801,10 @@
                                $this_msg_num = 
$GLOBALS['phpgw']->msg->args['mlist_set'][$i];
                                $mlist_hidden_vars .= '<input type="hidden" 
name="mlist_set['.(string)$i.']" value="'.$this_msg_num.'">'."\r\n";
                        }
-                       // make the first prev next last arrows
+                       // make the first prev next last arrows
                        
$GLOBALS['phpgw']->template->set_var('mlist_hidden_vars',$mlist_hidden_vars);
-                       
$GLOBALS['phpgw']->template->parse('V_arrows_form_table','B_arrows_form_table');
-
+                       
$GLOBALS['phpgw']->template->parse('V_arrows_form_table','B_arrows_form_table');
+
                        // FOLDER SIZE N/A FOR MLIST SETS
                        
$GLOBALS['phpgw']->template->set_var('V_get_size',$this->bo->xi['stats_size']);
                        
$GLOBALS['phpgw']->template->set_var('V_show_size',$this->bo->xi['stats_size']);
@@ -804,14 +826,14 @@
                                
$GLOBALS['phpgw']->template->set_var('V_show_size','');
                        }
                        */
-
+
                        $GLOBALS['phpgw']->msg->end_request();
-
+
                        // we are the BO and the UI, we take care of outputting 
the HTML to the client browser
                        // Template->pparse means "print parse" which parses 
the template and uses php print command
                        // to output the HTML, note "unknowns" are never 
handled ("finished") in that method.
                        
//$GLOBALS['phpgw']->template->pparse('out','T_index_main');
-
+
                        // COMMENT NEXT LINE OUT for producvtion use, (unknowns 
should be "remove"d in production use)
                        //$GLOBALS['phpgw']->template->set_unknowns("comment");
                        // production use, use this:    
$GLOBALS['phpgw']->template->set_unknowns("remove");
@@ -820,7 +842,7 @@
                        // note, for some reason, eventhough it seems we 
*should* call common->phpgw_footer(),
                        // if we do that, the client browser will get TWO page 
footers, so we do not call it here
                }
-
-
+
+
        }
 ?>

====================================================
Index: email/inc/class.uifolder.inc.php
diff -u email/inc/class.uifolder.inc.php:1.6 
email/inc/class.uifolder.inc.php:1.7
--- email/inc/class.uifolder.inc.php:1.6        Thu Dec 30 23:13:50 2004
+++ email/inc/class.uifolder.inc.php    Sun Mar 13 23:22:44 2005
@@ -27,12 +27,12 @@
                {
                        //return;
                }
-
+
                function folder()
                {
                        $this->bo = CreateObject('email.bofolder');
                        $this->bo->folder();
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we point to the global template for this 
version of phpgw templatings
@@ -44,7 +44,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -59,21 +59,21 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(
                                Array(
                                        'T_folder_out' => 'folder.tpl'
                                )
                        );
-                       
$this->tpl->set_block('T_folder_out','B_folder_list','V_folder_list');
-
-                       //= = = = TESTING NEW TOOLBAR WIDGET = = =
+                       
$this->tpl->set_block('T_folder_out','B_folder_list','V_folder_list');
+
+                       //= = = = TESTING NEW TOOLBAR WIDGET = = =
                        $this->widgets = CreateObject('email.html_widgets');
                        // this will have a msg to the user if folder was 
renamed, created, or deleted
                        
$this->widgets->set_toolbar_msg($this->bo->xi['action_report']);
                        
$this->tpl->set_var('widget_toolbar',$this->widgets->get_toolbar());
-
-
+
+
                        for ($i=0; 
$i<count($this->bo->xi['folder_list_display']);$i++)
                        {
                                
$this->tpl->set_var('list_backcolor',$this->bo->xi['folder_list_display'][$i]['list_backcolor']);
@@ -88,12 +88,12 @@


                        
$this->tpl->set_var('all_folders_listbox',$this->bo->xi['all_folders_listbox']);
-
+
                        // ----  Set Up Form Variables  ---
                        
$this->tpl->set_var('form_action',$this->bo->xi['form_action']);
                        
//$this->tpl->set_var('all_folders_listbox',$GLOBALS['phpgw']->msg->all_folders_listbox('','','',False));
                        
//$this->tpl->set_var('select_name_rename','source_folder');
-
+
                        
$this->tpl->set_var('form_create_txt',$this->bo->xi['form_create_txt']);
                        
$this->tpl->set_var('form_delete_txt',$this->bo->xi['form_delete_txt']);
                        
$this->tpl->set_var('form_rename_txt',$this->bo->xi['form_rename_txt']);
@@ -101,12 +101,12 @@
                        
$this->tpl->set_var('form_delete_expert_txt',$this->bo->xi['form_delete_expert_txt']);
                        
$this->tpl->set_var('form_rename_expert_txt',$this->bo->xi['form_rename_expert_txt']);
                        
$this->tpl->set_var('form_submit_txt',$this->bo->xi['form_submit_txt']);
-
+
                        
$this->tpl->set_var('hiddenvar_target_acctnum_name',$this->bo->xi['hiddenvar_target_acctnum_name']);
                        
$this->tpl->set_var('hiddenvar_target_acctnum_value',$this->bo->xi['hiddenvar_target_acctnum_value']);
                        
$this->tpl->set_var('target_fldball_boxname',$this->bo->xi['target_fldball_boxname']);
-
-                       // ----  Set Up Other Variables  ---
+
+                       // ----  Set Up Other Variables  ---
                        
$this->tpl->set_var('title_backcolor',$this->bo->xi['title_backcolor']);
                        
$this->tpl->set_var('title_textcolor',$this->bo->xi['title_textcolor']);
                        
$this->tpl->set_var('title_text',$this->bo->xi['title_text']);
@@ -114,18 +114,18 @@
                        
//$this->tpl->set_var('label_messages_text',$this->bo->xi['label_messages_text']);
                        
$this->tpl->set_var('label_new_text',$this->bo->xi['label_new_text']);
                        
$this->tpl->set_var('label_total_text',$this->bo->xi['label_total_text']);
-
+
                        
$this->tpl->set_var('view_txt',$this->bo->xi['view_txt']);
                        
$this->tpl->set_var('view_lnk',$this->bo->xi['view_lnk']);
-
+
                        
//$this->tpl->set_var('view_long_txt',$this->bo->xi['view_long_txt']);
                        
//$this->tpl->set_var('view_long_lnk',$this->bo->xi['view_long_lnk']);
                        
//$this->tpl->set_var('view_short_txt',$this->bo->xi['view_short_txt']);
                        
//$this->tpl->set_var('view_short_lnk',$this->bo->xi['view_short_lnk']);
-
+
                        
$this->tpl->set_var('the_font',$this->bo->xi['the_font']);
                        
$this->tpl->set_var('th_backcolor',$this->bo->xi['th_backcolor']);
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
@@ -150,7 +150,7 @@
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
-
+
                        // close down ALL mailserver streams
                        $GLOBALS['phpgw']->msg->end_request();
                        // destroy the object

====================================================
Index: email/inc/class.uicompose.inc.php
diff -u email/inc/class.uicompose.inc.php:1.6 
email/inc/class.uicompose.inc.php:1.7
--- email/inc/class.uicompose.inc.php:1.6       Thu Dec 30 23:13:50 2004
+++ email/inc/class.uicompose.inc.php   Sun Mar 13 23:22:44 2005
@@ -9,12 +9,12 @@
        *  Free Software Foundation; either version 2 of the License, or (at 
your               *
        *  option) any later version.                                           
                *
        
\**************************************************************************/
-
+
        /* $Id$ */
-
+
        class uicompose
        {
-               var $bo;
+               var $bo;
                var $debug = 0;
                var $tpl;
                var $widgets;
@@ -27,7 +27,7 @@
                {
                        //return;
                }
-
+
                /*!
                @function compose
                @abstract calls bocompose and makes the compose page
@@ -36,22 +36,22 @@
                @access public
                */
                function compose($reuse_feed_args='')
-               {
+               {
                        if ((is_string($reuse_feed_args))
                        && ($reuse_feed_args == ''))
                        {
                                // we were passed an empty string, make it an 
empty array just to be consistant
                                $reuse_feed_args = array();
-
+
                        }
-                       // ok, class.spell will pass $special_instructions as 
$reuse_feed_args string data,
+                       // ok, class.spell will pass $special_instructions as 
$reuse_feed_args string data,
                        // this must be passed onto bocompose->compose()
-
+
                        $this->bo = CreateObject("email.bocompose");
-                       // concept of $reuse_feed_args is depreciated HOWEVER 
the spell code will
+                       // concept of $reuse_feed_args is depreciated HOWEVER 
the spell code will
                        // pass "special_instructions" back to bocompose, so 
leave this here
                        $this->bo->compose($reuse_feed_args);
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we point to the global template for this 
version of phpgw templatings
@@ -63,7 +63,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we are the BO and the UI, we take care of 
outputting the HTML to the client browser
@@ -77,20 +77,20 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(
                                Array(
                                        'T_compose_out' => 'compose.tpl'
                                )
                        );
                        
$this->tpl->set_block('T_compose_out','B_checkbox_sig','V_checkbox_sig');
-
+
                        if ($this->debug > 2) { echo 'GLOBALS[phpgw_info] 
dump:<pre>'; print_r($GLOBALS['phpgw_info']) ; echo '</pre>'; }
-
-                       //= = = = TOOLBAR WIDGET = = =
+
+                       //= = = = TOOLBAR WIDGET = = =
                        $this->widgets = CreateObject('email.html_widgets');
                        
$this->tpl->set_var('widget_toolbar',$this->widgets->get_toolbar());
-
+
                        // fill template vars
                        $tpl_vars = Array(
                                'to_box_value'          => 
$this->bo->xi['to_box_value'],
@@ -131,9 +131,10 @@
                                'addressbook_button'    => 
$this->bo->xi['addressbook_button'],
                                'send_button'                   => 
$this->bo->xi['send_button'],
                                'spellcheck_button'             => 
$this->bo->xi['spellcheck_button'],
-                               'attachfile_js_button'          => 
$this->bo->xi['attachfile_js_button'],
+                               'attachfile_js_button'          => 
$this->bo->xi['attachfile_js_button'],
                                'attachfile_js_onclick'          => 
$this->bo->xi['attachfile_js_onclick'],
-                               'body_box_name'         => 
$this->bo->xi['body_box_name']
+                               'body_box_name'         => 
$this->bo->xi['body_box_name'],
+                               'save_button'           => 
$this->bo->xi['save_button']
                        );
                        $this->tpl->set_var($tpl_vars);
                        if ($this->bo->xi['ischecked_checkbox_sig'])
@@ -161,7 +162,7 @@
                        {
                                
$this->tpl->set_var('ischecked_checkbox_req_notify','');
                        }
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
@@ -178,11 +179,10 @@
                                //$data['appname'] = lang('E-Mail');
                                //$data['function_msg'] = lang('compose 
message');
                                $data['email_page'] = 
$this->tpl->parse('out','T_compose_out');
-                               
//$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('uimessage' => $data));
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
-
+
                        $GLOBALS['phpgw']->msg->end_request();
                }
        }

====================================================
Index: email/inc/class.uifilters.inc.php
diff -u email/inc/class.uifilters.inc.php:1.15 
email/inc/class.uifilters.inc.php:1.16
--- email/inc/class.uifilters.inc.php:1.15      Thu Dec 30 23:13:50 2004
+++ email/inc/class.uifilters.inc.php   Sun Mar 13 23:22:44 2005
@@ -15,15 +15,15 @@

        /*!
        @class uifilters
-       @abstract UI code for display of filter list and creating or editing 
individual filters.
-       NOTE that class bofilters will leave the pref filter data with any html 
encoding AS-IS if
-       it sees "uifilters" in the menuaction. So the UI functions should call 
functions in this
-       class because "ui" is in the menuaction. HOWEVER any real action or use 
or submission
-       of the filter data MUST actually call a function in class "bofilters" 
so that the lack of
-       "uifilters" in the menuaction triggers the database defanging (html 
decoding) of the
-       pref filter data. So actually showing the filters requires leaving the 
html encoding intact.
-       This encoding is referring to the pref table "database defanging" of 
certain offensive chars,
-       like slashes and quote chars.
+       @abstract UI code for display of filter list and creating or editing 
individual filters.
+       NOTE that class bofilters will leave the pref filter data with any html 
encoding AS-IS if
+       it sees "uifilters" in the menuaction. So the UI functions should call 
functions in this
+       class because "ui" is in the menuaction. HOWEVER any real action or use 
or submission
+       of the filter data MUST actually call a function in class "bofilters" 
so that the lack of
+       "uifilters" in the menuaction triggers the database defanging (html 
decoding) of the
+       pref filter data. So actually showing the filters requires leaving the 
html encoding intact.
+       This encoding is referring to the pref table "database defanging" of 
certain offensive chars,
+       like slashes and quote chars.
        @author Angles
        */
        class uifilters
@@ -41,10 +41,10 @@

                /*!
                @function uifilters
-               @abstract constructor
-               @discussion This actually creates the bofilters object, in 
which the bo constructor reads
-               the filter data from prefs, leaving the html encoding in tact 
if the string "uifilters" is in the
-               menuaction.
+               @abstract constructor
+               @discussion This actually creates the bofilters object, in 
which the bo constructor reads
+               the filter data from prefs, leaving the html encoding in tact 
if the string "uifilters" is in the
+               menuaction.
                @author Angles
                */
                function uifilters()
@@ -55,15 +55,15 @@
                        $this->bo = CreateObject("email.bofilters");
                        //return;
                }
-
+
                /*!
                @function filters_edit
-               @abstract Display an html form with an individual filter for 
the user to see or edit,
-               also called when makign a new filter.
+               @abstract Display an html form with an individual filter for 
the user to see or edit,
+               also called when makign a new filter.
                @author Angles
                */
                function filters_edit()
-               {
+               {
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we point to the global template for this 
version of phpgw templatings
@@ -75,7 +75,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -88,7 +88,7 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(
                                Array(
                                        'T_filters_out' => 'filters.tpl',
@@ -101,11 +101,11 @@
                        
$this->tpl->set_block('T_filters_blocks','B_action_with_ignore_me','V_action_with_ignore_me');
                        
$this->tpl->set_block('T_filters_out','B_matches_row','V_matches_row');
                        
$this->tpl->set_block('T_filters_out','B_actions_row','V_actions_row');
-
+
                        //  ---- LANGS  ----
                        $this->tpl->set_var('lang_email_filters',lang('EMail 
Filters'));
                        $this->tpl->set_var('lang_filter_name',lang('Filter 
Name'));
-                       $this->tpl->set_var('lang_filter_number',lang('Filter 
Number'));
+                       $this->tpl->set_var('lang_filter_number',lang('Filter 
Number'));
                        $this->tpl->set_var('lang_if_messages_match',lang('If 
Messages Match'));
                        
$this->tpl->set_var('lang_inbox_for_account',lang('Filter INBOX for accounts'));
                        $not_available_yet = ' &#040;NA&#041;';
@@ -129,7 +129,7 @@
                        $this->tpl->set_var('lang_contains',lang('Contains'));
                        $this->tpl->set_var('lang_notcontains',lang('Does Not 
Contain'));
                        $this->tpl->set_var('lang_take_actions',lang('Then do 
this'));
-                       $this->tpl->set_var('lang_or_enter_text',lang('or enter 
text'));
+                       $this->tpl->set_var('lang_or_enter_text',lang('or enter 
text'));
                        $this->tpl->set_var('lang_stop_if_matched',lang('and 
stop filtering'));
                        $this->tpl->set_var('lang_ignore_me2',lang('not used'));
                        $this->tpl->set_var('lang_keep',lang('Keep'));
@@ -144,27 +144,27 @@
                        $this->tpl->set_var('lang_submit',lang('Submit'));
                        $this->tpl->set_var('lang_clear',lang('Clear'));
                        $this->tpl->set_var('lang_cancel',lang('Cancel'));
-
-
-                       //= = = = TESTING NEW LISTBOX WIDGET = = =
+
+
+                       //= = = = TESTING NEW LISTBOX WIDGET = = =
                        if (!(isset($this->widgets))
                        || (!is_object($this->widgets)))
                        {
                                $this->widgets = 
CreateObject('email.html_widgets');
                        }
-
+
                        // get all filters
                        // THIS IS DONE AUTOMATICALLY in boaction constructor
                        // AND the if the constructor sees "uifilters" in the 
menuaction, it LEAVES the pref data html encoded for use in the form
                        //$this->bo->read_filter_data_from_prefs();
-
+
                        // ---- Filter Number  ----
                        // what filter are we supposed to edit
                        $filter_num = $this->bo->obtain_filer_num();
                        $this->tpl->set_var('filter_num',$filter_num);
-
+
                        if ($this->debug > 2) { echo 'uifilters.filters: 
$this->bo->obtain_filer_num(): ['.$this->bo->obtain_filer_num().'] ; 
$this->bo->all_filters DUMP<pre>'; print_r($this->bo->all_filters); echo 
'</pre>'."\r\n"; }
-
+
                        // setup some form vars
                        //$form_edit_filter_action = $GLOBALS['phpgw']->link(
                        //                                      '/index.php',
@@ -172,24 +172,24 @@
                        $form_edit_filter_action = $GLOBALS['phpgw']->link(
                                                                '/index.php',
                                                                
'menuaction=email.bofilters.process_submitted_data');
-
+
                        $form_cancel_action = $GLOBALS['phpgw']->link(
                                                                '/index.php',
                                                                
'menuaction=email.uifilters.filters_list');
-
+
                        $apply_this_filter_url = $GLOBALS['phpgw']->link(
                                                                '/index.php',
                                                                
'menuaction=email.bofilters.do_filter'
                                                                
.'&filter_num='.$filter_num);
                        $apply_this_filter_href = '<a 
href="'.$apply_this_filter_url.'">'.lang('<b>*apply*</b> this filter').'</a>';
-
+
                        $test_this_filter_url = 
$apply_this_filter_url.'&filter_test=1';
                        $test_this_filter_href = '<a 
href="'.$test_this_filter_url.'">'.lang('Test Run This Filter').'</a>';
-
+
                        
$this->tpl->set_var('apply_this_filter_href',$apply_this_filter_href);
                        
$this->tpl->set_var('test_this_filter_href',$test_this_filter_href);
-
-
+
+
                        // does the data exist or is this a new filter
                        /*
                        if ((isset($this->bo->all_filters[$filter_num]))
@@ -203,7 +203,7 @@
                        }
                        */
                        $filter_exists = $this->bo->filter_exists($filter_num);
-
+
                        // ----  Filter Name  ----
                        $filter_name_box_name = 'filtername';
                        if ($filter_exists)
@@ -215,10 +215,10 @@
                                //$filter_name_box_value = 'Filter 
'.$filter_num;
                                $filter_name_box_value = 'My Mail Filter';
                        }
-
+
                        
$this->tpl->set_var('filter_name_box_name',$filter_name_box_name);
                        
$this->tpl->set_var('filter_name_box_value',$filter_name_box_value);
-
+
                        // ----  source_account_listbox_name Selected logic ----
                        if ($filter_exists)
                        {
@@ -243,7 +243,7 @@
                                // preselect the default account
                                $pre_select_multi = '0';
                        }
-
+
                        // ---  many email apps offer 2 matches options rows  
---
                        // ---  others offer 1 match options row with the 
option of more ---
                        // ---  for now we will offer 2 rows ---
@@ -274,7 +274,7 @@
                                        // get you custom built HTML combobox 
(a.k.a. selectbox) widget
                                        $account_multi_box = 
$GLOBALS['phpgw']->msg->all_ex_accounts_listbox($feed_args);
                                        
$this->tpl->set_var('account_multi_box', $account_multi_box);
-                                       $V_match_left_td = 
$this->tpl->parse('V_match_account_box','B_match_account_box');
+                                       $V_match_left_td = 
$this->tpl->parse('V_match_account_box','B_match_account_box');
                                }
                                else
                                {
@@ -305,7 +305,7 @@
                                        
$this->tpl->set_var('or_selected',$or_selected);
                                        
$this->tpl->set_var('and_selected',$and_selected);
                                        
$this->tpl->set_var('ignore_me_selected',$ignore_me_selected);
-                                       $V_match_left_td = 
$this->tpl->parse('V_match_and_or_ignore','B_match_and_or_ignore');
+                                       $V_match_left_td = 
$this->tpl->parse('V_match_and_or_ignore','B_match_and_or_ignore');
                                }
                                // things both rows have
                                $examine_selectbox_name = 
'match_'.(string)$i.'[examine]';
@@ -430,7 +430,7 @@
                                {
                                        $V_action_widget = 
$this->tpl->parse('V_action_with_ignore_me','B_action_with_ignore_me');
                                }
-
+
                                // --- Folders Listbox  ---
                                $folder_listbox_name = 
'action_'.$action_rownum.'[folder]';
                                $listbox_show_unseen = False;
@@ -453,14 +453,14 @@
                                        $pre_select_fldball['acctnum'] = 
(int)$parsed_folder['acctnum'];
                                        //echo '$pre_select_folder: 
['.$pre_select_folder.'] ; pre_select_folder_acctnum 
['.$pre_select_folder_acctnum.']';
                                }
-
+
                                // TESTING new all folders listbox widget
                                $this->widgets->new_all_folders_megalist();
                                
$this->widgets->prop_megalist_widget_name($folder_listbox_name);
                                
$this->widgets->prop_megalist_preselected_fldball($pre_select_fldball);
                                
$this->widgets->prop_megalist_first_item_text(lang('if fileto then select 
destination folder'));
                                $folder_listbox = 
$this->widgets->all_folders_megalist();
-
+
                                /*
                                $feed_args = Array(
                                        'mailsvr_stream'        => '',
@@ -477,7 +477,7 @@
                                $folder_listbox = 
$GLOBALS['phpgw']->msg->folders_mega_listbox($feed_args);
                                */
                                // ACTIONTEXT
-                               $action_textbox_name = 
'action_'.$action_rownum.'[actiontext]';
+                               $action_textbox_name = 
'action_'.$action_rownum.'[actiontext]';
                                if 
((!isset($this->bo->all_filters[$filter_num]['actions'][$i]['actiontext']))
                                || 
($this->bo->all_filters[$filter_num]['actions'][$i]['actiontext'] == ''))
                                {
@@ -498,49 +498,49 @@
                                {
                                        $stop_filtering_checkbox_checked = 
'checked';
                                }
-
+
                                
$this->tpl->set_var('V_action_widget',$V_action_widget);
                                $this->tpl->set_var('folder_listbox', 
$folder_listbox);
                                
$this->tpl->set_var('action_textbox_name',$action_textbox_name);
                                
$this->tpl->set_var('action_textbox_txt',$action_textbox_txt);
                                
$this->tpl->set_var('stop_filtering_checkbox_name',$stop_filtering_checkbox_name);
                                
$this->tpl->set_var('stop_filtering_checkbox_checked',$stop_filtering_checkbox_checked);
-                               
//$this->tpl->parse('V_actions_row','B_actions_row',True);
-                               
$this->tpl->parse('V_actions_row','B_actions_row');
+                               
//$this->tpl->parse('V_actions_row','B_actions_row',True);
+                               
$this->tpl->parse('V_actions_row','B_actions_row');
                        }
-
+
                        
$this->tpl->set_var('form_edit_filter_action',$form_edit_filter_action);
                        
$this->tpl->set_var('form_cancel_action',$form_cancel_action);
-
+
                        
$this->tpl->set_var('body_bg_color',$this->theme['bg_color']);
                        $this->tpl->set_var('row_on',$this->theme['row_on']);
                        $this->tpl->set_var('row_off',$this->theme['row_off']);
                        
$this->tpl->set_var('row_text',$this->theme['row_text']);
-
-
-
+
+
+
                        // debugging result list
                        $mlist_html = '';
                        if (count($this->bo->filters) > 0)
                        {
-
-                               if ($this->debug > 1) { echo 
'uifilters.filters_edit: count($this->bo->filters): 
['.count($this->bo->filters).'] ; <br>'."\r\n"; }
+
+                               if ($this->debug > 1) { echo 
'uifilters.filters_edit: count($this->bo->filters): 
['.count($this->bo->filters).'] ; <br />'."\r\n"; }
                                //$this->bo->sieve_to_imap_string();
                                // WHAT THE F*** IS THIS - this is OLD left 
over code
                                //$this->bo->do_imap_search();
-                               //if ($this->debug > 0) { echo 'message list 
print_r dump:<b><pre>'."\r\n"; print_r($this->bo->result_set_mlist); echo 
'</pre><br><br>'."\r\n"; }
+                               //if ($this->debug > 0) { echo 'message list 
print_r dump:<b><pre>'."\r\n"; print_r($this->bo->result_set_mlist); echo 
'</pre><br /><br />'."\r\n"; }
                                $this->bo->make_mlist_box();
-                               $mlist_html =
+                               $mlist_html =
                                        '<table border="0" cellpadding="4" 
cellspacing="1" width="90%" align="center">'."\r\n"
                                        .$this->bo->finished_mlist."\r\n"
                                        .'</table>'."\r\n"
                                        .'<p>&nbsp;</p>'."\r\n"
                                        .$this->bo->submit_mlist_to_class_form
                                        .'<p>&nbsp;</p>'."\r\n";
-
+
                        }
                        $this->tpl->set_var('V_mlist_html',$mlist_html);
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
trim($GLOBALS['phpgw']->msg->dbug->notice_pagedone()));
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
@@ -563,79 +563,79 @@
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
-
+
                        // tell the msg object we are done with it
                        $GLOBALS['phpgw']->msg->end_request();
                }

                /*!
                @function useless_function_echo_constants
-               @abstract Echos out certain constants associated with php email 
usage. Info can be obtained
-               in other ways, but I leave this here in case using the sockets 
classes (which must define this
-               constants in the absence of the php imap extension) is perhaps 
more easily debugged with
-               this function. However, until that is proven I leave this as a 
useless function.
-               Also note the things output here may not be all the constants 
anyway.
+               @abstract Echos out certain constants associated with php email 
usage. Info can be obtained
+               in other ways, but I leave this here in case using the sockets 
classes (which must define this
+               constants in the absence of the php imap extension) is perhaps 
more easily debugged with
+               this function. However, until that is proven I leave this as a 
useless function.
+               Also note the things output here may not be all the constants 
anyway.
                @author Angles
                */
                function useless_function_echo_constants()
-               {
+               {

                        // GENERAL INFO
-                       //echo 'get_loaded_extensions returns:<br><pre>'; 
print_r(get_loaded_extensions()); echo '</pre>';
-                       //echo 'phpinfo returns:<br><pre>'; print_r(phpinfo()); 
echo '</pre>';
-
-                       echo 'SA_MESSAGES: 
['.(string)SA_MESSAGES.']<br>'."\r\n";
-                       echo 'SA_RECENT: ['.(string)SA_RECENT.']<br>'."\r\n";
-                       echo 'SA_UNSEEN: ['.(string)SA_UNSEEN.']<br>'."\r\n";
-                       echo 'SA_UIDNEXT: ['.(string)SA_UIDNEXT.']<br>'."\r\n";
-                       echo 'SA_UIDVALIDITY: 
['.(string)SA_UIDVALIDITY.']<br>'."\r\n";
-                       echo 'SA_ALL: ['.(string)SA_ALL.']<br>'."\r\n";
-
-                       echo 'SORTDATE: ['.(string)SORTDATE.']<br>'."\r\n";
-                       echo 'SORTARRIVAL: 
['.(string)SORTARRIVAL.']<br>'."\r\n";
-                       echo 'SORTFROM: ['.(string)SORTFROM.']<br>'."\r\n";
-                       echo 'SORTSUBJECT: 
['.(string)SORTSUBJECT.']<br>'."\r\n";
-                       echo 'SORTTO: ['.(string)SORTTO.']<br>'."\r\n";
-                       echo 'SORTCC: ['.(string)SORTCC.']<br>'."\r\n";
-                       echo 'SORTSIZE: ['.(string)SORTSIZE.']<br>'."\r\n";
-
-                       echo 'TYPETEXT: ['.(string)TYPETEXT.']<br>'."\r\n";
-                       echo 'TYPEMULTIPART: 
['.(string)TYPEMULTIPART.']<br>'."\r\n";
-                       echo 'TYPEMESSAGE: 
['.(string)TYPEMESSAGE.']<br>'."\r\n";
-                       echo 'TYPEAPPLICATION: 
['.(string)TYPEAPPLICATION.']<br>'."\r\n";
-                       echo 'TYPEAUDIO: ['.(string)TYPEAUDIO.']<br>'."\r\n";
-                       echo 'TYPEIMAGE: ['.(string)TYPEIMAGE.']<br>'."\r\n";
-                       echo 'TYPEVIDEO: ['.(string)TYPEVIDEO.']<br>'."\r\n";
-                       echo 'TYPEOTHER: ['.(string)TYPEOTHER.']<br>'."\r\n";
-                       echo 'TYPEMODEL: ['.(string)TYPEMODEL.']<br>'."\r\n";
-
-                       echo 'ENC7BIT: ['.(string)ENC7BIT.']<br>'."\r\n";
-                       echo 'ENC8BIT: ['.(string)ENC8BIT.']<br>'."\r\n";
-                       echo 'ENCBINARY: ['.(string)ENCBINARY.']<br>'."\r\n";
-                       echo 'ENCBASE64: ['.(string)ENCBASE64.']<br>'."\r\n";
-                       echo 'ENCQUOTEDPRINTABLE: 
['.(string)ENCQUOTEDPRINTABLE.']<br>'."\r\n";
-                       echo 'ENCOTHER: ['.(string)ENCOTHER.']<br>'."\r\n";
-                       echo 'ENCUU: ['.(string)ENCUU.']<br>'."\r\n";
-
-                       echo 'FT_UID: ['.(string)FT_UID.']<br>'."\r\n";
-                       echo 'FT_PEEK: ['.(string)FT_PEEK.']<br>'."\r\n";
-                       echo 'FT_NOT: ['.(string)FT_NOT.']<br>'."\r\n";
-                       echo 'FT_INTERNAL: 
['.(string)FT_INTERNAL.']<br>'."\r\n";
-                       echo 'FT_PREFETCHTEXT: 
['.(string)FT_PREFETCHTEXT.']<br>'."\r\n";
-
-                       echo 'SE_UID: ['.(string)SE_UID.']<br>'."\r\n";
-                       echo 'SE_FREE: ['.(string)SE_FREE.']<br>'."\r\n";
-                       echo 'SE_NOPREFETCH: 
['.(string)SE_NOPREFETCH.']<br>'."\r\n";
-
+                       //echo 'get_loaded_extensions returns:<br /><pre>'; 
print_r(get_loaded_extensions()); echo '</pre>';
+                       //echo 'phpinfo returns:<br /><pre>'; 
print_r(phpinfo()); echo '</pre>';
+
+                       echo 'SA_MESSAGES: ['.(string)SA_MESSAGES.']<br 
/>'."\r\n";
+                       echo 'SA_RECENT: ['.(string)SA_RECENT.']<br />'."\r\n";
+                       echo 'SA_UNSEEN: ['.(string)SA_UNSEEN.']<br />'."\r\n";
+                       echo 'SA_UIDNEXT: ['.(string)SA_UIDNEXT.']<br 
/>'."\r\n";
+                       echo 'SA_UIDVALIDITY: ['.(string)SA_UIDVALIDITY.']<br 
/>'."\r\n";
+                       echo 'SA_ALL: ['.(string)SA_ALL.']<br />'."\r\n";
+
+                       echo 'SORTDATE: ['.(string)SORTDATE.']<br />'."\r\n";
+                       echo 'SORTARRIVAL: ['.(string)SORTARRIVAL.']<br 
/>'."\r\n";
+                       echo 'SORTFROM: ['.(string)SORTFROM.']<br />'."\r\n";
+                       echo 'SORTSUBJECT: ['.(string)SORTSUBJECT.']<br 
/>'."\r\n";
+                       echo 'SORTTO: ['.(string)SORTTO.']<br />'."\r\n";
+                       echo 'SORTCC: ['.(string)SORTCC.']<br />'."\r\n";
+                       echo 'SORTSIZE: ['.(string)SORTSIZE.']<br />'."\r\n";
+
+                       echo 'TYPETEXT: ['.(string)TYPETEXT.']<br />'."\r\n";
+                       echo 'TYPEMULTIPART: ['.(string)TYPEMULTIPART.']<br 
/>'."\r\n";
+                       echo 'TYPEMESSAGE: ['.(string)TYPEMESSAGE.']<br 
/>'."\r\n";
+                       echo 'TYPEAPPLICATION: ['.(string)TYPEAPPLICATION.']<br 
/>'."\r\n";
+                       echo 'TYPEAUDIO: ['.(string)TYPEAUDIO.']<br />'."\r\n";
+                       echo 'TYPEIMAGE: ['.(string)TYPEIMAGE.']<br />'."\r\n";
+                       echo 'TYPEVIDEO: ['.(string)TYPEVIDEO.']<br />'."\r\n";
+                       echo 'TYPEOTHER: ['.(string)TYPEOTHER.']<br />'."\r\n";
+                       echo 'TYPEMODEL: ['.(string)TYPEMODEL.']<br />'."\r\n";
+
+                       echo 'ENC7BIT: ['.(string)ENC7BIT.']<br />'."\r\n";
+                       echo 'ENC8BIT: ['.(string)ENC8BIT.']<br />'."\r\n";
+                       echo 'ENCBINARY: ['.(string)ENCBINARY.']<br />'."\r\n";
+                       echo 'ENCBASE64: ['.(string)ENCBASE64.']<br />'."\r\n";
+                       echo 'ENCQUOTEDPRINTABLE: 
['.(string)ENCQUOTEDPRINTABLE.']<br />'."\r\n";
+                       echo 'ENCOTHER: ['.(string)ENCOTHER.']<br />'."\r\n";
+                       echo 'ENCUU: ['.(string)ENCUU.']<br />'."\r\n";
+
+                       echo 'FT_UID: ['.(string)FT_UID.']<br />'."\r\n";
+                       echo 'FT_PEEK: ['.(string)FT_PEEK.']<br />'."\r\n";
+                       echo 'FT_NOT: ['.(string)FT_NOT.']<br />'."\r\n";
+                       echo 'FT_INTERNAL: ['.(string)FT_INTERNAL.']<br 
/>'."\r\n";
+                       echo 'FT_PREFETCHTEXT: ['.(string)FT_PREFETCHTEXT.']<br 
/>'."\r\n";
+
+                       echo 'SE_UID: ['.(string)SE_UID.']<br />'."\r\n";
+                       echo 'SE_FREE: ['.(string)SE_FREE.']<br />'."\r\n";
+                       echo 'SE_NOPREFETCH: ['.(string)SE_NOPREFETCH.']<br 
/>'."\r\n";
+
                }
-
-
+
+
                /*!
                @function filters_list
-               @abstract Display the list of all filters stored in the users 
pref table.
-               @discussion From here the user can choose to create or edit an 
individual filter, or to test or apply
-               ALL filters, or rearrange the sequence in which the filters are 
applied.
-               Note this may change before this doc text is updated, so see 
the actual page for its exact current content.
+               @abstract Display the list of all filters stored in the users 
pref table.
+               @discussion From here the user can choose to create or edit an 
individual filter, or to test or apply
+               ALL filters, or rearrange the sequence in which the filters are 
applied.
+               Note this may change before this doc text is updated, so see 
the actual page for its exact current content.
                @author Angles
                */
                function filters_list()
@@ -651,7 +651,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -664,18 +664,18 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(
                                Array(
                                        'T_filters_list'        => 
'filters_list.tpl'
                                )
                        );
                        
$this->tpl->set_block('T_filters_list','B_filter_list_row','V_filter_list_row');
-
-                       //= = = = TESTING NEW TOOLBAR WIDGET = = =
+
+                       //= = = = TESTING NEW TOOLBAR WIDGET = = =
                        $this->widgets = CreateObject('email.html_widgets');
                        
$this->tpl->set_var('widget_toolbar',$this->widgets->get_toolbar());
-
+
                        $var = Array(
                                'pref_errors'           => '',
                                'font'                          => 
$this->theme['font'],
@@ -690,17 +690,17 @@
                                'lang_test_or_apply' => lang('test or apply ALL 
filters')
                        );
                        $this->tpl->set_var($var);
-
+
                        $filters_list = array();
                        // get all filters
                        // THIS IS DONE AUTOMATICALLY in boaction constructor
                        // AND the if the constructor sees "uifilters" in the 
menuaction, it LEAVES the pref data html encoded for use in the form
                        //$filters_list = 
$this->bo->read_filter_data_from_prefs();
                        $filters_list = $this->bo->all_filters;
-
-
+
+
                        if ($this->debug > 2) { echo 
'email.uifilters.filters_list: $filters_list dump<pre>'; 
print_r($filters_list); echo '</pre>'; }
-
+
                        $tr_color = $this->theme['row_off'];
                        $loops = count($filters_list);
                        if ($loops == 0)
@@ -710,7 +710,7 @@
                                //$tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
                                $tr_color = 
$GLOBALS['phpgw_info']['theme']['row_on'];
                                $tr_color_class = 'row_on';
-
+
                                $this->tpl->set_var('tr_color',$tr_color);
                                
$this->tpl->set_var('tr_color_class',$tr_color_class);
                                $this->tpl->set_var('filter_identity',$nothing);
@@ -730,7 +730,7 @@
                                        //$tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
                                        $tr_color = (($i + 1)/2 == floor(($i + 
1)/2)) ? $GLOBALS['phpgw_info']['theme']['row_off'] : 
$GLOBALS['phpgw_info']['theme']['row_on'];
                                        $tr_color_class = (($i + 1)/2 == 
floor(($i + 1)/2)) ? 'row_off' : 'row_on';
-
+
                                                                                
// Don't move up the first filter (Sam Przyswa)
                                        if ($i != 0)
                                        {
@@ -748,7 +748,7 @@
                                                                                
.'&filter_num='.$i);
                                                
$filters_list[$i]['move_up_href'] = '<a 
href="'.$filters_list[$i]['move_up_url'].'"></a>';
                                        }
-
+
                                        // Don't move down the last filter (Sam 
Przyswa)
                                        if ($i != $loops-1)
                                        {
@@ -767,19 +767,19 @@
                                                
$filters_list[$i]['move_down_href'] = '<a 
href="'.$filters_list[$i]['move_down_url'].'"></a>';
                                        }
                                        // end of changes (Sam Przyswa)
-
+
                                        $filters_list[$i]['edit_url'] = 
$GLOBALS['phpgw']->link(
                                                                        
'/index.php',
                                                                         
'menuaction=email.uifilters.filters_edit'
                                                                        
.'&filter_num='.$i);
                                        $filters_list[$i]['edit_href'] = '<a 
href="'.$filters_list[$i]['edit_url'].'">'.lang('Edit').'</a>';
-
+
                                        $filters_list[$i]['delete_url'] = 
$GLOBALS['phpgw']->link(
                                                                        
'/index.php',
                                                                         
'menuaction=email.bofilters.delete_filter'
                                                                        
.'&filter_num='.$i);
                                        $filters_list[$i]['delete_href'] = '<a 
href="'.$filters_list[$i]['delete_url'].'">'.lang('Delete').'</a>';
-
+
                                        
$this->tpl->set_var('tr_color',$tr_color);
                                        
$this->tpl->set_var('tr_color_class',$tr_color_class);
                                        
$this->tpl->set_var('filter_identity',$filters_list[$i]['display_string']);
@@ -808,23 +808,23 @@
                                                                        
.'&filter_num='.$this->bo->add_new_filter_token);
                        $add_new_filter_href = '<a 
href="'.$add_new_filter_url.'">'.lang('New Filter').'</a>';
                        
$this->tpl->set_var('add_new_filter_href',$add_new_filter_href);
-
+
                        $done_url = $GLOBALS['phpgw']->link(
                                                                        
'/preferences/index.php');
                        $done_href = '<a 
href="'.$done_url.'">'.lang('Done').'</a>';
                        $this->tpl->set_var('done_href',$done_href);
-
+
                        // TEST AND APPLY LINKS
                        $run_all_filters_url = $GLOBALS['phpgw']->link(
                                                                        
'/index.php',
                                                                         
'menuaction=email.bofilters.do_filter');
                        $run_all_filters_href = '<a 
href="'.$run_all_filters_url.'">'.lang('<b>APPLY ALL</b> Filters').'</a>';
                        
$this->tpl->set_var('run_all_filters_href',$run_all_filters_href);
-
+
                        $test_all_filters_url = 
$run_all_filters_url.'&filter_test=1';
                        $test_all_filters_href = '<a 
href="'.$test_all_filters_url.'">'.lang('Test All Filters').'</a>';
                        
$this->tpl->set_var('test_all_filters_href',$test_all_filters_href);
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
@@ -847,11 +847,11 @@
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
-
+
                        // tell the msg object we are done with it
                        $GLOBALS['phpgw']->msg->end_request();
                }
-
-
+
+
        }
 ?>

====================================================
Index: email/inc/class.uipreferences.inc.php
diff -u email/inc/class.uipreferences.inc.php:1.18 
email/inc/class.uipreferences.inc.php:1.19
--- email/inc/class.uipreferences.inc.php:1.18  Thu Dec 30 23:13:50 2004
+++ email/inc/class.uipreferences.inc.php       Sun Mar 13 23:22:44 2005
@@ -10,9 +10,9 @@
        *  Free Software Foundation; either version 2 of the License, or (at 
your               *
        *  option) any later version.                                           
                *
        
\**************************************************************************/
-
+
        /* $Id$ */
-
+
        class uipreferences
        {
                var $public_functions = array(
@@ -39,18 +39,18 @@
                        $temp_prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences();
                        $this->prefs = $temp_prefs['email'];
                }
-
+
                /*!
                @function create_prefs_block
-               @abstract create 2 columns TR's (TableRows) from preference 
data as standardized in email
+               @abstract create 2 columns TR's (TableRows) from preference 
data as standardized in email
                bopreferences class vars ->std_prefs[]  and ->cust_prefs[], 
various HTML widgets supported
-               @param $feed_prefs : array : preference data as standardized in 
email bopreferences class
+               @param $feed_prefs : array : preference data as standardized in 
email bopreferences class
                vars ->std_prefs[]  and ->cust_prefs[]
                @result : string : HTML data accumulated for parsed prefernce 
widget TR's
                @discussion  email bopreferences class vars ->std_prefs[]  and 
->cust_prefs[], as filled by
                email bopreferences->init_available_prefs(), represent a 
standardized preferences schema,
-               this function generates TR's from that data, using elements 
"id", "widget", "other_props",
-               "lang_blurb", and "values" from that array structure. This 
function uses that data to fill
+               this function generates TR's from that data, using elements 
"id", "widget", "other_props",
+               "lang_blurb", and "values" from that array structure. This 
function uses that data to fill
                a template block that contatains the requested widget and the 
appropriate data.
                Available HTML widgets are:
                        * textarea
@@ -58,7 +58,7 @@
                        * passwordbox
                        * combobox
                        * checkbox
-               If prefs data "other_props" contains "hidden", as with password 
data, then the actual
+               If prefs data "other_props" contains "hidden", as with password 
data, then the actual
                preference value is not shown and the "text blurb" is appended 
with "(hidden)".
                Array can contain any number of preference "records", all 
generated TR's are cumulative.
                @author Angles
@@ -66,7 +66,7 @@
                */
                function create_prefs_block($feed_prefs='')
                {
-                       if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: ENTERING, $this->bo->account_group: 
['.$this->bo->account_group.']; $this->bo->acctnum: 
['.$this->bo->acctnum.']<br>'; }
+                       if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: ENTERING, $this->bo->account_group: 
['.$this->bo->account_group.']; $this->bo->acctnum: ['.$this->bo->acctnum.']<br 
/>'; }
                        $return_block = '';
                        if(!$feed_prefs)
                        {
@@ -74,20 +74,20 @@
                        }
                        if (count($feed_prefs) == 0)
                        {
-                               if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: LEAVING early, $feed_prefs param was 
empty<br>'; }
+                               if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: LEAVING early, $feed_prefs param was 
empty<br />'; }
                                return $return_block;
                        }
-
+
                        // initialial backcolor, will be alternated between 
row_on and row_off
                        $back_color = $this->theme['row_off'];
                        $back_color_class = 'row_off';
-
+
                        // what existing user preferences data do we use to 
retrieve what the user has already saved for a particular pref
                        if (($this->bo->account_group == 'extra_accounts')
                        && (isset($this->bo->acctnum)))
                        {
                                // the existing prefs are for en ectra email 
account
-                               if ($this->debug > 1) { echo 
'email.uipreferences.create_prefs_block: ('.$this->bo->account_group.') get 
user prefs from DB by calling 
$GLOBALS[phpgw]->preferences->create_email_preferences(\'\', 
'.$this->bo->acctnum.')<br>'; }
+                               if ($this->debug > 1) { echo 
'email.uipreferences.create_prefs_block: ('.$this->bo->account_group.') get 
user prefs from DB by calling 
$GLOBALS[phpgw]->preferences->create_email_preferences(\'\', 
'.$this->bo->acctnum.')<br />'; }
                                //by calling this function with a specific 
acctnum, we get back fully procecessed prefs data from the DB
                                // for the that acctnum
                                $temp_prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences('', 
$this->bo->acctnum);
@@ -96,51 +96,51 @@
                        else
                        {
                                // default email account, top level data
-                               if ($this->debug > 1) { echo 
'email.uipreferences.create_prefs_block: ('.$this->bo->account_group.') for 
default account, top level prefs already processed<br>'; }
+                               if ($this->debug > 1) { echo 
'email.uipreferences.create_prefs_block: ('.$this->bo->account_group.') for 
default account, top level prefs already processed<br />'; }
                                $actual_user_prefs = $this->prefs;
                        }
                        if ($this->debug > 2) { echo 
'email.uipreferences.create_prefs_block: $this->bo->account_group: 
['.$this->bo->account_group.'] ; $this->bo->acctnum: ['.$this->bo->acctnum.'] ; 
$actual_user_prefs dump:<pre>'; print_r($actual_user_prefs); echo '</pre>'; }
-
+
                        $c_prefs = count($feed_prefs);
                        // ---  Prefs Loops  ---
                        for($i=0;$i<$c_prefs;$i++)
                        {
                                $this_item = $feed_prefs[$i];
                                if ($this->debug > 2) { echo '** loop ['.$i.'] 
**: email.uipreferences.create_prefs_block: $this_item = $feed_prefs['.$i.'] = 
[<code>'.serialize($this_item).'</code>] ; $this_item DUMP <pre>'; 
print_r($this_item); echo '</pre>'; }
-
+
                                // ---- do not show logic  ----
                                // do we show this for "default" account and/or 
"extra_accounts"
                                if (($this->bo->account_group == 'default')
                                && (!stristr($this_item['accts_usage'] , 
'default')))
                                {
                                        // we are not supposed to show this 
item for the default account, skip this pref item
-                                       // continue is used within looping 
structures to skip the rest of the current loop
+                                       // continue is used within looping 
structures to skip the rest of the current loop
                                        // iteration and continue execution at 
the beginning of the next iteration
-                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because it is 
not applicable to the default account<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because it is 
not applicable to the default account<br />'; }
                                        continue;
                                }
                                elseif (($this->bo->account_group == 
'extra_accounts')
                                && (!stristr($this_item['accts_usage'] , 
'extra_accounts')))
                                {
                                        // we are not supposed to show this 
item for extra accounts, skip this pref item
-                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because it is 
not applicable to the extra accounts<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because it is 
not applicable to the extra accounts<br />'; }
                                        continue;
                                }
                                elseif (strstr($this_item['type'] , 'INACTIVE'))
                                {
                                        // this item has been depreciated or 
otherwise no longer is being used
                                        // we are not supposed to show this 
item, skip this pref item
-                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because 
"INACTIVE" is in $this_item[type] : ['.$this_item['type'].']<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because 
"INACTIVE" is in $this_item[type] : ['.$this_item['type'].']<br />'; }
                                        continue;
                                }
-
+
                                // ----  ok to show this, continue...  ----
-                               if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block:  ... this item passed skip test, so it 
should be displayed ...<br>'; }
+                               if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block:  ... this item passed skip test, so it 
should be displayed ...<br />'; }
                                // ROW BACK COLOR
                                //$back_color = 
$this->nextmatchs->alternate_row_color($back_color);
                                $back_color = (($i + 1)/2 == floor(($i + 1)/2)) 
? $this->theme['row_off'] : $this->theme['row_on'];
                                $back_color_class = (($i + 1)/2 == floor(($i + 
1)/2)) ? 'row_off' : 'row_on';
-
+
                                $var = Array(
                                        'back_color'    => $back_color,
                                        'back_color_class'      => 
$back_color_class,
@@ -148,11 +148,11 @@
                                        'extra_text'    => ''
                                );
                                $this->tpl->set_var($var);
-
+
                                // this will be the HTTP_POST_VARS[*key*] key 
value, the "id" for the submitted pref item
                                if ($this->bo->account_group == 'default')
                                {
-                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: html post array $key for this item is 
$this_item[id]: '.$this_item['id'].'<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: html post array $key for this item is 
$this_item[id]: '.$this_item['id'].'<br />'; }
                                        $this->tpl->set_var('pref_id', 
$this_item['id']);
                                }
                                else
@@ -162,38 +162,38 @@
                                        // so the submitted prefs are then 
array based, wit the acctnum being the top level array item
                                        // and the pref item "id"'s being child 
elements of that acctnum
                                        $html_pref_id = 
$this->bo->acctnum.'['.$this_item['id'].']';
-                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: html post array $key for this item is 
$html_pref_id: '.$html_pref_id.'<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: html post array $key for this item is 
$html_pref_id: '.$html_pref_id.'<br />'; }
                                        $this->tpl->set_var('pref_id', 
$html_pref_id);
                                }
-
+
                                // we don't want to show a hidden value
                                if (!stristr($this_item['write_props'], 
'hidden'))
                                {
-                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: obtain $this_item_value, because 
"hidden" is not in $this_item[write_props]<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: obtain $this_item_value, because 
"hidden" is not in $this_item[write_props]<br />'; }
                                        // "user strings" may have quotes and 
stuff that need to be encoded b4 we display it
                                        if ($this_item['type'] == 'user_string')
                                        {
-                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] == "user string" , 
before htmlspecialchars_encode: 
[<code>'.$actual_user_prefs[$this_item['id']].'</code>]<br>'; }
+                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] == "user string" , 
before htmlspecialchars_encode: 
[<code>'.$actual_user_prefs[$this_item['id']].'</code>]<br />'; }
                                                $this_item_value = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($actual_user_prefs[$this_item['id']]);
-                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] == "user string" , 
after htmlspecialchars_encode: [<code>'.$this_item_value.'</code>]<br>'; }
+                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] == "user string" , 
after htmlspecialchars_encode: [<code>'.$this_item_value.'</code>]<br />'; }
                                        }
                                        else
                                        {
                                                $this_item_value = 
$actual_user_prefs[$this_item['id']];
-                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] NOT a "user string" 
, so NO htmlspecialchars_encode required: $this_item_value: 
[<code>'.$this_item_value.'</code>]<br>'; }
+                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] NOT a "user string" 
, so NO htmlspecialchars_encode required: $this_item_value: 
[<code>'.$this_item_value.'</code>]<br />'; }
                                        }
                                }
                                else
                                {
                                        // if the data is hidden (ex. a 
password), we do not show the value (obviously)
-                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: HIDDEN $this_item_value should be empty 
string, this "hidden" is in $this_item[write_props]<br>'; }
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: HIDDEN $this_item_value should be empty 
string, this "hidden" is in $this_item[write_props]<br />'; }
                                        $this_item_value = '';
                                        // tell user we are hiding the value 
(that's whay the box is empty)
                                        $prev_lang_blurb = 
$this->tpl->get_var('lang_blurb');
                                        $this->tpl->set_var('lang_blurb', 
$prev_lang_blurb.'&nbsp('.lang('hidden').')');
                                }
                                if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: after processing, $this_item_value: 
[<code>'.serialize($this_item_value).'</code>] ; $this_item DUMP <pre>'; 
print_r($this_item); echo '</pre>'; }
-
+
                                // ** possible widget are: **
                                // textarea
                                // textbox
@@ -205,13 +205,13 @@
                                        //$this_item_value = 
$actual_user_prefs[$this_item['id']];
                                        $this->tpl->set_var('pref_value', 
$this_item_value);
                                        
$this->tpl->parse('V_tr_textarea','B_tr_textarea');
-                                       $done_widget = 
$this->tpl->get_var('V_tr_textarea');
+                                       $done_widget = 
$this->tpl->get_var('V_tr_textarea');
                                }
                                elseif ($this_item['widget'] == 'textbox')
                                {
                                        $this->tpl->set_var('pref_value', 
$this_item_value);
                                        
$this->tpl->parse('V_tr_textbox','B_tr_textbox');
-                                       $done_widget = 
$this->tpl->get_var('V_tr_textbox');
+                                       $done_widget = 
$this->tpl->get_var('V_tr_textbox');
                                }
                                elseif ($this_item['widget'] == 'passwordbox')
                                {
@@ -219,14 +219,14 @@
                                        // if $this_item['write_props'] 
contains the word "hidden"
                                        $this->tpl->set_var('pref_value', 
$this_item_value);
                                        
$this->tpl->parse('V_tr_passwordbox','B_tr_passwordbox');
-                                       $done_widget = 
$this->tpl->get_var('V_tr_passwordbox');
+                                       $done_widget = 
$this->tpl->get_var('V_tr_passwordbox');
                                }
                                elseif ($this_item['widget'] == 'combobox')
                                {
                                        // set up combobox available options as 
KEYS array with empty VALUES
                                        reset($this_item['values']);
                                        $combo_availables = Array();
-                                       $x = 0;
+                                       $x = 0;
                                        while ( list ($key,$prop) = each 
($this_item['values']))
                                        {
                                                $combo_availables[$key] = '';
@@ -240,14 +240,14 @@
                                        $x = 0;
                                        while ( list ($key,$prop) = each 
($this_item['values']))
                                        {
-                                               $combobox_html .=
+                                               $combobox_html .=
                                                        '<option 
value="'.$key.'"'.$combo_available[$key].'>'.$prop.'</option>' ."\r\n";
                                                $x++;
                                        }
                                        $this_item_value = $combobox_html;
                                        $this->tpl->set_var('pref_value', 
$this_item_value);
                                        
$this->tpl->parse('V_tr_combobox','B_tr_combobox');
-                                       $done_widget = 
$this->tpl->get_var('V_tr_combobox');
+                                       $done_widget = 
$this->tpl->get_var('V_tr_combobox');
                                }
                                elseif ($this_item['widget'] == 'checkbox')
                                {
@@ -261,16 +261,16 @@
                                        }
                                        $this->tpl->set_var('pref_value', 
$this_item_value);
                                        
$this->tpl->parse('V_tr_checkbox','B_tr_checkbox');
-                                       $done_widget = 
$this->tpl->get_var('V_tr_checkbox');
+                                       $done_widget = 
$this->tpl->get_var('V_tr_checkbox');
                                }
                                else
                                {
-                                       //$this->pref_errors .= 'call for 
unsupported widget:'.$this_item['widget'].'<br>';
+                                       //$this->pref_errors .= 'call for 
unsupported widget:'.$this_item['widget'].'<br />';
                                        $this->tpl->set_var('back_color', 
$back_color);
                                        $this->tpl->set_var('back_color_class', 
$back_color_class);
                                        $this->tpl->set_var('section_title', 
'call for unsupported widget:'.$this_item['widget']);
                                        
$this->tpl->parse('V_tr_sec_title','B_tr_sec_title');
-                                       $done_widget = 
$this->tpl->get_var('V_tr_sec_title');
+                                       $done_widget = 
$this->tpl->get_var('V_tr_sec_title');
                                }
                                // add long help if requested
                                if 
((isset($GLOBALS['phpgw']->msg->ref_GET['show_help']))
@@ -282,10 +282,10 @@
                                // for each loop, add the finished widget row 
to the return_block variable
                                $return_block .= $done_widget;
                        }
-                       if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: LEAVING, returning $return_block if 
widgets<br>'; }
+                       if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: LEAVING, returning $return_block if 
widgets<br />'; }
                        return $return_block;
                }
-
+
                /*!
                @function preferences
                @abstract call this function to display the typical UI html 
page for email preferences
@@ -316,7 +316,7 @@
                                $this->preferences_default_acct_zero();
                        }
                }
-
+
                /*!
                @function preferences_default_acct_zero
                @abstract call this function to display the UI html page for 
email preferences for the Default Account
@@ -329,11 +329,11 @@
                function preferences_default_acct_zero()
                {
                        // this tells "create_prefs_block" that we are dealing 
with the default email account
-                       if ($this->debug > 0) { echo 
'email.uipreferences.preferences: ENTERING, this function *should* only be 
called for the default email account prefs submission<br>'; }
-                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to set $this->bo->account_group<br>'; }
+                       if ($this->debug > 0) { echo 
'email.uipreferences.preferences: ENTERING, this function *should* only be 
called for the default email account prefs submission<br />'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to set $this->bo->account_group<br />'; 
}
                        $this->bo->account_group = 'default';
-                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: just set $this->bo->account_group to 
['.$this->bo->account_group.']<br>'; }
-
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: just set $this->bo->account_group to 
['.$this->bo->account_group.']<br />'; }
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we point to the global template for this 
version of phpgw templatings
@@ -345,7 +345,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -358,7 +358,7 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(
                                Array(
                                        'T_prefs_ui_out'        => 
'class_prefs_ui.tpl',
@@ -375,7 +375,7 @@
                        
$this->tpl->set_block('T_pref_blocks','B_tr_checkbox','V_tr_checkbox');
                        
$this->tpl->set_block('T_pref_blocks','B_submit_btn_only','V_submit_btn_only');
                        
$this->tpl->set_block('T_pref_blocks','B_submit_and_cancel_btns','V_submit_and_cancel_btns');
-
+
                        $var = Array(
                                'pref_errors'           => '',
                                'page_title'            => lang('E-Mail 
preferences'),
@@ -396,16 +396,16 @@
                                'btn_cancel_url'        => 
$GLOBALS['phpgw']->link('/preferences/index.php',array())
                        );
                        $this->tpl->set_var($var);
-
+
                        // this will fill the $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays
-                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: calling $this->bo->init_available_prefs() to 
init $this->bo->std_prefs[] and cust_prefs[]  "schema" arrays<br>'; }
-                       $this->bo->init_available_prefs();
-
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: calling $this->bo->init_available_prefs() to 
init $this->bo->std_prefs[] and cust_prefs[]  "schema" arrays<br />'; }
+                       $this->bo->init_available_prefs();
+
                        if ($this->debug > 3) { echo 
'email.uipreferences.preferences: initiated schema dump:'; 
$this->bo->debug_dump_prefs(); }
-
+
                        // initialize a local var to hold the cumulative main 
block data
                        $prefs_ui_rows = '';
-
+
                        // ---  Standars Prefs  ---
                        // section title for standars prefs
                        $this->tpl->set_var('section_title', lang('Standard 
E-Mail preferences'));
@@ -435,43 +435,43 @@
                        // add the finished widget row to the main block 
variable
                        $prefs_ui_rows .= $done_widget;
                        // generate Std Prefs HTML Block
-                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to generate the html for standard email 
prefs block<br>'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to generate the html for standard email 
prefs block<br />'; }
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->std_prefs);
-
+
                        // blank row
                        $this->tpl->set_var('back_color', 
$this->theme['bg_color']);
                        $done_widget = 
$this->tpl->parse('V_tr_blank','B_tr_blank');
                        $prefs_ui_rows .= $done_widget;
-
+
                        // ---  Custom Prefs  ---
                        $this->tpl->set_var('section_title', lang('Custom 
E-Mail preferences'));
                        $done_widget = 
$this->tpl->parse('V_tr_sec_title','B_tr_sec_title');
                        $prefs_ui_rows .= $done_widget;
                        // generate Custom Prefs HTML Block
-                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to generate the html for custom email 
prefs block<br>'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to generate the html for custom email 
prefs block<br />'; }
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->cust_prefs);
-
+
                        // blank row
                        $this->tpl->set_var('back_color', 
$this->theme['bg_color']);
                        $done_widget = 
$this->tpl->parse('V_tr_blank','B_tr_blank');
                        $prefs_ui_rows .= $done_widget;
-
+
                        // ---  Commit HTML Prefs rows to Main Template
                        // put all widget rows data into the template var
                        $this->tpl->set_var('prefs_ui_rows', $prefs_ui_rows);
-
+
                        // Submit Button only
                        //$submit_btn_row = 
$this->tpl->parse('V_submit_btn_only','B_submit_btn_only');
                        //$this->tpl->set_var('submit_btn_row', 
$submit_btn_row);
                        // Submit Button and Cancel button
                        $submit_btn_row = 
$this->tpl->parse('V_submit_and_cancel_btns','B_submit_and_cancel_btns');
                        $this->tpl->set_var('submit_btn_row', $submit_btn_row);
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
-
+
                        // output the template
-                       if ($this->debug > 0) { echo 
'email.uipreferences.preferences: LEAVING, about to output the template<br>'; }
+                       if ($this->debug > 0) { echo 
'email.uipreferences.preferences: LEAVING, about to output the template<br />'; 
}
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                $this->tpl->set_unknowns('comment');
@@ -491,7 +491,7 @@
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
                }
-
+
                /*!
                @function ex_accounts_edit
                @abstract call this function to display the typical UI html 
page Extra Email Accounts Preferences
@@ -501,17 +501,17 @@
                function ex_accounts_edit()
                {
                        // this tells "create_prefs_block" that we are dealing 
with the extra email accounts
-                       if ($this->debug > 0) { echo 
'email.uipreferences.ex_accounts_edit: ENTERING, this function *should* only be 
called for the EXTRA email account prefs submission<br>'; }
-                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to set 
$this->bo->account_group<br>'; }
+                       if ($this->debug > 0) { echo 
'email.uipreferences.ex_accounts_edit: ENTERING, this function *should* only be 
called for the EXTRA email account prefs submission<br />'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to set $this->bo->account_group<br 
/>'; }
                        $this->bo->account_group = 'extra_accounts';
-                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: just set $this->bo->account_group to 
['.$this->bo->account_group.']<br>'; }
-
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: just set $this->bo->account_group to 
['.$this->bo->account_group.']<br />'; }
+
                        // obtain the acctnum for the extra email account we 
are dealing with here
                        $acctnum = $this->bo->obtain_ex_acctnum();
-                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: $this->bo->obtain_ex_acctnum() returns 
['.serialize($acctnum).']<br>'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: $this->bo->obtain_ex_acctnum() returns 
['.serialize($acctnum).']<br />'; }
                        $this->bo->acctnum = $acctnum;
-                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: we just set $this->bo->acctnum to 
['.serialize($this->bo->acctnum).']<br>'; }
-
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: we just set $this->bo->acctnum to 
['.serialize($this->bo->acctnum).']<br />'; }
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                // we point to the global template for this 
version of phpgw templatings
@@ -523,7 +523,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -536,7 +536,7 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(
                                Array(
                                        'T_prefs_ui_out'        => 
'class_prefs_ui.tpl',
@@ -553,7 +553,7 @@
                        
$this->tpl->set_block('T_pref_blocks','B_tr_checkbox','V_tr_checkbox');
                        
$this->tpl->set_block('T_pref_blocks','B_submit_btn_only','V_submit_btn_only');
                        
$this->tpl->set_block('T_pref_blocks','B_submit_and_cancel_btns','V_submit_and_cancel_btns');
-
+
                        $var = Array(
                                'pref_errors'           => '',
                                'page_title'            => lang('E-Mail Extra 
Accounts'),
@@ -580,16 +580,16 @@
                                )
                        );
                        $this->tpl->set_var($var);
-
+
                        // this will fill the $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays
-                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: calling 
$this->bo->init_available_prefs() to init $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays<br>'; }
-                       $this->bo->init_available_prefs();
-
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: calling 
$this->bo->init_available_prefs() to init $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays<br />'; }
+                       $this->bo->init_available_prefs();
+
                        if ($this->debug > 3) { echo 
'email.uipreferences.ex_accounts_edit: initiated schema dump:'; 
$this->bo->debug_dump_prefs(); }
-
+
                        // initialize a local var to hold the cumulative main 
block data
                        $prefs_ui_rows = '';
-
+
                        // ---  Extra Account Pref Items  ---
                        // section title
                        $this->tpl->set_var('section_title', '*** 
'.lang('E-Mail Extra Account').' *** '.lang('Number').' '.$this->bo->acctnum);
@@ -620,19 +620,19 @@
                        $done_widget = 
$this->tpl->parse('V_tr_sec_title','B_tr_sec_title');
                        // add the finished widget row to the main block 
variable
                        $prefs_ui_rows .= $done_widget;
-
+
                        // instructions: fill in everything you need
                        $this->tpl->set_var('section_title', lang('Please fill 
in everything you need'));
                        // parse the block,
                        $done_widget = 
$this->tpl->parse('V_tr_sec_title','B_tr_sec_title');
                        // get the parsed data and put into a local variable
-                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to generate the html for standard 
email prefs block<br>'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to generate the html for standard 
email prefs block<br />'; }
                        // add the finished widget row to the main block 
variable
                        $prefs_ui_rows .= $done_widget;
-
+
                        // generate Std Prefs HTML Block
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->std_prefs);
-
+
                        // ---  Custom Prefs  ---
                        $this->tpl->set_var('section_title', lang('Custom 
E-Mail Settings').' &#040;'.lang('required').'&#041;');
                        $done_widget = 
$this->tpl->parse('V_tr_sec_title','B_tr_sec_title');
@@ -642,27 +642,27 @@
                        $done_widget = 
$this->tpl->parse('V_tr_sec_title','B_tr_sec_title');
                        $prefs_ui_rows .= $done_widget;
                        // generate Custom Prefs HTML Block
-                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to generate the html for custom 
email prefs block<br>'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to generate the html for custom 
email prefs block<br />'; }
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->cust_prefs);
-
+
                        // blank row
                        $this->tpl->set_var('back_color', 
$this->theme['bg_color']);
                        $done_widget = 
$this->tpl->parse('V_tr_blank','B_tr_blank');
                        $prefs_ui_rows .= $done_widget;
-
+
                        // ---  Commit HTML Prefs rows to Main Template
                        // put all widget rows data into the template var
                        $this->tpl->set_var('prefs_ui_rows', $prefs_ui_rows);
-
+
                        // Submit Button and Cancel button
                        $submit_btn_row = 
$this->tpl->parse('V_submit_and_cancel_btns','B_submit_and_cancel_btns');
                        $this->tpl->set_var('submit_btn_row', $submit_btn_row);
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
-
+
                        // output the template
-                       if ($this->debug > 0) { echo 
'email.uipreferences.ex_accounts_edit: LEAVING, about to output the 
template<br>'; }
+                       if ($this->debug > 0) { echo 
'email.uipreferences.ex_accounts_edit: LEAVING, about to output the template<br 
/>'; }
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                $this->tpl->set_unknowns('comment');
@@ -682,8 +682,8 @@
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
                }
-
-
+
+
                function ex_accounts_list()
                {
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
@@ -697,7 +697,7 @@
                                // we use a PRIVATE template object for 0.9.14 
conpat and during xslt porting
                                $this->tpl = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        }
-
+
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -710,14 +710,14 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(
                                Array(
                                        'T_prefs_ex_accounts'   => 
'class_prefs_ex_accounts.tpl'
                                )
                        );
                        
$this->tpl->set_block('T_prefs_ex_accounts','B_accts_list','V_accts_list');
-
+
                        $var = Array(
                                'pref_errors'           => '',
                                'font'                          => 
$this->theme['font'],
@@ -731,10 +731,10 @@
                                'lang_delete'           => lang('Delete')
                        );
                        $this->tpl->set_var($var);
-
+
                        $acctount_list = array();
                        $acctount_list = $this->bo->ex_accounts_list();
-
+
                        // here's what we get back
                        //$acctount_list[$X]['acctnum']
                        //$acctount_list[$X]['status']
@@ -745,9 +745,9 @@
                        //$acctount_list[$X]['edit_href']
                        //$acctount_list[$X]['delete_url']
                        //$acctount_list[$X]['delete_href']
-
+
                        if ($this->debug) { echo 'email: 
uipreferences.ex_accounts_list: $acctount_list dump<pre>'; 
print_r($acctount_list); echo '</pre>'; }
-
+
                        $tr_color = $this->theme['row_off'];
                        $loops = count($acctount_list);
                        if ($loops == 0)
@@ -788,15 +788,15 @@
                                                                        
.'&ex_acctnum='.$this->bo->add_new_account_token);
                        $add_new_acct_href = '<a 
href="'.$add_new_acct_url.'">'.lang('New Account').'</a>';
                        
$this->tpl->set_var('add_new_acct_href',$add_new_acct_href);
-
+
                        $done_url = $GLOBALS['phpgw']->link(
                                                                        
'/preferences/index.php');
                        $done_href = '<a 
href="'.$done_url.'">'.lang('Done').'</a>';
                        $this->tpl->set_var('done_href',$done_href);
-
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
-
+
                        // output the template
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {

====================================================
Index: email/inc/class.uisearch.inc.php
diff -u email/inc/class.uisearch.inc.php:1.2 
email/inc/class.uisearch.inc.php:1.3
--- email/inc/class.uisearch.inc.php:1.2        Thu Dec 30 23:13:50 2004
+++ email/inc/class.uisearch.inc.php    Sun Mar 13 23:22:44 2005
@@ -353,7 +353,7 @@
                                $num_msg = 0;

                                # No messages found
-                               echo '<br>'.lang("No message found in folder 
'%1'",$search_vars['fldball']['folder']).'<br><br><br>';
+                               echo '<br />'.lang("No message found in folder 
'%1'",$search_vars['fldball']['folder']).'<br /><br /><br />';

                                continue;
                        }

====================================================
Index: email/inc/hook_notifywindow.inc.php
diff -u email/inc/hook_notifywindow.inc.php:1.12 
email/inc/hook_notifywindow.inc.php:1.13
--- email/inc/hook_notifywindow.inc.php:1.12    Thu Dec 30 23:13:50 2004
+++ email/inc/hook_notifywindow.inc.php Sun Mar 13 23:22:44 2005
@@ -14,7 +14,7 @@
        $d1 = strtolower(substr(APP_INC,0,3));
        if($d1 == 'htt' || $d1 == 'ftp' )
        {
-               echo "Failed attempt to break in via an old Security 
Hole!<br>\n";
+               echo "Failed attempt to break in via an old Security Hole!<br 
/>\n";
                $GLOBALS['phpgw']->common->phpgw_exit();
        }
        unset($d1);
@@ -70,21 +70,21 @@

                        if($new_msgs>0)
                        {
-                               echo '<a 
href="JavaScript:CheckEmail();"><b>New:</b> '.$new_msgs.'</a><br>';
+                               echo '<a 
href="JavaScript:CheckEmail();"><b>New:</b> '.$new_msgs.'</a><br />';
                                $urgent=true;
                        }
                        else
                        {
-                               echo '<a 
href="JavaScript:CheckEmail();"><b>New:</b> None</a><br>'."\r\n";
+                               echo '<a 
href="JavaScript:CheckEmail();"><b>New:</b> None</a><br />'."\r\n";
                        }

                        if($inbox_data['number_new']>0)
                        {
-                               echo '<a 
href="JavaScript:CheckEmail();"><b>Unread:</b> 
'.$inbox_data['number_new'].'</a><br>'."\r\n";
+                               echo '<a 
href="JavaScript:CheckEmail();"><b>Unread:</b> 
'.$inbox_data['number_new'].'</a><br />'."\r\n";
                        }
                        else
                        {
-                               echo '<a 
href="JavaScript:CheckEmail();"><b>Unread:</b> None</a><br>'."\r\n";
+                               echo '<a 
href="JavaScript:CheckEmail();"><b>Unread:</b> None</a><br />'."\r\n";
                        }

                        if($inbox_data['number_all']<100)

====================================================
Index: email/inc/hook_notifywindow_simple.inc.php
diff -u email/inc/hook_notifywindow_simple.inc.php:1.10 
email/inc/hook_notifywindow_simple.inc.php:1.11
--- email/inc/hook_notifywindow_simple.inc.php:1.10     Thu Dec 30 23:13:50 2004
+++ email/inc/hook_notifywindow_simple.inc.php  Sun Mar 13 23:22:44 2005
@@ -14,7 +14,7 @@
        $d1 = strtolower(substr(APP_INC,0,3));
        if($d1 == 'htt' || $d1 == 'ftp' )
        {
-               echo "Failed attempt to break in via an old Security 
Hole!<br>\n";
+               echo "Failed attempt to break in via an old Security Hole!<br 
/>\n";
                $GLOBALS['phpgw']->common->phpgw_exit();
        }
        unset($d1);

====================================================

====================================================
Index: email/inc/hook_home.inc.php
diff -u email/inc/hook_home.inc.php:1.57 email/inc/hook_home.inc.php:1.58
--- email/inc/hook_home.inc.php:1.57    Thu Dec 30 23:13:50 2004
+++ email/inc/hook_home.inc.php Sun Mar 13 23:22:44 2005
@@ -14,7 +14,7 @@
        $d1 = 
strtolower(substr($GLOBALS['phpgw_info']['server']['app_inc'],0,3));
        if($d1 == 'htt' || $d1 == 'ftp' )
        {
-               echo "Failed attempt to break in via an old Security 
Hole!<br>\n";
+               echo "Failed attempt to break in via an old Security Hole!<br 
/>\n";
                $GLOBALS['phpgw']->common->phpgw_exit();
        }
        unset($d1);
@@ -81,7 +81,7 @@
                for($i=0; $i<$check_msgs; $i++)
                {
                        $this_loop_msgball = 
$GLOBALS['phpgw']->msg->ball_data_parse_str($msgball_list[$i]);
-                       //if ($debug_hook_home > 1) { echo ' * 
hook_home('.__LINE__.'): $msgball_list['.$i.'] ['.$msgball_list[$i].']; 
$this_loop_msgball: ['.serialize($this_loop_msgball).']<br>'; }
+                       //if ($debug_hook_home > 1) { echo ' * 
hook_home('.__LINE__.'): $msgball_list['.$i.'] ['.$msgball_list[$i].']; 
$this_loop_msgball: ['.serialize($this_loop_msgball).']<br />'; }
                        $msg_headers = 
$GLOBALS['phpgw']->msg->phpgw_header($this_loop_msgball);
                        $subject = 
$GLOBALS['phpgw']->msg->get_subject($msg_headers,'');
                        if(strlen($subject) > 65)
@@ -276,7 +276,7 @@
                                                '</ul>'."\r\n"
                                        .'</td>'."\r\n"
                                .'</tr>'."\r\n"
-                               .'<tr><td><hr></td></tr>'."\r\n"
+                               .'<tr><td><hr /></td></tr>'."\r\n"
                                .'<tr>'."\r\n"
                                        .$form_folder_switch_opentag
                                        .'<td width="100%" align="left">'."\r\n"

====================================================
Index: email/inc/functions.inc.php
diff -u email/inc/functions.inc.php:1.118 email/inc/functions.inc.php:1.119
--- email/inc/functions.inc.php:1.118   Thu Dec 30 23:13:50 2004
+++ email/inc/functions.inc.php Sun Mar 13 23:22:44 2005
@@ -16,7 +16,7 @@
        $d1 = strtolower(substr(APP_INC,0,3));
        if($d1 == 'htt' || $d1 == 'ftp' )
        {
-               echo "Failed attempt to break in via an old Security 
Hole!<br>\n";
+               echo "Failed attempt to break in via an old Security Hole!<br 
/>\n";
                $GLOBALS['phpgw']->common->phpgw_exit();
        }
        unset($d1);

====================================================

====================================================
Index: email/inc/class.uiattach_file.inc.php
diff -u email/inc/class.uiattach_file.inc.php:1.3 
email/inc/class.uiattach_file.inc.php:1.4
--- email/inc/class.uiattach_file.inc.php:1.3   Thu Dec 30 23:13:50 2004
+++ email/inc/class.uiattach_file.inc.php       Sun Mar 13 23:22:44 2005
@@ -35,7 +35,7 @@

                function attach()
                {
-                       if ($this->debug > 0) { echo 'ENTERING 
emai.uiattach_file.attach'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING 
emai.uiattach_file.attach'.'<br />'; }
                        if ($this->debug > 2) { echo 
'emai.uiattach_file.attach: initial $GLOBALS[phpgw_info][flags] DUMP<pre>'; 
print_r($GLOBALS['phpgw_info']['flags']);  echo '</pre>'; }
                        //return;

@@ -84,7 +84,7 @@
                        }

                        // shut down this transaction
-                       if ($this->debug > 0) { echo 'LEAVING 
emai.uiattach_file.attach with call to phpgw_exit'.'<br>'; }
+                       if ($this->debug > 0) { echo 'LEAVING 
emai.uiattach_file.attach with call to phpgw_exit'.'<br />'; }
                        $GLOBALS['phpgw']->common->phpgw_exit(False);
                }


====================================================
Index: email/inc/class.ui_mail_debug.inc.php
diff -u email/inc/class.ui_mail_debug.inc.php:1.3 
email/inc/class.ui_mail_debug.inc.php:1.4
--- email/inc/class.ui_mail_debug.inc.php:1.3   Thu Dec 30 23:13:50 2004
+++ email/inc/class.ui_mail_debug.inc.php       Sun Mar 13 23:22:44 2005
@@ -2,7 +2,7 @@
        
/**************************************************************************\
        * AngleMail - E-Mail Module for phpGroupWare                            
        *
        * http://www.anglemail.org                                              
                        *
-       * http://www.phpgroupware.org                                           
                        *
+       * http://www.phpgroupware.org                                           
                        *
        */
        
/**************************************************************************\
        * AngleMail - E-Mail Debug Page                                         
                *
@@ -22,25 +22,25 @@
        * along with this library; if not, write to the Free Software 
Foundation,               *
        * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
        *
        
\**************************************************************************/
-
+
        /* $Id$ */
-
+
        /*!
        @class ui_mail_debug
        @abstract Useful debug and inline docs access page.
-       @discussion Uncomment the "public_functions" line to enable the Email 
Debug Page.
+       @discussion Uncomment the "public_functions" line to enable the Email 
Debug Page.
        Should be disabled by default, this is a developers tool.
        @author Angles
-       */
+       */
        class ui_mail_debug
        {
                
/**************************************************************************\
                *       VARS
                
\**************************************************************************/
-
+
                /*!
                @capability Debug Page
-               @discussion Uncomment the next line of code to enable the Email 
Debug Page.
+               @discussion Uncomment the next line of code to enable the Email 
Debug Page.
                This is file email / class.ui_mail_debug.inc.php
                */
                // UNCOMMENT TO ENABLE THIS PAGE
@@ -49,40 +49,40 @@
                var $debug=0;
                //var $debug=1;
                var $tpl='##NOTHING##';
-
+
                /*!
                @function ui_mail_debug
                @abstract CONSTRUCTOR
                */
                function ui_mail_debug()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.CONSTRUCTOR'.'<br>'."\r\n"; }
-
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.CONSTRUCTOR'.'<br />'."\r\n"; }
+
                        $this->widgets = CreateObject("email.html_widgets");
                        $this->ensure_tpl_object();
-                       if ($this->debug > 0) { echo 'EXIT: 
email.ui_mail_debug.CONSTRUCTOR'.'<br>'."\r\n"; }
+                       if ($this->debug > 0) { echo 'EXIT: 
email.ui_mail_debug.CONSTRUCTOR'.'<br />'."\r\n"; }
                }
-
+
                /*!
                @function invoke_bootatrap
                @abstract convience function to bootstrap msg object
-               @discussion in debugging we may not have or want a ->msg 
object, but if we do
-               need one, like now we need it just to get the GPC vars (or 
change the code here to _GET),
+               @discussion in debugging we may not have or want a ->msg 
object, but if we do
+               need one, like now we need it just to get the GPC vars (or 
change the code here to _GET),
                or just make -> msg object an use ->ref_GET or whatever else 
you need it for
                @author Angles
                */
                function invoke_bootatrap()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.invoke_bootatrap'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.invoke_bootatrap'.'<br />'; }
                        // make sure we have msg object and a server stream
                        $this->msg_bootstrap = 
CreateObject("email.msg_bootstrap");
                        // FIX ME: do_login False when using msg for UTILITY, 
does that still work?
                        //$this->msg_bootstrap->set_do_login(False);
-                       
$this->msg_bootstrap->ensure_mail_msg_exists('emai.ui_mail_debug.invoke_bootatrap',
 $this->debug);
-
-                       if ($this->debug > 0) { echo 'EXITing: 
email.ui_mail_debug.invoke_bootatrap'.'<br>'; }
+                       
$this->msg_bootstrap->ensure_mail_msg_exists('emai.ui_mail_debug.invoke_bootatrap',
 $this->debug);
+
+                       if ($this->debug > 0) { echo 'EXITing: 
email.ui_mail_debug.invoke_bootatrap'.'<br />'; }
                }
-
+
                /*!
                @function end_msg_session_object
                @abstract convience function to logout and then clear and unset 
the msg object, if it exists
@@ -91,7 +91,7 @@
                */
                function end_msg_session_object()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.end_msg_session_object'.'<br>'; }
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.end_msg_session_object'.'<br />'; }
                        // kill this script, we re outa here...
                        if (is_object($GLOBALS['phpgw']->msg))
                        {
@@ -101,7 +101,7 @@
                        }
                        // WHEN do we need to call phpgw_exit now with updated 
phpgw API?
                        //$GLOBALS['phpgw']->common->phpgw_exit(False);
-                       if ($this->debug > 0) { echo 'EXITing: 
email.ui_mail_debug.end_msg_session_object'.'<br>'; }
+                       if ($this->debug > 0) { echo 'EXITing: 
email.ui_mail_debug.end_msg_session_object'.'<br />'; }
                }

                /*!
@@ -127,23 +127,23 @@
                                }
                        }
                }
-
+
                
/**************************************************************************\
                *       CODE
                
\**************************************************************************/
                /*!
                @function index
                @abstract This page is displayed by exposing this as a public 
function then calling it .
-               @discussion Uncomment the "public_functions" line to enable the 
Email Debug Page.
-               Should be disabled by default, this is a developers tool. If 
enabled, call this function to
+               @discussion Uncomment the "public_functions" line to enable the 
Email Debug Page.
+               Should be disabled by default, this is a developers tool. If 
enabled, call this function to
                display the page.
                @example /index.php?menuaction=email.ui_mail_debug.index
                @author Angles
-               */
+               */
                function index()
                {
-                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.index'.'<br>'; }
-
+                       if ($this->debug > 0) { echo 'ENTERING: 
email.ui_mail_debug.index'.'<br />'; }
+
                        if (is_object($GLOBALS['phpgw']->xslttpl) == False)
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
@@ -156,122 +156,122 @@
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data'));
                        }
-
+
                        $this->tpl->set_file(array(
                                'T_debug_main' => 'debug.tpl'
                        ));
                        
$this->tpl->set_block('T_debug_main','B_before_echo','V_before_echo');
                        
$this->tpl->set_block('T_debug_main','B_after_echo','V_after_echo');
-
-
+
+
                        $this->tpl->set_var('page_desc', 'Email Debug Stuff');
-
+
                        // make a list of available debub calls
                        // Enviornment data
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=phpinfo'));
                        //$this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('phpinfo page');
                        $this->tpl->set_var('func_E1', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=get_defined_constants'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('get_defined_constants 
DUMP');
                        $this->tpl->set_var('func_E2', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=globals_dump'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('dump the entire 
globals[] array');
                        $this->tpl->set_var('func_E3', 
$this->widgets->get_href());
-
+
                        // DUMP functions
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=common.debug_list_core_functions'));
                        
$this->widgets->set_href_clickme('common.debug_list_core_functions');
                        $this->tpl->set_var('func_D1', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=globals_phpgw_dump'));
                        $this->widgets->set_href_clickme('dump the entire 
globals[phpgw] structure');
                        $this->tpl->set_var('func_D2', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=globals_phpgw_info_dump'));
                        $this->widgets->set_href_clickme('dump the entire 
globals[phpgw_info] structure');
                        $this->tpl->set_var('func_D3', 
$this->widgets->get_href());
-
+
                        
//$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=globals_phpgw_session_dump'));
                        //$this->widgets->set_href_clickme('dump the entire 
globals[phpgw_session] structure');
                        //$this->tpl->set_var('func_D4', 
$this->widgets->get_href());
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=ref_session_dump'));
                        $this->widgets->set_href_clickme('dump the entire 
msg->ref_SESSION structure');
                        $this->tpl->set_var('func_D4', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=msg_object_dump'));
                        $this->widgets->set_href_clickme('dump the entire 
globals[phpgw]->msg object');
                        $this->tpl->set_var('func_D5', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=preferences_object_dump'));
                        $this->widgets->set_href_clickme('dump the entire 
$GLOBALS[phpgw]->preferences object');
                        $this->tpl->set_var('func_D6', 
$this->widgets->get_href());
-
+
                        // inline docs
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/doc/inlinedocparser.php?app=phpgwapi'));
                        $this->widgets->set_href_target('new');
-                       $this->widgets->set_href_clickme('inlinedocparser for 
phpgwapi');
+                       $this->widgets->set_href_clickme('inlinedocparser for 
phpgwapi');
                        $this->tpl->set_var('func_I1', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/doc/inlinedocparser.php?app=phpwebhosting'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('inlinedocparser for 
phpwebhosing VFS');
                        $this->tpl->set_var('func_I2', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/doc/inlinedocparser.php?app=email'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('inlinedocparser for 
email');
                        $this->tpl->set_var('func_I3', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/doc/inlinedocparser.php?app=email&fn=class.mail_msg_base.inc.php'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('inlinedocparser for 
email, file "class.mail_msg_base.inc.php"');
                        $this->tpl->set_var('func_I4', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/doc/inlinedocparser.php?app=email&fn=class.mail_msg_display.inc.php'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('inlinedocparser for 
email, file "class.mail_msg_display.inc.php"');
                        $this->tpl->set_var('func_I5', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/doc/inlinedocparser.php?app=email&fn=class.mail_msg_wrappers.inc.php'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('inlinedocparser for 
email, file "class.mail_msg_wrappers.inc.php"');
                        $this->tpl->set_var('func_I6', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/doc/inlinedocparser.php?app=email&fn=class.mail_dcom_imap_sock.inc.php'));
                        $this->widgets->set_href_target('new');
                        $this->widgets->set_href_clickme('inlinedocparser for 
email, file "class.mail_dcom_imap_sock.inc.php"');
                        $this->tpl->set_var('func_I7', 
$this->widgets->get_href());
-
+
                        // other stuff
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=copyinteresting'));
                        $this->widgets->set_href_clickme('copy emails in BOB 
interesting to Local folder (no workie)');
                        $this->tpl->set_var('func_O1', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=env_test'));
                        $this->widgets->set_href_clickme('utility for testing 
env code parts');
                        $this->tpl->set_var('func_O2', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=db_admin_make_table'));
                        $this->widgets->set_href_clickme('Create the email DB 
table');
                        $this->tpl->set_var('func_O3', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=db_admin_rm_table'));
                        $this->widgets->set_href_clickme('Delete the email DB 
table');
                        $this->tpl->set_var('func_O4', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=db_admin_clear_entire_table'));
                        $this->widgets->set_href_clickme('Wipe the email DB 
table');
                        $this->tpl->set_var('func_O5', 
$this->widgets->get_href());
-
+
                        
$this->widgets->set_href_link($GLOBALS['phpgw']->link('/index.php','menuaction=email.ui_mail_debug.index&dfunc=db_am_table_exists'));
                        $this->widgets->set_href_clickme('Check if email DB 
table exists');
                        $this->tpl->set_var('func_O6', 
$this->widgets->get_href());
-
+
                        if (is_object($GLOBALS['phpgw']->xslttpl) == False)
                        {
                                
$this->tpl->parse('V_before_echo','B_before_echo');
@@ -298,55 +298,54 @@
                                // new way to handle debug data, if there is 
debug data, this will put it in the template source data vars
                                $this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
                                $data['email_page'] = 
$this->tpl->parse('out','T_debug_main');
-                               
//$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
                                $GLOBALS['phpgw']->xslttpl->pp();
                        }
-
-                       if ($this->debug > 0) { echo 'EXITing...: 
email.ui_mail_debug.index'.'<br>'; }
-
+
+                       if ($this->debug > 0) { echo 'EXITing...: 
email.ui_mail_debug.index'.'<br />'; }
+
                        $this->end_msg_session_object();
                }
-
+
                function show_desired_data()
                {
                        // DAMN, we need a ->msg just to do the ref_GET stuff 
and tpl stuff
                        $this->invoke_bootatrap();
-
+
                        // NOW WE HAVE A MSG OBJECT!!! we can use its debug 
functions now
-
-                       //echo 'REQUEST_URI: 
'.$GLOBALS['phpgw']->msg->ref_SERVER['REQUEST_URI'].'<br>';
-                       //echo 'QUERY_STRING: 
'.$GLOBALS['phpgw']->msg->ref_SERVER['QUERY_STRING'].'<br>';
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 REQUEST_URI: '.$GLOBALS['phpgw']->msg->ref_SERVER['REQUEST_URI'].'<br>');
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 QUERY_STRING: '.$GLOBALS['phpgw']->msg->ref_SERVER['QUERY_STRING'].'<br>');
-
+
+                       //echo 'REQUEST_URI: 
'.$GLOBALS['phpgw']->msg->ref_SERVER['REQUEST_URI'].'<br />';
+                       //echo 'QUERY_STRING: 
'.$GLOBALS['phpgw']->msg->ref_SERVER['QUERY_STRING'].'<br />';
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 REQUEST_URI: '.$GLOBALS['phpgw']->msg->ref_SERVER['REQUEST_URI'].'<br />');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 QUERY_STRING: '.$GLOBALS['phpgw']->msg->ref_SERVER['QUERY_STRING'].'<br />');
+
                        $desired_function = '';
                        $uri_confirm = '';
-
+
                        if ((isset($GLOBALS['phpgw']->msg->ref_GET['dfunc']))
                        && ($GLOBALS['phpgw']->msg->ref_GET['dfunc'] != ''))
                        {
                                $desired_function = 
$GLOBALS['phpgw']->msg->ref_GET['dfunc'];
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 You requested: '.$desired_function.'<br>');
-
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 You requested: '.$desired_function.'<br />');
+
                                // some things require you manually type in 
"&confirn=1" to really make it work
                                if 
((isset($GLOBALS['phpgw']->msg->ref_GET['confirm']))
                                && ($GLOBALS['phpgw']->msg->ref_GET['confirm'] 
!= ''))
                                {
                                        $uri_confirm = 
$GLOBALS['phpgw']->msg->ref_GET['confirm'];
-                                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 confirm token is present in URI: '.$uri_confirm.'<br>');
+                                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 confirm token is present in URI: '.$uri_confirm.'<br />');
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 no confirm token is in the URI'.'<br>');
+                                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 no confirm token is in the URI'.'<br />');
                                }
                        }
                        else
                        {
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 no desired data'.'<br>');
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 no desired data'.'<br />');
                                return;
                        }
-
+
                        // check against a list of available debug stuff
                        if ($desired_function == 'phpinfo')
                        {
@@ -357,7 +356,7 @@
                                // this function echos out its data
                                //echo 'get_defined_constants DUMP:<pre>'; 
print_r(get_defined_constants()); echo '</pre>';
                                
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 get_defined_constants DUMP:', get_defined_constants());
-
+
                        }
                        elseif ($desired_function == 'globals_dump')
                        {
@@ -433,52 +432,52 @@
                        }
                        else
                        {
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 unknown desired debug request: '.$desired_function.']<br>');
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 unknown desired debug request: '.$desired_function.']<br />');
                        }
-
+
                        // DAMN, since we invoked bootstrap above, we should 
kill the msg session
                        // BUT WILL WE NEED IT AGAIN?
                        // php does not have a definitive destructor, so we 
have to guess where script will end
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 calling "end_msg_session_object" so I hope you do not need it anymore<br>');
-
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.show_desired_data('.__LINE__.'):
 calling "end_msg_session_object" so I hope you do not need it anymore<br />');
+
                        // new way to handle debug data, if there is debug 
data, this will put it in the template source data vars
                        //$this->tpl->set_var('debugdata', 
$GLOBALS['phpgw']->msg->dbug->notice_pagedone());
                        // TOO SOON to end msg object
                        //$this->end_msg_session_object();
-               }
-
+               }
+
                // THIS NEVER WORKED
                function copyinteresting()
                {
                        // this function echos out its data
-                       echo 'This will copy from devel mail account folder 
"Phpgw Interesting" to Brick sysmail folder "Interesting 
Emails"<br><br>'."\r\n";
+                       echo 'This will copy from devel mail account folder 
"Phpgw Interesting" to Brick sysmail folder "Interesting Emails"<br /><br 
/>'."\r\n";
                        // FROM: 
&fldball[folder]=INBOX.Phpgw+Interesting&fldball[acctnum]=1
                        // TO: 
&fldball[folder]=mail%2FInteresting+Emails&fldball[acctnum]=3
-
-
+
+
                        // begin TYPICAL CLASS MSG INITALIZATION ROUTINE
                        if (is_object($GLOBALS['phpgw']->msg))
                        {
-                               if ($this->debug > 0) { echo 
'emai.ui_mail_debug.copyinteresting: is_object test: $GLOBALS[phpgw]->msg is 
already set, do not create again<br>'; }
+                               if ($this->debug > 0) { echo 
'emai.ui_mail_debug.copyinteresting: is_object test: $GLOBALS[phpgw]->msg is 
already set, do not create again<br />'; }
                        }
                        else
                        {
-                               if ($this->debug > 0) { echo 
'emai.ui_mail_debug.copyinteresting: is_object test: $GLOBALS[phpgw]->msg is 
NOT set, creating mail_msg object<br>'; }
+                               if ($this->debug > 0) { echo 
'emai.ui_mail_debug.copyinteresting: is_object test: $GLOBALS[phpgw]->msg is 
NOT set, creating mail_msg object<br />'; }
                                $GLOBALS['phpgw']->msg = 
CreateObject("email.mail_msg");
                        }
-
+
                        // for EXTERNAL CONTROL of msg class (i.e. not a result 
of  GET POST) it seems very important
                        // to specify the account number and folder in the args 
array
                        // acctnum is expected to be an integer
                        $my_acctnum = 1;
                        // it is customary to feed the folder name in the style 
of a URL encoded name, ex. SPACE is represented as a PLUS, etc...
                        $my_folder = urlencode("INBOX.Phpgw Interesting");
-
+
                        $args_array = Array();
                        $args_array['acctnum']  = $my_acctnum;
                        $args_array['folder'] = $my_folder;
                        $args_array['do_login'] = True;
-
+
                        $some_stream = 
$GLOBALS['phpgw']->msg->begin_request($args_array);
                        if (($args_array['do_login'] == True)
                        && (!$some_stream))
@@ -486,8 +485,8 @@
                                
$GLOBALS['phpgw']->msg->login_error($GLOBALS['PHP_SELF'].', copyinteresting()');
                        }
                        // end TYPICAL CLASS MSG INITALIZATION ROUTINE
-
-
+
+
                        // function get_msgball_list($acctnum='', $folder='')
                        //not necessary and is discouraged to actually provide 
any args to get_msgball_list()
                        // instead, a well done begin request opens the desired 
accftnum folder and get_msgball_list uses that info.
@@ -495,14 +494,14 @@
                        echo 'Msgball List for account number ['.$my_acctnum.'] 
folder name ['.$my_folder.']:<pre>';
                        print_r($my_from_list) ;
                        echo '</pre>';
-
+
                        $GLOBALS['phpgw']->msg->end_request();
                }
-
+
                // this evenually made it to boaction and is not used there
                function env_test()
                {
-                       $expected_args =
+                       $expected_args =
                                '/mail/index_php?menuaction'.','.
                                'fldball'.','.
                                'msgball'.','.
@@ -512,12 +511,12 @@
                                'sort'.','.
                                'order'.','.
                                'start';
-
-                       echo '$expected_args ['.$expected_args.']<br>';
+
+                       echo '$expected_args ['.$expected_args.']<br />';
                        /*
                        $exploded_expected_args = array();
                        $exploded_expected_args = explode(',',$expected_args);
-                       if (2 > 1) { echo '$exploded_expected_args DUMP:<pre>'; 
print_r($exploded_expected_args); echo '</pre>'; }
+                       if (2 > 1) { echo '$exploded_expected_args DUMP:<pre>'; 
print_r($exploded_expected_args); echo '</pre>'; }
                        $expected_args = array();
                        $loops = count($exploded_expected_args);
                        for ($i = 0; $i < $loops; $i++)
@@ -525,14 +524,14 @@
                                $arg_name = $exploded_expected_args[$i];
                                $expected_args[$arg_name] = '-1';
                        }
-                       if (2 > 1) { echo '$expected_args DUMP:<pre>'; 
print_r($expected_args); echo '</pre>'; }
-
+                       if (2 > 1) { echo '$expected_args DUMP:<pre>'; 
print_r($expected_args); echo '</pre>'; }
+
                        // make sure we have msg object and a server stream
                        $this->msg_bootstrap = 
CreateObject("email.msg_bootstrap");
                        $this->msg_bootstrap->set_do_login(False);
                        
$this->msg_bootstrap->ensure_mail_msg_exists('emai.ui_mail_debug.env_test', 1);
-
-                       if (2 > 1) { echo 
'$GLOBALS[phpgw]->msg->known_external_args DUMP:<pre>'; 
print_r($GLOBALS['phpgw']->msg->known_external_args); echo '</pre>'; }
+
+                       if (2 > 1) { echo 
'$GLOBALS[phpgw]->msg->known_external_args DUMP:<pre>'; 
print_r($GLOBALS['phpgw']->msg->known_external_args); echo '</pre>'; }
                        */
                        // make sure we have msg object and a server stream
                        $this->msg_bootstrap = 
CreateObject("email.msg_bootstrap");
@@ -542,26 +541,26 @@
                        // test run thru the functions
                        $boaction_obj->set_expected_args($expected_args);
                        // the URI of the redirect string contains data needed 
for the next page view
-
+
                        //$redirect_to = 
'/mail/index_php?menuaction=email.uiindex.index&fldball[folder]=INBOX&fldball[acctnum]=4&sort=1&order=1&start=0';
                        $redirect_to = 
'/mail/index_php?menuaction=email.uimessage.message&msgball[msgnum]=102&msgball[folder]=INBOX&msgball[acctnum]=4&sort=1&order=1&start=0';

                        $boaction_obj->set_new_args_uri($redirect_to);
-                       // clear existing args, apply the new arg enviornment,
+                       // clear existing args, apply the new arg enviornment,
                        // we get back the menuaction the redirect would have 
asked for
                        $my_menuaction = $boaction_obj->apply_new_args_env();
-                       echo 'returned $my_menuaction ['.$my_menuaction.']<br>';
-
+                       echo 'returned $my_menuaction ['.$my_menuaction.']<br 
/>';
+
                        $GLOBALS['phpgw']->msg->end_request();
                }
-
-
+
+
                function db_admin_make_table($really_do_it=False)
                {
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_make_table('.__LINE__.'):
 ENTERING<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_make_table('.__LINE__.'):
 ENTERING<br />');
                        if ($really_do_it == False)
                        {
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_make_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we are DO NOTHING, and 
we EXIT<br>');
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_make_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we are DO NOTHING, and 
we EXIT<br />');
                                return;
                        }
                        // this function makes a table for email in the phpgw DB
@@ -573,11 +572,11 @@
                                        . "content text DEFAULT '' NOT NULL, "
                                        . "PRIMARY KEY (account_id,data_key) )";
                        $GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
-
+
                        $table_names = $GLOBALS['phpgw']->db->table_names();
                        //echo '$table_names dump:<pre>'; 
print_r($table_names); echo '</pre>';
                        
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_make_table('.__LINE__.'):
 $table_names DUMP:', $table_names);
-
+
                        /*
                        'phpgw_anglemail' => array(
                                'fd' => array(
@@ -590,69 +589,69 @@
                                'ix' => array(),
                                'uc' => array()
                        */
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_make_table('.__LINE__.'):
 LEAVING<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_make_table('.__LINE__.'):
 LEAVING<br />');
                }
-
+
                function db_admin_rm_table($really_do_it=False)
                {
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_rm_table('.__LINE__.'):
 ENTERING<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_rm_table('.__LINE__.'):
 ENTERING<br />');
                        if (!$really_do_it)
                        {
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_rm_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we are DO NOTHING, and 
we EXIT<br>');
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_rm_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we are DO NOTHING, and 
we EXIT<br />');
                                return;
                        }
                        // this function drops the table for email in the phpgw 
DB
                        $sTableName = 'phpgw_anglemail';
                        $query = "DROP TABLE " . $sTableName;
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_rm_table('.__LINE__.'):
 about to CALL 
$GLOBALS[phpgw]->db->query('.$query.','.__LINE__.','.__FILE__.');<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_rm_table('.__LINE__.'):
 about to CALL 
$GLOBALS[phpgw]->db->query('.$query.','.__LINE__.','.__FILE__.');<br />');
                        $GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
-
+
                        $table_names = $GLOBALS['phpgw']->db->table_names();
                        //echo '$table_names dump:<pre>'; 
print_r($table_names); echo '</pre>';
                        
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_rm_table('.__LINE__.'):
 $table_names DUMP:', $table_names);
                }
-
+
                function db_admin_clear_entire_table($really_do_it=False)
                {
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 ENTERING<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 ENTERING<br />');
                        if (!$really_do_it)
                        {
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we are DO NOTHING, and 
we EXIT<br>');
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we are DO NOTHING, and 
we EXIT<br />');
                                return;
                        }
                        // If you issue a DELETE with no WHERE clause, all rows 
are deleted.
                        // THIS WIPES THE TABLE CLEAN OF ALL DATA
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we CALL 
$GLOBALS[phpgw]->db->query("DELETE FROM 
phpgw_anglemail",'.__LINE__.','.__FILE__.');<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 param $really_do_it ['.serialize($really_do_it).'] so we CALL 
$GLOBALS[phpgw]->db->query("DELETE FROM 
phpgw_anglemail",'.__LINE__.','.__FILE__.');<br />');
                        $GLOBALS['phpgw']->db->query("DELETE FROM 
phpgw_anglemail",__LINE__,__FILE__);
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 LEAVING<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_admin_clear_entire_table('.__LINE__.'):
 LEAVING<br />');
                }
-
+
                function db_am_table_exists()
                {
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 ENTERING<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 ENTERING<br />');
                        $look_for_me = 'phpgw_anglemail';
                        $found_table = False;
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 about to call $GLOBALS[phpgw]->db->table_names()<br>');
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 about to call $GLOBALS[phpgw]->db->table_names()<br />');
                        $table_names = $GLOBALS['phpgw']->db->table_names();
                        $table_names_serialized = serialize($table_names);
                        if (strstr($table_names_serialized, $look_for_me))
                        {
-
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 result: table ['.$look_for_me.'] DOES exist<br>');
+
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 result: table ['.$look_for_me.'] DOES exist<br />');
                                $found_table = True;
                        }
                        else
                        {
-                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 result: table ['.$look_for_me.'] does NOT exist<br>');
+                               
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 result: table ['.$look_for_me.'] does NOT exist<br />');
                                $found_table = False;
                        }
                        //echo '$table_names dump:<pre>'; 
print_r($table_names); echo '</pre>';
                        
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 $table_names DUMP:', $table_names);
-
-                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 LEAVING: returning ['.serialize($found_table).']<br>');
+
+                       
$GLOBALS['phpgw']->msg->dbug->out('ui_mail_debug.db_am_table_exists('.__LINE__.'):
 LEAVING: returning ['.serialize($found_table).']<br />');
                        return $found_table;
                }
-
+
                /*
                // these bext functions will go inti the future SO class
                function so_set_data($data_key, $content)
@@ -661,10 +660,10 @@
                        $data_key = 
$GLOBALS['phpgw']->db->db_addslashes($data_key);
                        $content = serialize($content);
                        $content = 
$GLOBALS['phpgw']->db->db_addslashes($content);
-
+
                        $GLOBALS['phpgw']->db->query("SELECT content FROM 
phpgw_anglemail WHERE "
                                . "account_id = '".$account_id."' AND data_key 
= '".$data_key."'",__LINE__,__FILE__);
-
+
                        if ($GLOBALS['phpgw']->db->num_rows()==0)
                        {
                                $GLOBALS['phpgw']->db->query("INSERT INTO 
phpgw_anglemail (account_id,data_key,content) "
@@ -672,19 +671,19 @@
                        }
                        else
                        {
-                               $GLOBALS['phpgw']->db->query("UPDATE 
phpgw_anglemail set content='" . $content
+                               $GLOBALS['phpgw']->db->query("UPDATE 
phpgw_anglemail set content='" . $content
                                        . "' WHERE account_id='" . $account_id 
. "' AND data_key='" . $data_key . "'",__LINE__,__FILE__);
                        }
                }
-
+
                function so_get_data($data_key)
                {
                        $account_id = 
get_account_id($accountid,$GLOBALS['phpgw']->session->account_id);
                        $data_key = 
$GLOBALS['phpgw']->db->db_addslashes($data_key);
-
+
                        $GLOBALS['phpgw']->db->query("SELECT content FROM 
phpgw_anglemail WHERE "
                                . "account_id = '".$account_id."' AND data_key 
= '".$data_key."'",__LINE__,__FILE__);
-
+
                        if ($GLOBALS['phpgw']->db->num_rows()==0)
                        {
                                return False;
@@ -702,7 +701,7 @@
                                return $my_content;
                        }
                }
-
+
                function so_delete_data($data_key)
                {
                        $account_id = 
get_account_id($accountid,$GLOBALS['phpgw']->session->account_id);
@@ -710,7 +709,7 @@
                        $GLOBALS['phpgw']->db->query("DELETE FROM 
phpgw_anglemail "
                                . " WHERE account_id='" . $account_id . "' AND 
data_key='" . $data_key . "'",__LINE__,__FILE__);
                }
-
+
                function so_clear_all_data_this_user()
                {
                        $account_id = 
get_account_id($accountid,$GLOBALS['phpgw']->session->account_id);
@@ -718,6 +717,6 @@
                                . " WHERE account_id='" . $account_id . 
"'",__LINE__,__FILE__);
                }
                */
-
+
        }
 ?>

====================================================
Index: email/inc/class.mail_msg_wrappers.inc.php
diff -u email/inc/class.mail_msg_wrappers.inc.php:1.39 
email/inc/class.mail_msg_wrappers.inc.php:1.40
--- email/inc/class.mail_msg_wrappers.inc.php:1.39      Thu Dec 30 23:13:50 2004
+++ email/inc/class.mail_msg_wrappers.inc.php   Sun Mar 13 23:22:44 2005
@@ -152,7 +152,7 @@
                                        $meta_data['msg_structure'] = $data;

                                        // SET_CACHE_ITEM
-                                       //echo 'saving msg_structure to 
cache<br>';
+                                       //echo 'saving msg_structure to 
cache<br />';
                                        
$this->save_session_cache_item('msg_structure', $meta_data, $acctnum);
                                }
                                return $data;
@@ -287,7 +287,7 @@

                                        // SET_CACHE_ITEM
                                        // NOTE that $extra_keys is generated 
FOR US in the function that saves this to appsesion cache
-                                       //echo 'saving phpgw_header to 
cache<br>';
+                                       //echo 'saving phpgw_header to cache<br 
/>';
                                        
$this->save_session_cache_item('phpgw_header', $meta_data, $acctnum);
                                }
                                if (!$data)
@@ -480,6 +480,16 @@
                                return 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
                        }
                }
+
+               /*!
+               @function phpgw_get_flag
+               @abstract ?
+               */
+               function phpgw_set_flag($msgball, $flag)
+               {
+                       $this->ensure_stream_and_folder($msgball , 
'phpgw_set_flag'.' LINE '.__LINE__);
+                       return $GLOBALS['phpgw_dcom_'.$msgball['acctnum'] 
]->dcom->set_flag($this->get_arg_value('mailsvr_stream'), $msgball['msgnum'], 
$flag);
+               }

                // ====  Functions For Getting A Message Or A Part (MIME Part) 
Of A Message  ====

@@ -547,7 +557,7 @@
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $msgnum = $msgball['msgnum'];
                        $part_no = $msgball['part_no'];
-                       //echo 'mail_msg(_wrappers): phpgw_fetchbody: 
processed: $acctnum: '.$acctnum.'; $mailsvr_stream: 
'.serialize($mailsvr_stream).'; $msgnum: '.$msgnum.'; $part_no: 
'.$part_no.'<br> * $msgball dump<pre>'; print_r($msgball); echo '</pre>';
+                       //echo 'mail_msg(_wrappers): phpgw_fetchbody: 
processed: $acctnum: '.$acctnum.'; $mailsvr_stream: 
'.serialize($mailsvr_stream).'; $msgnum: '.$msgnum.'; $part_no: '.$part_no.'<br 
/> * $msgball dump<pre>'; print_r($msgball); echo '</pre>';

                        $data = '';
                        $data = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchbody($mailsvr_stream, $msgnum, 
$part_no, $flags);
@@ -590,7 +600,7 @@
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $msgnum = $msgball['msgnum'];
                        $part_no = $msgball['part_no'];
-                       //echo 'mail_msg(_wrappers): phpgw_fetchbody: 
processed: $acctnum: '.$acctnum.'; $mailsvr_stream: 
'.serialize($mailsvr_stream).'; $msgnum: '.$msgnum.'; $part_no: 
'.$part_no.'<br> * $msgball dump<pre>'; print_r($msgball); echo '</pre>';
+                       //echo 'mail_msg(_wrappers): phpgw_fetchbody: 
processed: $acctnum: '.$acctnum.'; $mailsvr_stream: 
'.serialize($mailsvr_stream).'; $msgnum: '.$msgnum.'; $part_no: '.$part_no.'<br 
/> * $msgball dump<pre>'; print_r($msgball); echo '</pre>';

                        // notice of event
                        $this->event_msg_seen($msgball, 'phpgw_fetchbody');
@@ -628,7 +638,7 @@
                */
                function get_msgball_list($acctnum='', $folder='', 
$only_fill_cache=False)
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers).get_msgball_list:  ENTERING $acctnum 
['.$acctnum.'] ; $folder ['.$folder.'] <br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers).get_msgball_list:  ENTERING $acctnum 
['.$acctnum.'] ; $folder ['.$folder.'] <br />'); }
                        // IF specifying a folder, as a filter search may do, 
we need to ensure stream and folder
                        if ((isset($acctnum))
                        && ((string)$acctnum != '')
@@ -673,14 +683,14 @@
                        $cached_msgball_list = 
$this->read_session_cache_item('msgball_list', $acctnum, $folder);
                        if ($cached_msgball_list)
                        {
-                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers).get_msgball_list: ('.__LINE__.') LEAVING, 
returning appsession cached "msgball_list"<br>'); }
+                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers).get_msgball_list: ('.__LINE__.') LEAVING, 
returning appsession cached "msgball_list"<br />'); }
                                //
                                //return $cached_msgball_data['msgball_list'];
                                return $cached_msgball_list;
                        }
                        else
                        {
-                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers).get_msgball_list: ('.__LINE__.') <font 
color="brown">cached had NO DATA for "msgball_list"</font><br>'); }
+                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers).get_msgball_list: ('.__LINE__.') <font 
color="brown">cached had NO DATA for "msgball_list"</font><br />'); }
                                // right now only specialized filter searching 
requires tp specify a folder
                                $fake_fldball = array();
                                $fake_fldball['acctnum'] = $acctnum;
@@ -694,7 +704,7 @@
                                //{
                                //      $server_msgnum_list = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->sort($this->get_arg_value('mailsvr_stream',
 $acctnum), $this->get_arg_value('sort', $acctnum), 
$this->get_arg_value('order', $acctnum));
                                //}
-                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_msgball_list: ('.__LINE__.') <font 
color="red">MAILSERVER CALL</font> calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->sort('.$this->get_arg_value('mailsvr_stream',
 $acctnum).', '.$this->get_arg_value('sort', $acctnum).', 
'.$this->get_arg_value('order', $acctnum).')<br>'); }
+                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_msgball_list: ('.__LINE__.') <font 
color="red">MAILSERVER CALL</font> calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->sort('.$this->get_arg_value('mailsvr_stream',
 $acctnum).', '.$this->get_arg_value('sort', $acctnum).', 
'.$this->get_arg_value('order', $acctnum).')<br />'); }
                                $server_msgnum_list = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->sort($this->get_arg_value('mailsvr_stream',
 $acctnum), $this->get_arg_value('sort', $acctnum), 
$this->get_arg_value('order', $acctnum));

                                // put more information about these particular 
messages into the msgball_list[] structure
@@ -757,7 +767,7 @@
                                // use the folder name that was fed as a param, 
since this most likely represents a good key to use
                                // just in case the msgball_list, in the 
future, is a virtual one composed of msg from many folders
                                $this->save_session_cache_item('msgball_list', 
$meta_data, $acctnum, $folder);
-                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_msgball_list: ('.__LINE__.') 
LEAVING, <font color="red">had to get data from server</font><br>'); }
+                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_msgball_list: ('.__LINE__.') 
LEAVING, <font color="red">had to get data from server</font><br />'); }
                                return $msgball_list;
                        }
                }
@@ -806,19 +816,19 @@
                */
                function get_folder_size()
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') 
ENTERING<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') 
ENTERING<br />'); }
                        $fldball = array();
                        $fldball['acctnum'] = $this->get_acctnum();
                        $fldball['folder'] = 
$this->prep_folder_out($this->get_arg_value('folder', $fldball['acctnum']));
-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') this 
function does not take a param, we made a fldball: 
['.serialize($fldball).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') this 
function does not take a param, we made a fldball: ['.serialize($fldball).']<br 
/>'); }
                        // make sure a stream is open
-                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_size: ('.__LINE__.') call to $this->ensure_stream_and_folder(), 
$fldball ['.serialize($fldball).'] <br>'); }
-                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_size: ('.__LINE__.') NOTE THIS DOES REQUIRE A CHANGE OF FOLDER to 
get the data, this may cause problems. <br>'); }
+                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_size: ('.__LINE__.') call to $this->ensure_stream_and_folder(), 
$fldball ['.serialize($fldball).'] <br />'); }
+                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_size: ('.__LINE__.') NOTE THIS DOES REQUIRE A CHANGE OF FOLDER to 
get the data, this may cause problems. <br />'); }
                        $this->ensure_stream_and_folder($fldball, 
'get_folder_size'.' LINE '.__LINE__);

-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') calling 
$GLOBALS[phpgw_dcom_'.$this->acctnum.']->dcom->mailboxmsginfo('.$this->get_arg_value('mailsvr_stream').',
 '.$fldball['acctnum'].')<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') calling 
$GLOBALS[phpgw_dcom_'.$this->acctnum.']->dcom->mailboxmsginfo('.$this->get_arg_value('mailsvr_stream').',
 '.$fldball['acctnum'].')<br />'); }
                        $mailbox_detail = 
$GLOBALS['phpgw_dcom_'.$fldball['acctnum']]->dcom->mailboxmsginfo($this->get_arg_value('mailsvr_stream'),
 $fldball['acctnum']);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') LEAVING, 
returning ['.(serialize($mailbox_detail)).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') LEAVING, 
returning ['.(serialize($mailbox_detail)).']<br />'); }
                        return $mailbox_detail->Size;
                }

@@ -943,7 +953,7 @@
                */
                function get_folder_status_info($fldball='', 
$force_refresh=False)
                {
-                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') ENTERING, $fldball: 
'.serialize($fldball).' ; $force_refresh (DEPRECIATED): 
'.serialize($force_refresh).' <br>'); }
+                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') ENTERING, $fldball: 
'.serialize($fldball).' ; $force_refresh (DEPRECIATED): 
'.serialize($force_refresh).' <br />'); }

                        // note: param $fldball WAS just folder previously, 
watch out for old code still passing that string instead of the fldball
                        if ( (!isset($fldball))
@@ -969,11 +979,11 @@
                                $fldball['folder'] = 
$this->prep_folder_out($this->get_arg_value('folder', $fldball['acctnum']));
                        }

-                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info('.__LINE__.'): ONLY L1 CACHE OF THIS INFO IF IN 
NON-EXTREME MODE<br>'); }
+                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info('.__LINE__.'): ONLY L1 CACHE OF THIS INFO IF IN 
NON-EXTREME MODE<br />'); }

                        if ($this->session_cache_extreme == False)
                        {
-                               if ($this->debug_session_caching > 1) { 
$this->dbug->out('class_msg: get_folder_status_info: ('.__LINE__.') 
(non-extreme mode) uses L1/class var cache, NO appsession cache used in 
non-extreme <br>'); }
+                               if ($this->debug_session_caching > 1) { 
$this->dbug->out('class_msg: get_folder_status_info: ('.__LINE__.') 
(non-extreme mode) uses L1/class var cache, NO appsession cache used in 
non-extreme <br />'); }
                                // do we have cached data in L1 cache / class 
object var, that we can use
                                // ONLY L1 CACHE OF THIS INFO IF IN NON-EXTREME 
MODE
                                //$folder_status_info = 
$this->get_arg_value('folder_status_info', $fldball['acctnum']);
@@ -989,12 +999,12 @@
                                        // add this "timestamp" array element 
only to imitate what exists in data structure if extreme-mode were on (which it 
is not here).
                                        $timestamp_age = (time() - 
$folder_status_info['timestamp']);
                                        if (($this->debug_session_caching > 1) 
|| ($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) got L1/class var 
cached data, $timestamp_age ['.$timestamp_age.'] ; $folder_status_info dump:', 
$folder_status_info); }
-                                       if (($this->debug_session_caching > 0) 
|| ($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) LEAVING '.'<font 
color="purple">'.'successfully returning cached L1/class 
data'.'</font>'.'<br>'); }
+                                       if (($this->debug_session_caching > 0) 
|| ($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) LEAVING '.'<font 
color="purple">'.'successfully returning cached L1/class data'.'</font>'.'<br 
/>'); }
                                        return $folder_status_info;
                                }
                                else
                                {
-                                       if (($this->debug_session_caching > 1) 
|| ($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) NO data found in 
L1/class var cached <br>'); }
+                                       if (($this->debug_session_caching > 1) 
|| ($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) NO data found in 
L1/class var cached <br />'); }
                                }
                        }
                        else
@@ -1005,15 +1015,15 @@
                                // below is for extreme-mode, which only uses 
appsession cache for this data, does NOT use "L1 cache"

                                // try to restore from saved session data store
-                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) calling 
$this->read_session_cache_item(folder_status_info, 
'.serialize($fldball['acctnum']).', '.($fldball['folder']).') NOTE the folder 
name MUST be urlencoded as that param<br>'); }
+                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) calling 
$this->read_session_cache_item(folder_status_info, 
'.serialize($fldball['acctnum']).', '.($fldball['folder']).') NOTE the folder 
name MUST be urlencoded as that param<br />'); }
                                $cached_folder_status_info = 
$this->read_session_cache_item('folder_status_info', $fldball['acctnum'], 
$fldball['folder']);
                                if (($this->debug_session_caching > 2) || 
($this->debug_wrapper_dcom_calls > 2)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) 
$cached_folder_status_info dump:', $cached_folder_status_info); }
                                if ($cached_folder_status_info)
                                {
-                                       if (($this->debug_session_caching > 0) 
|| ($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) LEAVING '.'<font 
color="purple">'.'returning data obtained from cache'.'</font>'.'<br>'); }
+                                       if (($this->debug_session_caching > 0) 
|| ($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) LEAVING '.'<font 
color="purple">'.'returning data obtained from cache'.'</font>'.'<br />'); }
                                        return $cached_folder_status_info;
                                }
-                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) NO data found in cache 
(or it was stale) <br>'); }
+                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) NO data found in cache 
(or it was stale) <br />'); }
                        }

                        // Make Sure Stream Exists
@@ -1036,18 +1046,18 @@
                        $special_fldball['folder'] = $fldball['folder'];
                        // STATUS does not require opening the folder we want 
information about
                        $special_fldball['no_switch_away'] = True;
-                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') call to 
$this->ensure_stream_and_folder(), $special_fldball 
['.serialize($special_fldball).'] <br>'); }
-                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') DO NOT pass a folderame IN THIS 
PARTICULAR case because getting folder status DOES NOT require opening that 
folder, "ensure_stream_and_folder" understands this.<br>'); }
+                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') call to 
$this->ensure_stream_and_folder(), $special_fldball 
['.serialize($special_fldball).'] <br />'); }
+                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') DO NOT pass a folderame IN THIS 
PARTICULAR case because getting folder status DOES NOT require opening that 
folder, "ensure_stream_and_folder" understands this.<br />'); }
                        $this->ensure_stream_and_folder($special_fldball, 
'get_folder_status_info'.' LINE '.__LINE__);

                        //$mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $fldball['acctnum']);
                        $server_str = $this->get_arg_value('mailsvr_callstr', 
$fldball['acctnum']);
-                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') will use $mailsvr_stream 
['.serialize($mailsvr_stream).'] ; $server_str ['.$server_str.'] ; $fldball: 
'.serialize($fldball).' <br>'); }
+                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') will use $mailsvr_stream 
['.serialize($mailsvr_stream).'] ; $server_str ['.$server_str.'] ; $fldball: 
'.serialize($fldball).' <br />'); }

                        $clean_folder_name = 
$this->prep_folder_in($fldball['folder']);
                        $urlencoded_folder = 
$this->prep_folder_out($clean_folder_name);
-                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) <b>problem area: 
urlencoding only 1 time</b> $clean_folder_name ['.$clean_folder_name.'], 
$urlencoded_folder : ['.$urlencoded_folder.']);<br>'); }
+                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) <b>problem area: 
urlencoding only 1 time</b> $clean_folder_name ['.$clean_folder_name.'], 
$urlencoded_folder : ['.$urlencoded_folder.']);<br />'); }

                        // initialize return structure
                        $return_data = Array();
@@ -1068,7 +1078,7 @@
                        //      $mailbox_status = 
$GLOBALS['phpgw_dcom_'.$fldball['acctnum']]->dcom->status($mailsvr_stream,$server_str.$fldball['folder'],SA_ALL);
                        //}
                        // earlier we called $this->ensure_stream_and_folder, 
so stream *should* exist
-                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_status_info: ('.__LINE__.') calling 
$GLOBALS[phpgw_dcom_'.$fldball['acctnum'].']->dcom->status('.$mailsvr_stream.','.$server_str.$clean_folder_name.',SA_ALL)<br>');
 }
+                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_status_info: ('.__LINE__.') calling 
$GLOBALS[phpgw_dcom_'.$fldball['acctnum'].']->dcom->status('.$mailsvr_stream.','.$server_str.$clean_folder_name.',SA_ALL)<br
 />'); }
                        $mailbox_status = 
$GLOBALS['phpgw_dcom_'.$fldball['acctnum']]->dcom->status($mailsvr_stream,$server_str.$clean_folder_name,SA_ALL);
                        if (($this->debug_session_caching > 2) || 
($this->debug_wrapper_dcom_calls > 2)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_status_info: ('.__LINE__.') ->dcom->status returns: $mailbox_status 
DUMP', $mailbox_status); }

@@ -1118,7 +1128,7 @@

                        if ($this->session_cache_extreme == False)
                        {
-                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) uses L1/class var 
cache, NO appsession cache used in non-extreme <br>'); }
+                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) uses L1/class var 
cache, NO appsession cache used in non-extreme <br />'); }
                                // cache data in a class var (L1 Cache)
                                // USE L1 CACHE ONLY IN NON-EXTREME MODE
                                if (($this->debug_session_caching > 2) || 
($this->debug_wrapper_dcom_calls > 2)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (non-extreme mode) saving to L1 class 
var cache, $this->set_arg_value(folder_status_info, $return_data, 
'.$fldball['acctnum'].') ; $return_data dump:', $return_data); }
@@ -1127,13 +1137,13 @@
                        }
                        else
                        {
-                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) uses appsession cache, no 
L1/class var cached is used in extreme mode <br>'); }
-                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) saving to session cache, 
$this->save_session_cache_item("folder_status_info", $return_data, $acctnum) 
NOTE that acctnum used here is ['.$acctnum.']<br>'); }
+                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) uses appsession cache, no 
L1/class var cached is used in extreme mode <br />'); }
+                               if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) saving to session cache, 
$this->save_session_cache_item("folder_status_info", $return_data, $acctnum) 
NOTE that acctnum used here is ['.$acctnum.']<br />'); }
                                if (($this->debug_session_caching > 2) || 
($this->debug_wrapper_dcom_calls > 2)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') (extreme mode) $return_data DUMP', 
$return_data); }
                                // NOTE that the $extra_keys param is generated 
FOR US in the function that saves this to appsession cache, we are doing that 
now
                                
$this->save_session_cache_item('folder_status_info', $return_data, 
$fldball['acctnum'], $fldball['folder']);
                        }
-                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') LEAVING, '.'<font color="red">'.'had 
contact mailserver to get data'.'</font>'.'<br>'); }
+                       if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') LEAVING, '.'<font color="red">'.'had 
contact mailserver to get data'.'</font>'.'<br />'); }
                        return $return_data;
                }

@@ -1147,16 +1157,16 @@
                */
                function phpgw_status($feed_folder_long='')
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): ENTERING, 
$feed_folder_long ['.($feed_folder_long).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): ENTERING, 
$feed_folder_long ['.($feed_folder_long).']<br />'); }
                        $fake_fldball = array();
                        $fake_fldball['acctnum'] = $this->get_acctnum();
                        $fake_fldball['folder'] = $feed_folder_long;
                        $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_status'.' LINE '.__LINE__);
                        $server_str = $this->get_arg_value('mailsvr_callstr');
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream');
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_$fake_fldball[acctnum]('.$fake_fldball['acctnum'].')]->dcom->status($mailsvr_stream['.$mailsvr_stream.'],"$server_str"."$feed_folder_long"['.htmlspecialchars("$server_str"."$feed_folder_long").'],SA_ALL)<br>');
 }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_$fake_fldball[acctnum]('.$fake_fldball['acctnum'].')]->dcom->status($mailsvr_stream['.$mailsvr_stream.'],"$server_str"."$feed_folder_long"['.htmlspecialchars("$server_str"."$feed_folder_long").'],SA_ALL)<br
 />'); }
                        $retval = 
$GLOBALS['phpgw_dcom_'.$fake_fldball['acctnum']]->dcom->status($mailsvr_stream,"$server_str"."$feed_folder_long",SA_ALL);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): LEAVING, 
returning $retval ['.serialize($retval).'] <br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): LEAVING, 
returning $retval ['.serialize($retval).'] <br />'); }
                        return $retval;
                }

@@ -1174,7 +1184,7 @@
                        {
                                $acctnum = $this->get_acctnum();
                        }
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_server_last_error: ('.__LINE__.') 
calling $GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->server_last_error()<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_server_last_error: ('.__LINE__.') 
calling $GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->server_last_error()<br />'); }
                        return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->server_last_error();
                }

@@ -1192,11 +1202,11 @@
                        {
                                $acctnum = $this->get_acctnum();
                        }
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_ping ('.__LINE__.'): ENTERING, 
$acctnum ['.$acctnum.'], we DO NOT use "ensure_stream_and_folder" here because 
that would open the stream we are testing, making this test useless.<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_ping ('.__LINE__.'): ENTERING, 
$acctnum ['.$acctnum.'], we DO NOT use "ensure_stream_and_folder" here because 
that would open the stream we are testing, making this test useless.<br />'); }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_ping ('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->noop_ping_test('.$mailsvr_stream.') 
<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_ping ('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->noop_ping_test('.$mailsvr_stream.') 
<br />'); }
                        $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->noop_ping_test($mailsvr_stream);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_ping ('.__LINE__.'): LEAVING, 
returing $retval ['.serialize($retval).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_ping ('.__LINE__.'): LEAVING, 
returing $retval ['.serialize($retval).']<br />'); }
                        return $retval;
                }

@@ -1209,7 +1219,7 @@
                */
                function phpgw_search($fldball='', $criteria='', $flags='')
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_search ('.__LINE__.'): ENTERING, 
$fldball ['.serialize($fldball).']; $criteria ['.$criteria.']; 
$flags['.serialize($flags).'] <br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_search ('.__LINE__.'): ENTERING, 
$fldball ['.serialize($fldball).']; $criteria ['.$criteria.']; 
$flags['.serialize($flags).'] <br />'); }
                        $acctnum = (int)$fldball['acctnum'];
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -1233,9 +1243,9 @@
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);

                        // now we have the stream and the desired folder open
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_search ('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->i_search($mailsvr_stream['.$mailsvr_stream.'],
 $criteria['.$criteria.'],$flags['.serialize($flags).']) <br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_search ('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->i_search($mailsvr_stream['.$mailsvr_stream.'],
 $criteria['.$criteria.'],$flags['.serialize($flags).']) <br />'); }
                        $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->i_search($mailsvr_stream,$criteria,$flags);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_search ('.__LINE__.'): LEAVING, 
returing $retval ['.serialize($retval).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_search ('.__LINE__.'): LEAVING, 
returing $retval ['.serialize($retval).']<br />'); }
                        return $retval;
                }

@@ -1293,7 +1303,7 @@
                */
                function phpgw_createmailbox_ex($target_fldball)
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_createmailbox_ex('.__LINE__.'): ENTERING: raw 
$target_fldball arg ['.htmlspecialchars($target_fldball).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_createmailbox_ex('.__LINE__.'): ENTERING: raw 
$target_fldball arg ['.htmlspecialchars($target_fldball).']<br />'); }
                        if ((isset($target_fldball['acctnum']))
                        && ((string)$target_fldball['acctnum'] != ''))
                        {
@@ -1329,7 +1339,7 @@
                                $target_folder_clean = 
$mailsvr_callstr.$target_folder_clean;
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_createmailbox_ex('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->createmailbox('.serialize($mailsvr_stream).',
 '.htmlspecialchars($target_folder_clean).'<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_createmailbox_ex('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->createmailbox('.serialize($mailsvr_stream).',
 '.htmlspecialchars($target_folder_clean).'<br />'); }
                        return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->createmailbox($mailsvr_stream, 
$target_folder_clean);
                }

@@ -1361,7 +1371,7 @@
                */
                function phpgw_deletemailbox_ex($target_fldball)
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_deletemailbox_ex('.__LINE__.'): ENTERING: raw 
$target_fldball arg ['.htmlspecialchars($target_fldball).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_deletemailbox_ex('.__LINE__.'): ENTERING: raw 
$target_fldball arg ['.htmlspecialchars($target_fldball).']<br />'); }
                        if ((isset($target_fldball['acctnum']))
                        && ((string)$target_fldball['acctnum'] != ''))
                        {
@@ -1397,7 +1407,7 @@
                                $target_folder_clean = 
$mailsvr_callstr.$target_folder_clean;
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_deletemailbox_ex('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->deletemailbox('.serialize($mailsvr_stream).',
 '.htmlspecialchars($target_folder_clean).'<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_deletemailbox_ex('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->deletemailbox('.serialize($mailsvr_stream).',
 '.htmlspecialchars($target_folder_clean).'<br />'); }
                        return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->deletemailbox($mailsvr_stream, 
$target_folder_clean);
                }

@@ -1430,8 +1440,8 @@
                */
                function phpgw_renamemailbox_ex($source_fldball,$target_fldball)
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): ENTERING<br>'); }
-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): raw $source_fldball arg 
['.htmlspecialchars($source_fldball).']; raw $target_fldball arg 
['.htmlspecialchars($target_fldball).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): ENTERING<br />'); }
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): raw $source_fldball arg 
['.htmlspecialchars($source_fldball).']; raw $target_fldball arg 
['.htmlspecialchars($target_fldball).']<br />'); }
                        if ((isset($target_fldball['acctnum']))
                        && ((string)$target_fldball['acctnum'] != ''))
                        {
@@ -1489,7 +1499,7 @@

                        // OK WE are ready to do it!
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->renamemailbox('.serialize($mailsvr_stream).',
 '.htmlspecialchars($source_folder_clean).', 
'.htmlspecialchars($target_folder_clean).'<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->renamemailbox('.serialize($mailsvr_stream).',
 '.htmlspecialchars($source_folder_clean).', 
'.htmlspecialchars($target_folder_clean).'<br />'); }
                        //return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->createmailbox($mailsvr_stream, 
$target_folder_clean);
                        return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->renamemailbox($mailsvr_stream, 
$source_folder_clean, $target_folder_clean);
                }
@@ -1520,7 +1530,7 @@
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);

                        // ... so stream exists, do the transaction ...
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_listmailbox ('.__LINE__.'): 
calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox($mailsvr_stream['.$mailsvr_stream.'],$ref['.$ref.'],
 $pattern['.$pattern.']); <br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_listmailbox ('.__LINE__.'): 
calling 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox($mailsvr_stream['.$mailsvr_stream.'],$ref['.$ref.'],
 $pattern['.$pattern.']); <br />'); }
                        return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,$ref,$pattern);
                }

@@ -1533,7 +1543,7 @@
                */
                function phpgw_append($folder="Sent", $message, $flags=0)
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') ENTERING, 
folder: '.$folder.'<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') ENTERING, 
folder: '.$folder.'<br />'); }

                        $server_str = $this->get_arg_value('mailsvr_callstr');

@@ -1542,7 +1552,7 @@
                        $folder = $this->ensure_no_brackets($folder);
                        // attempt to find a folder match in the lookup list
                        $official_folder_long = $this->folder_lookup('', 
$folder);
-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') 
$official_folder_long: '.$official_folder_long.'<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') 
$official_folder_long: '.$official_folder_long.'<br />'); }
                        if ($official_folder_long != '')
                        {
                                $havefolder = True;
@@ -1552,7 +1562,7 @@
                                $havefolder = False;
                        }

-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') $havefolder 
['.serialize($havefolder).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') $havefolder 
['.serialize($havefolder).']<br />'); }
                        if ($havefolder == False)
                        {
                                // add whatever namespace we believe should 
exist
@@ -1564,12 +1574,12 @@
                                $fake_fldball = array();
                                $fake_fldball['folder'] = 
$server_str.$folder_long;
                                $fake_fldball['acctnum'] = $this->get_acctnum();
-                               if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') calling 
$this->phpgw_createmailbox('.serialize($fake_fldball).')<br>'); }
+                               if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') calling 
$this->phpgw_createmailbox('.serialize($fake_fldball).')<br />'); }
                                $this->phpgw_createmailbox($fake_fldball);

                                // try again to get the real long folder name 
of the just created trash folder
                                $official_folder_long = 
$this->folder_lookup('', $folder);
-                               if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') 
$official_folder_long: '.$official_folder_long.'<br>'); }
+                               if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') 
$official_folder_long: '.$official_folder_long.'<br />'); }
                                // did the folder get created and do we now 
have the official full name of that folder?
                                if ($official_folder_long != '')
                                {
@@ -1595,9 +1605,9 @@
                                $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream');
                                // do the append
                                if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: 
$GLOBALS["phpgw_dcom_'.$target_fldball['acctnum'].']->dcom->append('.$mailsvr_stream.',
 '."$server_str"."$official_folder_long".', $message, '.$flags.') '); }
-                               //$acctnum: ['.$acctnum.'] $mailsvr_stream: 
['.$mailsvr_stream.'] $msgnum: ['.$msgnum.'] $mailbox: 
['.htmlspecialchars($mailbox).']<br>'; }
-                               $retval = 
$GLOBALS['phpgw_dcom_'.$target_fldball['acctnum']]->dcom->append($mailsvr_stream,
 "$server_str"."$official_folder_long", $message, $flags);
-                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append ('.__LINE__.'): LEAVING, 
returning $retval ['.serialize($retval).']<br>'); }
+                               //$acctnum: ['.$acctnum.'] $mailsvr_stream: 
['.$mailsvr_stream.'] $msgnum: ['.$msgnum.'] $mailbox: 
['.htmlspecialchars($mailbox).']<br />'; }
+                               $retval = 
$GLOBALS['phpgw_dcom_'.$target_fldball['acctnum']]->dcom->append($mailsvr_stream,
 $server_str.$official_folder_long, $message, $flags);
+                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append ('.__LINE__.'): LEAVING, 
returning $retval ['.serialize($retval).']<br />'); }
                                return $retval;
                        }
                        else
@@ -1606,7 +1616,7 @@
                                // we can NOT append the message to a folder 
name we are not SURE is corrent
                                // it will fail  HANG the browser for a while
                                // so just SKIP IT
-                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append ('.__LINE__.'): LEAVING on 
error, returning FALSE, unable to get good foldername, unable to append <br>'); 
}
+                               if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append ('.__LINE__.'): LEAVING on 
error, returning FALSE, unable to get good foldername, unable to append <br 
/>'); }
                                return False;
                        }
                }
@@ -1619,14 +1629,14 @@
                */
                function phpgw_mail_move($msg_list,$mailbox)
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_mail_move: (DEPRECIATED) 
ENTERING<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_mail_move: (DEPRECIATED) 
ENTERING<br />'); }
                        // OLD FUNCTION does not provide enough information, 
all we can do is expire
                        $this->event_msg_move_or_delete(array(), 
'phpgw_mail_move');
                        // delete session msg array data thAt is now stale
                        //$this->expire_session_cache_item('msgball_list');

                        $retval = 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->mail_move($this->get_arg_value('mailsvr_stream'),
 $msg_list, $mailbox);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_mail_move: (DEPRECIATED) LEAVING, 
$retval ['.serialize($retval).'] <br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_mail_move: (DEPRECIATED) LEAVING, 
$retval ['.serialize($retval).'] <br />'); }
                        return $retval;
                }

@@ -1638,8 +1648,8 @@
                */
                function interacct_mail_move($mov_msgball='', $to_fldball='')
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: ENTERING<br>'); }
-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: $mov_msgball 
['.serialize($mov_msgball).'] ;  $to_fldball 
['.serialize($to_fldball).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: ENTERING<br />'); }
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: $mov_msgball 
['.serialize($mov_msgball).'] ;  $to_fldball ['.serialize($to_fldball).']<br 
/>'); }
                        // this needs A LOT of work!!! do not rely on this yet

                        // delete session msg array data thAt is now stale
@@ -1655,7 +1665,7 @@
                        }
                        $this->ensure_stream_and_folder($mov_msgball, 
'interacct_mail_move'.' LINE '.__LINE__);

-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move:'.' LINE 
'.__LINE__.' If this is a move to a DIFFERENT account, then THIS FUNCTION is 
the WRONG ONE to use, it can not handle that<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move:'.' LINE 
'.__LINE__.' If this is a move to a DIFFERENT account, then THIS FUNCTION is 
the WRONG ONE to use, it can not handle that<br />'); }

                        // NO - this function only works with folders within 
the same account
                        //$this->ensure_stream_and_folder($to_fldball, 
'interacct_mail_move'.' LINE '.__LINE__);
@@ -1667,11 +1677,30 @@
                        // the acctnum we are moving FROM *may* be different 
from the acctnum we are moving TO
                        // that requires a fetch then an append - FIXME!!!

-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: $acctnum: 
['.$acctnum.'] $mailsvr_stream: ['.$mailsvr_stream.'] $msgnum: ['.$msgnum.'] 
$mailbox: ['.htmlspecialchars($mailbox).']<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: $acctnum: 
['.$acctnum.'] $mailsvr_stream: ['.$mailsvr_stream.'] $msgnum: ['.$msgnum.'] 
$mailbox: ['.htmlspecialchars($mailbox).']<br />'); }
                        $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->mail_move($mailsvr_stream ,$msgnum, 
$mailbox);
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: LEAVING, $retval 
['.serialize($retval).'] <br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: LEAVING, $retval 
['.serialize($retval).'] <br />'); }
                        return $retval;
                }
+
+               /**
+               * Empty the "trash" folder
+               *
+               * @author skwashd
+               * @param int $acctnum target account number
+               * @param string $folder target folder
+               */
+               function empty_trash($acctnum = '')
+               {
+                       $acctnum = ($acctnum >= 0 ? $acctnum : 
$this->get_acctnum());
+                       $folder = 
$this->get_arg_value('verified_trash_folder_long', $acctnum);
+
+                       $this->ensure_stream_and_folder(array('folder' => 
$folder, 'acctnum' => $acctnum));
+                       $this->set_arg_value('fldball[folder]', $folder, 
$acctnum);
+                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
+
+                       
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->empty_trash($mailsvr_stream);
+               }

                /*!
                @function industrial_interacct_mail_move
@@ -1684,16 +1713,16 @@
                */
                function industrial_interacct_mail_move($mov_msgball='', 
$to_fldball='')
                {
-                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): industrial_interacct_mail_move: 
ENTERING, handing off to $this->buffer_move_commands()<br>'); }
+                       if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): industrial_interacct_mail_move: 
ENTERING, handing off to $this->buffer_move_commands()<br />'); }
                        // Note: Only call this function with ONE msgball at a 
time, i.e. NOT a list of msgballs
                        // then we buffer each command with this function
                        $this->buffer_move_commands($mov_msgball, $to_fldball);

-                       //if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers