The First IM system created by Mirabilis (a pioneer of online chatting that revolutionized communication over the Internet), dubbed ICQ (I seek you), in 1996 which achieved widespread adoption quickly among netizens. Although other instant messaging (IM) systems have surpassed ICQ in popularity, the medium of IM remains a popular form of technologized communication. The major drawback has been the vulnerabilities associated with IM technology. These vulnerabilities have created so many security issues. For efficient activity in each message encryption and decryption. We propose Spam Abstraction Scheme, which considers e-mail layout structure to represent e-mails. We present a procedure to generate the e-mail abstraction using HTML content in e-mail (especially anchor and image tags), and this newly devised abstraction can more effectively capture the near-duplicate phenomenon of spams. Moreover, we design a complete spam detection system that considers other Spam Checking Criteria's besides Content-based filtrations.