{"id":828,"date":"2025-01-14T17:45:17","date_gmt":"2025-01-14T17:45:17","guid":{"rendered":"https:\/\/gratisvps.net\/blog\/?p=828"},"modified":"2025-01-14T17:45:17","modified_gmt":"2025-01-14T17:45:17","slug":"blocking-spam-on-a-vps-automatically","status":"publish","type":"post","link":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/","title":{"rendered":"Blocking SPAM on a VPS Automatically"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Automatically_Blocking_SPAM_on_a_VPS\" >Automatically Blocking SPAM on a VPS<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Introduction_to_SPAM\" >Introduction to SPAM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Setting_Up_Your_VPS\" >Setting Up Your VPS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Installing_Postfix_%E2%80%93_Blocking_SPAM_on_a_VPS_Automatically\" >Installing Postfix &#8211; Blocking SPAM on a VPS Automatically<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Installing_and_Configuring_SpamAssassin\" >Installing and Configuring SpamAssassin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Using_Fail2Ban_for_Additional_Protection\" >Using Fail2Ban for Additional Protection<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Implementing_DKIM_SPF_and_DMARC\" >Implementing DKIM, SPF, and DMARC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Testing_and_Monitoring_Your_Setup\" >Testing and Monitoring Your Setup<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#Best_Practices_for_Spam_Prevention\" >Best Practices for Spam Prevention<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#FAQs\" >FAQs<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1 id=\"tutorial-automatically-blocking-spam-on-a-vps\"><span class=\"ez-toc-section\" id=\"Automatically_Blocking_SPAM_on_a_VPS\"><\/span>Automatically Blocking SPAM on a VPS<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><strong>Objective:<\/strong> Blocking SPAM on a VPS Automatically ,This tutorial will guide you through the process of setting up an effective spam filtering system on a Virtual Private Server (VPS) using tools such as Postfix, SpamAssassin, and Fail2Ban. We will cover installation, configuration, and best practices for managing spam.<\/p>\n<hr \/>\n\n<hr \/>\n<h3 id=\"introduction-to-spam-a-nameintroductiona\"><span class=\"ez-toc-section\" id=\"Introduction_to_SPAM\"><\/span>Introduction to SPAM<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Spam emails are unsolicited messages sent in bulk, often for advertising or fraudulent purposes. Managing spam effectively is crucial for maintaining the integrity of your email communications and ensuring that legitimate emails are not lost among unwanted messages. This tutorial will provide you with the tools and techniques to automatically filter and manage spam on your VPS.<\/p>\n<hr \/>\n<h3 id=\"prerequisites-a-nameprerequisitesa\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Before starting, ensure you have:<\/p>\n<ul>\n<li>A VPS running Ubuntu (20.04 or later).<\/li>\n<li>Sudo access to install packages and modify configurations.<\/li>\n<li>A registered domain name with proper DNS settings.<\/li>\n<li>Basic knowledge of Linux command-line operations.<\/li>\n<\/ul>\n<hr \/>\n<h3 id=\"setting-up-your-vps-a-namesetting-up-your-vpsa\"><span class=\"ez-toc-section\" id=\"Setting_Up_Your_VPS\"><\/span>Setting Up Your VPS<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol start=\"1\">\n<li><strong>Update Your System:<\/strong>\n<p>Start by updating your package list:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo apt update  \r\nsudo apt upgrade -y<\/code><\/pre>\n<\/li>\n<li><strong>Install Required Packages:<\/strong>\n<p>Install the necessary tools for your mail server:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo apt install postfix mailutils -y<\/code><\/pre>\n<p>During the installation, select &#8220;Internet Site&#8221; and set your mail server name (e.g.,\u00a0<code>mail.yourdomain.com<\/code>).<\/li>\n<\/ol>\n<hr \/>\n<h3 id=\"installing-postfix-a-nameinstalling-postfixa\"><span class=\"ez-toc-section\" id=\"Installing_Postfix_%E2%80%93_Blocking_SPAM_on_a_VPS_Automatically\"><\/span>Installing Postfix &#8211; Blocking SPAM on a VPS Automatically<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol start=\"1\">\n<li><strong>Configure Postfix:<\/strong>\n<p>Edit the Postfix configuration file:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo nano \/etc\/postfix\/main.cf<\/code><\/pre>\n<p>Update the following settings:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">myhostname = mail.yourdomain.com  \r\nmydomain = yourdomain.com  \r\nmyorigin = \/etc\/mailname  \r\nmydestination = $myhostname, localhost.$mydomain, localhost, $mydomain  \r\nrelayhost =<\/code><\/pre>\n<\/li>\n<li><strong>Restart Postfix:<\/strong>\n<p>After making changes, restart Postfix:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo systemctl restart postfix<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>This ensures that your mail server is up and configured correctly.<\/p>\n<hr \/>\n<h3 id=\"installing-and-configuring-spamassassin-a-nameinstalling-spamassassina\"><span class=\"ez-toc-section\" id=\"Installing_and_Configuring_SpamAssassin\"><\/span>Installing and Configuring SpamAssassin<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>SpamAssassin is a powerful spam-filtering tool that uses various methods to detect spam and can be easily integrated with Postfix.<\/p>\n<ol start=\"1\">\n<li><strong>Install SpamAssassin:<\/strong>\n<p>Begin by installing <a href=\"https:\/\/spamassassin.apache.org\/\">SpamAssassin<\/a>:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo apt install spamassassin spamc -y<\/code><\/pre>\n<\/li>\n<li><strong>Enable and Start the SpamAssassin Service:<\/strong>\n<p>Enable and start the SpamAssassin service:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo systemctl <span class=\"hljs-built_in\">enable<\/span> spamassassin  \r\nsudo systemctl start spamassassin<\/code><\/pre>\n<\/li>\n<li><strong>Basic Configuration:<\/strong>\n<p>Edit the SpamAssassin configuration file:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo nano \/etc\/spamassassin\/local.cf<\/code><\/pre>\n<p>Add or modify the following settings:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">required_score 5.0        # Score above which emails are considered spam  \r\nrewrite_header Subject ***SPAM***\r\nreport_safe 0             # Send original message instead of a report<\/code><\/pre>\n<p><strong>Note:<\/strong>\u00a0Adjust\u00a0<code>required_score<\/code>\u00a0to your preference. A lower score results in more aggressive filtering.<\/li>\n<li><strong>Integrating SpamAssassin with Postfix:<\/strong>\n<p>To enable Postfix to use SpamAssassin, edit the Postfix configuration file again:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo nano \/etc\/postfix\/master.cf<\/code><\/pre>\n<p>Add the following lines at the end of the file to configure the content filter:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">spamassassin unix -   -   n   -   100   pipe  \r\n  flags=R user=debain-user argv=\/usr\/bin\/spamc -f -e \/usr\/sbin\/sendmail -t<\/code><\/pre>\n<p>Now, tell Postfix to use SpamAssassin for incoming emails by updating the\u00a0<a href=\"https:\/\/gratisvps.net\/blog\/how-to-install-and-configure-smtp-server\/\"><code>smtp<\/code><\/a>\u00a0service:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">smtp      inet  n       -       y       -       -       smtpd  \r\n  -o content_filter=spamassassin<\/code><\/pre>\n<\/li>\n<li><strong>Restart Postfix:<\/strong>\n<p>Restart Postfix again to apply changes:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo systemctl restart postfix<\/code><\/pre>\n<\/li>\n<\/ol>\n<hr \/>\n<h3 id=\"using-fail2ban-for-additional-protection-a-nameusing-fail2bana\"><span class=\"ez-toc-section\" id=\"Using_Fail2Ban_for_Additional_Protection\"><\/span>Using Fail2Ban for Additional Protection<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Fail2Ban is a useful tool that helps protect your server from brute-force attacks and can block IP addresses that exhibit malicious behavior.<\/p>\n<ol start=\"1\">\n<li><strong>Install Fail2Ban:<\/strong>\n<p>Install Fail2Ban with the following command:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo apt install fail2ban -y<\/code><\/pre>\n<\/li>\n<li><strong>Configure Fail2Ban:<\/strong>\n<p>Copy the default configuration file:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo <span class=\"hljs-built_in\">cp<\/span> \/etc\/fail2ban\/jail.conf \/etc\/fail2ban\/jail.local<\/code><\/pre>\n<p>Edit the configuration:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo nano \/etc\/fail2ban\/jail.local<\/code><\/pre>\n<p>Configure the\u00a0<code>[postfix]<\/code>\u00a0section:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">[postfix]\r\nenabled  = true  \r\nport     = smtp  \r\nfilter   = postfix  \r\nlogpath  = \/var\/log\/mail.log  \r\nmaxretry = 3  \r\nbantime  = 600<\/code><\/pre>\n<\/li>\n<li><strong>Restart Fail2Ban:<\/strong>\n<p>After making changes, restart Fail2Ban:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo systemctl restart fail2ban<\/code><\/pre>\n<p>This setup will block an IP after three failed attempts for 10 minutes.<\/li>\n<\/ol>\n<hr \/>\n<h3 id=\"implementing-dkim-spf-and-dmarc-a-nameimplementing-dkima\"><span class=\"ez-toc-section\" id=\"Implementing_DKIM_SPF_and_DMARC\"><\/span>Implementing DKIM, SPF, and DMARC<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To further reduce spam and improve deliverability, configure DKIM (DomainKeys Identified Mail), SPF (Sender Policy Framework), and DMARC (Domain-based Message Authentication, Reporting &amp; Conformance).<\/p>\n<ol start=\"1\">\n<li><strong>Setting Up SPF:<\/strong>\n<p>Add an SPF record to your DNS settings:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">v=spf1 mx a ip4:YOUR_SERVER_IP -all<\/code><\/pre>\n<p>Replace\u00a0<code>YOUR_SERVER_IP<\/code>\u00a0with your VPS&#8217;s actual IP address.<\/li>\n<li><strong>Setting Up DKIM:<\/strong>\n<p>Install OpenDKIM:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo apt install opendkim opendkim-tools -y<\/code><\/pre>\n<p>Configure OpenDKIM by editing the configuration file:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo nano \/etc\/opendkim.conf<\/code><\/pre>\n<p>Add or modify these lines:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">Syslog                  yes  \r\nUMASK                   002  \r\nDomain                  yourdomain.com  \r\nKeyFile                 \/etc\/opendkim\/keys\/default.private  \r\nSelector                default  \r\nSocket                  inet:12301@localhost<\/code><\/pre>\n<p>Now, create the directory for the keys:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo <span class=\"hljs-built_in\">mkdir<\/span> \/etc\/opendkim\/keys  \r\n<span class=\"hljs-built_in\">cd<\/span> \/etc\/opendkim\/keys  \r\nsudo opendkim-genkey -s default -d yourdomain.com  \r\nsudo <span class=\"hljs-built_in\">mv<\/span> default.private default  \r\nsudo <span class=\"hljs-built_in\">mv<\/span> default.txt \/etc\/opendkim\/keys\/<\/code><\/pre>\n<p>Add the public key (found in\u00a0<code>default.txt<\/code>) to your DNS records.<\/li>\n<li><strong>Configure Postfix to Use OpenDKIM:<\/strong>\n<p>Edit the Postfix configuration again:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo nano \/etc\/postfix\/main.cf<\/code><\/pre>\n<p>Add the following lines:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">milter_protocol = 2  \r\nsmtpd_milters = inet:localhost:12301  \r\nnon_smtpd_milters = inet:localhost:12301<\/code><\/pre>\n<\/li>\n<li><strong>Setting Up DMARC:<\/strong>\n<p>Add a DMARC record to your DNS settings:<\/p>\n<pre><code class=\"lang-plaintext hljs language-plaintext\">_dmarc.yourdomain.com  IN TXT \"v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com; ruf=mailto:dmarc-reports@yourdomain.com; pct=100\"<\/code><\/pre>\n<p>Adjust the policy (<code>p=none<\/code>) to your preference as you gain confidence in your setup.<\/li>\n<\/ol>\n<hr \/>\n<h3 id=\"testing-and-monitoring-your-setup-a-nametesting-and-monitoringa\"><span class=\"ez-toc-section\" id=\"Testing_and_Monitoring_Your_Setup\"><\/span>Testing and Monitoring Your Setup<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol start=\"1\">\n<li><strong>Testing SpamAssassin:<\/strong>\n<p>You can test the effectiveness of SpamAssassin by sending yourself emails containing known spam phrases. Use the following command:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">spamc -c &lt; spamemail.txt<\/code><\/pre>\n<p>Check if the email was classified as spam.<\/li>\n<li><strong>Monitor Mail Logs:<\/strong>\n<p>Regularly check your mail logs for any unusual activity:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo <span class=\"hljs-built_in\">tail<\/span> -f \/var\/log\/mail.log<\/code><\/pre>\n<p>This will help you identify potential spam attempts.<\/li>\n<li><strong>Use Online Testing Tools:<\/strong>\n<p>Utilize online tools like Mail Tester (<a href=\"https:\/\/www.mail-tester.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.mail-tester.com\/<\/a>) to analyze your sending reputation, SPF, DKIM, and DMARC configuration.<\/li>\n<\/ol>\n<hr \/>\n<h3 id=\"best-practices-for-spam-prevention-a-namebest-practicesa\"><span class=\"ez-toc-section\" id=\"Best_Practices_for_Spam_Prevention\"><\/span>Best Practices for Spam Prevention<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol start=\"1\">\n<li><strong>Regular Updates:<\/strong>\n<p>Keep your server software updated. Use the command:<\/p>\n<pre><code class=\"lang-bash hljs language-bash\">sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<\/li>\n<li><strong>Strong Password Policies:<\/strong>\n<p>Use strong passwords for all user accounts, especially for email users.<\/li>\n<li><strong>Limit Email Sending Rate:<\/strong>\n<p>Configure Postfix to limit the rate of outgoing emails to prevent spammers from using your server.<\/li>\n<li><strong>User Education:<\/strong>\n<p>Educate users on recognizing spam and phishing attempts. Encourage them to report suspicious emails.<\/li>\n<li><strong>Regular Backups:<\/strong>\n<p>Regularly back up your configurations and user data to ensure quick recovery in case of an incident.<\/li>\n<\/ol>\n<hr \/>\n<h3 id=\"faqs-a-namefaqsa\"><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>Q1: Why do I still receive spam emails after setting up SpamAssassin?<\/strong><\/p>\n<ul>\n<li>While SpamAssassin significantly reduces spam, no system is foolproof. Adjust the\u00a0<code>required_score<\/code>\u00a0to a lower value to catch more spam, but be cautious of false positives.<\/li>\n<\/ul>\n<p><strong>Q2: What should I do if legitimate emails are marked as spam?<\/strong><\/p>\n<ul>\n<li>Review your SpamAssassin configuration and consider white listing certain addresses or domains. Add them to the <code>local.cf<\/code>\u00a0file:\n<pre><code class=\"lang-plaintext hljs language-plaintext\">whitelist_from user@legitdomain.com<\/code><\/pre>\n<\/li>\n<\/ul>\n<p><strong>Q3: How can I monitor the effectiveness of my spam filter?<\/strong><\/p>\n<ul>\n<li>Check your mail logs frequently to see how many emails are marked as spam and adjust your filtering rules as necessary.<\/li>\n<\/ul>\n<p><strong>Q4: Is it better to use a third-party service for spam filtering?<\/strong><\/p>\n<ul>\n<li>Third-party services can provide advanced filtering and easy integration, but managing your own system gives you greater control and privacy.<\/li>\n<\/ul>\n<p><strong>Q5: Can I use other spam filtering tools along with SpamAssassin?<\/strong><\/p>\n<ul>\n<li>Yes, tools like Amavisd-new or MailScanner can enhance filtering capabilities, but ensure they are properly integrated to avoid conflicts.<\/li>\n<\/ul>\n<hr \/>\n<p>By following this comprehensive guide, you will have established a robust spam filtering system on your VPS using Postfix, SpamAssassin, and Fail2Ban. This configuration will significantly reduce spam and enhance the security of your email communications. If you have further questions or need assistance, feel free to ask!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automatically Blocking SPAM on a VPS Objective: Blocking SPAM on a VPS Automatically ,This tutorial will guide you through the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":829,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[254,54],"class_list":["post-828","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-block-spam","tag-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Blocking SPAM on a VPS Automatically<\/title>\n<meta name=\"description\" content=\"Blocking SPAM on a VPS Automatically , Spam emails are unsolicited messages sent in bulk, often for advertising or fraudulent purposes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Blocking SPAM on a VPS Automatically\" \/>\n<meta property=\"og:description\" content=\"Blocking SPAM on a VPS Automatically , Spam emails are unsolicited messages sent in bulk, often for advertising or fraudulent purposes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/\" \/>\n<meta property=\"og:site_name\" content=\"Free VPS Hosting Guides\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-14T17:45:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2025\/01\/spam-block.png\" \/>\n\t<meta property=\"og:image:width\" content=\"832\" \/>\n\t<meta property=\"og:image:height\" content=\"448\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ariete\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ariete\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/\"},\"author\":{\"name\":\"ariete\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#\\\/schema\\\/person\\\/cddcf8cb5192d0713c19b79425c77fc4\"},\"headline\":\"Blocking SPAM on a VPS Automatically\",\"datePublished\":\"2025-01-14T17:45:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/\"},\"wordCount\":918,\"publisher\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/spam-block.png\",\"keywords\":[\"Block SPAM\",\"vps\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/\",\"url\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/\",\"name\":\"Blocking SPAM on a VPS Automatically\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/spam-block.png\",\"datePublished\":\"2025-01-14T17:45:17+00:00\",\"description\":\"Blocking SPAM on a VPS Automatically , Spam emails are unsolicited messages sent in bulk, often for advertising or fraudulent purposes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/spam-block.png\",\"contentUrl\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/spam-block.png\",\"width\":832,\"height\":448,\"caption\":\"Blocking SPAM on a VPS Automatically\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/blocking-spam-on-a-vps-automatically\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blocking SPAM on a VPS Automatically\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/\",\"name\":\"Gratisvps.net | Blog Daily Tech Info\",\"description\":\"GratisVPS.NET\",\"publisher\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#organization\",\"name\":\"Gratisvps.net | Blog Daily Tech Info\",\"url\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/logo.png\",\"width\":250,\"height\":67,\"caption\":\"Gratisvps.net | Blog Daily Tech Info\"},\"image\":{\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/#\\\/schema\\\/person\\\/cddcf8cb5192d0713c19b79425c77fc4\",\"name\":\"ariete\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b93881052caa63fd6b2fb5468a80afcf9f985a165c6d4de11a72cc4c0775f74a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b93881052caa63fd6b2fb5468a80afcf9f985a165c6d4de11a72cc4c0775f74a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b93881052caa63fd6b2fb5468a80afcf9f985a165c6d4de11a72cc4c0775f74a?s=96&d=mm&r=g\",\"caption\":\"ariete\"},\"sameAs\":[\"https:\\\/\\\/gratisvps.net\\\/blog\"],\"url\":\"https:\\\/\\\/gratisvps.net\\\/blog\\\/author\\\/ariete\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Blocking SPAM on a VPS Automatically","description":"Blocking SPAM on a VPS Automatically , Spam emails are unsolicited messages sent in bulk, often for advertising or fraudulent purposes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/","og_locale":"en_US","og_type":"article","og_title":"Blocking SPAM on a VPS Automatically","og_description":"Blocking SPAM on a VPS Automatically , Spam emails are unsolicited messages sent in bulk, often for advertising or fraudulent purposes.","og_url":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/","og_site_name":"Free VPS Hosting Guides","article_published_time":"2025-01-14T17:45:17+00:00","og_image":[{"width":832,"height":448,"url":"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2025\/01\/spam-block.png","type":"image\/png"}],"author":"ariete","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ariete","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#article","isPartOf":{"@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/"},"author":{"name":"ariete","@id":"https:\/\/gratisvps.net\/blog\/#\/schema\/person\/cddcf8cb5192d0713c19b79425c77fc4"},"headline":"Blocking SPAM on a VPS Automatically","datePublished":"2025-01-14T17:45:17+00:00","mainEntityOfPage":{"@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/"},"wordCount":918,"publisher":{"@id":"https:\/\/gratisvps.net\/blog\/#organization"},"image":{"@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#primaryimage"},"thumbnailUrl":"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2025\/01\/spam-block.png","keywords":["Block SPAM","vps"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/","url":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/","name":"Blocking SPAM on a VPS Automatically","isPartOf":{"@id":"https:\/\/gratisvps.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#primaryimage"},"image":{"@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#primaryimage"},"thumbnailUrl":"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2025\/01\/spam-block.png","datePublished":"2025-01-14T17:45:17+00:00","description":"Blocking SPAM on a VPS Automatically , Spam emails are unsolicited messages sent in bulk, often for advertising or fraudulent purposes.","breadcrumb":{"@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#primaryimage","url":"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2025\/01\/spam-block.png","contentUrl":"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2025\/01\/spam-block.png","width":832,"height":448,"caption":"Blocking SPAM on a VPS Automatically"},{"@type":"BreadcrumbList","@id":"https:\/\/gratisvps.net\/blog\/blocking-spam-on-a-vps-automatically\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gratisvps.net\/blog\/"},{"@type":"ListItem","position":2,"name":"Blocking SPAM on a VPS Automatically"}]},{"@type":"WebSite","@id":"https:\/\/gratisvps.net\/blog\/#website","url":"https:\/\/gratisvps.net\/blog\/","name":"Gratisvps.net | Blog Daily Tech Info","description":"GratisVPS.NET","publisher":{"@id":"https:\/\/gratisvps.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gratisvps.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gratisvps.net\/blog\/#organization","name":"Gratisvps.net | Blog Daily Tech Info","url":"https:\/\/gratisvps.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gratisvps.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2024\/10\/logo.png","contentUrl":"https:\/\/gratisvps.net\/blog\/wp-content\/uploads\/2024\/10\/logo.png","width":250,"height":67,"caption":"Gratisvps.net | Blog Daily Tech Info"},"image":{"@id":"https:\/\/gratisvps.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/gratisvps.net\/blog\/#\/schema\/person\/cddcf8cb5192d0713c19b79425c77fc4","name":"ariete","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b93881052caa63fd6b2fb5468a80afcf9f985a165c6d4de11a72cc4c0775f74a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b93881052caa63fd6b2fb5468a80afcf9f985a165c6d4de11a72cc4c0775f74a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b93881052caa63fd6b2fb5468a80afcf9f985a165c6d4de11a72cc4c0775f74a?s=96&d=mm&r=g","caption":"ariete"},"sameAs":["https:\/\/gratisvps.net\/blog"],"url":"https:\/\/gratisvps.net\/blog\/author\/ariete\/"}]}},"_links":{"self":[{"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/posts\/828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/comments?post=828"}],"version-history":[{"count":1,"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/posts\/828\/revisions"}],"predecessor-version":[{"id":830,"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/posts\/828\/revisions\/830"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/media\/829"}],"wp:attachment":[{"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/media?parent=828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/categories?post=828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gratisvps.net\/blog\/wp-json\/wp\/v2\/tags?post=828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}