The document presents a novel two-way spam detection system named COSDES, which utilizes an innovative email abstraction scheme based on HTML structure to enhance near-duplicate spam detection. This system addresses the limitations of previous methods by maintaining a comprehensive spam database and implementing a progressive update mechanism, allowing it to adapt to the evolving nature of spam. Evaluation on real email data shows that COSDES outperforms existing techniques in detecting spam effectively and efficiently.