Face to the spam mail and virus mail problem, a lot of antivirus software manufacturers and information security solution providers bring up many hardware filter products, lie in the information gateway and Internet, its main purpose is to defend the attack of virus and junk mail. But the announced products of information security mostly belong to the hardware, which tend to be very expensive, become the burden of the applying unit. This thesis first builds a PostFix mail server in UNIX platform, and then integrates SpamAssassin and ClamAV to construct spam mail and virus mail defense mechanism, which to reduce the construction cost and to improve the effectively. In addition, although the filter mechanism sets up in server side can reduce bandwidth usage caused by a large number of spam mails and reduce construction cost, but the filter rules will cause large workloads in sever system to influence the performance of SpamAssassin. Therefore, this thesis proposes an integrated system for spam mail and virus mail with load balance technology, helping users to optimize efficiency and to reduce error rate. This proposed system can satisfy various mail systems to improve service quality.