If you want something simple and direct, this is what I use to add a 1pixel black border around my chat frame with a single pixel missing at the corners:
Lua Code:
local frame = frameYouWantToAddBordersTo
local frameborder=CreateFrame("frame",nil,frame)
frameborder:SetAllPoints(frame)
frameborder:SetFrameStrata("BACKGROUND")
frameborder:SetFrameLevel(1)
frameborder.left=frameborder:CreateTexture(nil,"BORDER")
frameborder.left:SetPoint("BOTTOMLEFT",frameborder,"BOTTOMLEFT",-2,-1)
frameborder.left:SetPoint("TOPRIGHT",frameborder,"TOPLEFT",-1,1)
frameborder.left:SetColorTexture(0,0,0,1)
frameborder.right=frameborder:CreateTexture(nil,"BORDER")
frameborder.right:SetPoint("BOTTOMLEFT",frameborder,"BOTTOMRIGHT",1,-1)
frameborder.right:SetPoint("TOPRIGHT",frameborder,"TOPRIGHT",2,1)
frameborder.right:SetColorTexture(0,0,0,1)
frameborder.top=frameborder:CreateTexture(nil,"BORDER")
frameborder.top:SetPoint("BOTTOMLEFT",frameborder,"TOPLEFT",-1,1)
frameborder.top:SetPoint("TOPRIGHT",frameborder,"TOPRIGHT",1,2)
frameborder.top:SetColorTexture(0,0,0,1)
frameborder.bottom=frameborder:CreateTexture(nil,"BORDER")
frameborder.bottom:SetPoint("BOTTOMLEFT",frameborder,"BOTTOMLEFT",-1,-1)
frameborder.bottom:SetPoint("TOPRIGHT",frameborder,"BOTTOMRIGHT",1,-2)
frameborder.bottom:SetColorTexture(0,0,0,1)
A blank "background" container with four black textures anchored to the four corners. With the way this lays out, these lines rest right on the edges of the parent frame, leaving the blank corners clear from the parent frame's own background. Attached is a screenshot of my chatframes. I repeat this code for each chatframe separately.