You can easily protect your Drupal application from spam messages simply by installing anti spam module for it. One of the best anti-spam modules for Drupal is called AntiSpam. It is designed specially for such purpose and includes several different third party anti spam services. You can download AntiSpam from the official Drupal website:
https://www.drupal.org/project/antispam
Another option to prevent your Drupal application from spam is installing the CAPTCHA module. It is used to block submissions from spambots. You can find more information and download this module from the following link:
https://www.drupal.org/project/captcha