Spam is a major problem, fortunately, there are a number of tools that can be used to filter spam out automatically.
Spamassassin can be installed to perform this task. By default it uses Berkley DB files to store it's tables. With time these can grow too large for reliable operation. This problem can be avoided by the use of a MySQL database.