Spam prevention is a classic puzzle in the research area of network security. The conventional spam filtering techniques still result to high false positives and have weak on-line processing ability. This paper presents a novel two-tier spam filter (TTSF) on the basis of analyses over the conventional anti-spam techniques. TTSF on-line filters spam by using URLs and off-line filters spam using digest-based approach. Experimental evaluations from the constructed prototype based on TTSF demonstrate it can significantly raise the filtering accuracy, effectively reduce false positives and can be applied to on-line processing and heavy traffic environment by reducing the computational cost than the state-of-the-art techniques