<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[iRedMail — Blacklist]]></title>
		<link>https://forum.iredmail.org/topic20916-blacklist.html</link>
		<atom:link href="https://forum.iredmail.org/feed-rss-topic20916.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Blacklist.]]></description>
		<lastBuildDate>Fri, 21 Nov 2025 07:12:10 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Blacklist]]></title>
			<link>https://forum.iredmail.org/post91446.html#p91446</link>
			<description><![CDATA[<div class="quotebox"><cite>iamapo wrote:</cite><blockquote><div class="quotebox"><cite>WhoAmI68 wrote:</cite><blockquote><p>You can add a bad domain to SpamAssassin. Below is an example.</p><p>sudo nano /etc/spamassassin/header-keywords.cf</p><div class="codebox"><pre><code>header DOMAINE_FROM_01 From =~ /\@badguys\.de|\@badguys\.com/i
header DOMAINE_FROM_02 From =~ /\@badguys\.es|\@badguys\.net/i
meta DOMAINE_FROM (( DOMAINE_FROM_01 + DOMAINE_FROM_02 ))
score DOMAINE_FROM  10.1</code></pre></div><p>Also add a score to the Sieve filter.</p><p>sudo nano /var/vmail/sieve/dovecot.sieve</p><div class="codebox"><pre><code>if header :contains &quot;X-Spam-Level&quot; &quot;**********&quot; {
    discard;
    stop;
}</code></pre></div></blockquote></div><p>Thanks dude,&nbsp; unfortunately, I don&#039;t have /etc/spamassassin/header-keywords.cf on my CentOS.</p></blockquote></div><p>Just create any file with a .cf extension, e.g., /etc/spamassassin/somename.cf, or you can also add it to local.cf.<br />The Sieve rule for the header :contains &#039;X-Spam-Level&#039; must be placed before &#039;X-Spam-Flag&#039; &#039;YES&#039;.</p>]]></description>
			<author><![CDATA[null@example.com (WhoAmI68)]]></author>
			<pubDate>Fri, 21 Nov 2025 07:12:10 +0000</pubDate>
			<guid>https://forum.iredmail.org/post91446.html#p91446</guid>
		</item>
		<item>
			<title><![CDATA[Re: Blacklist]]></title>
			<link>https://forum.iredmail.org/post91443.html#p91443</link>
			<description><![CDATA[<p>Add spamassassin rule to /etc/mail/spamassassin/local.cf.</p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Thu, 20 Nov 2025 10:28:14 +0000</pubDate>
			<guid>https://forum.iredmail.org/post91443.html#p91443</guid>
		</item>
		<item>
			<title><![CDATA[Re: Blacklist]]></title>
			<link>https://forum.iredmail.org/post91440.html#p91440</link>
			<description><![CDATA[<div class="quotebox"><cite>WhoAmI68 wrote:</cite><blockquote><p>You can add a bad domain to SpamAssassin. Below is an example.</p><p>sudo nano /etc/spamassassin/header-keywords.cf</p><div class="codebox"><pre><code>header DOMAINE_FROM_01 From =~ /\@badguys\.de|\@badguys\.com/i
header DOMAINE_FROM_02 From =~ /\@badguys\.es|\@badguys\.net/i
meta DOMAINE_FROM (( DOMAINE_FROM_01 + DOMAINE_FROM_02 ))
score DOMAINE_FROM  10.1</code></pre></div><p>Also add a score to the Sieve filter.</p><p>sudo nano /var/vmail/sieve/dovecot.sieve</p><div class="codebox"><pre><code>if header :contains &quot;X-Spam-Level&quot; &quot;**********&quot; {
    discard;
    stop;
}</code></pre></div></blockquote></div><p>Thanks dude,&nbsp; unfortunately, I don&#039;t have /etc/spamassassin/header-keywords.cf on my CentOS.</p>]]></description>
			<author><![CDATA[null@example.com (iamapo)]]></author>
			<pubDate>Thu, 20 Nov 2025 06:15:49 +0000</pubDate>
			<guid>https://forum.iredmail.org/post91440.html#p91440</guid>
		</item>
		<item>
			<title><![CDATA[Re: Blacklist]]></title>
			<link>https://forum.iredmail.org/post91434.html#p91434</link>
			<description><![CDATA[<p>My personal recommendations about phishing <img src="https://forum.iredmail.org/img/smilies/smile.png" width="15" height="15" alt="smile" />.<br />This rule blocks around 90% of one-off hacks cases where an attacker compromises someone’s VPS and sends messages with their own Reply-To address. However, be careful: some older ISPs and hosting providers still legitimately use different domains for the From and Reply-To fields.</p><p>1 - sudo nano /etc/spamassassin/plugins/FromAndReplyToIsNotSameDomain.pm</p><div class="codebox"><pre><code>package FromAndReplyToIsNotSameDomain;
use Mail::SpamAssassin::Plugin;

our @ISA = qw(Mail::SpamAssassin::Plugin);

sub new {
    my ( $class, $mailsa ) = @_;

    # the usual perlobj boilerplate to create a subclass object
    $class = ref($class) || $class;
    my $self = $class-&gt;SUPER::new($mailsa);
    bless( $self, $class );

    # then register an eval rule, if desired...
    $self-&gt;register_eval_rule(&quot;check_for_from_and_reply_to_is_not_same_domain&quot;);

    # and return the new plugin object
    return $self;
}

sub check_for_from_and_reply_to_is_not_same_domain {
    my ( $self, $msg ) = @_;
    my $check_from = lc( $msg-&gt;get(&#039;From:addr&#039;) );
    $check_from =~ s/.*@//;

    my $check_replyTo = lc( $msg-&gt;get(&#039;Reply-To:addr&#039;) );
    $check_replyTo =~ s/.*@//;

    Mail::SpamAssassin::Plugin::dbg(
        &quot;FromAndReplyToIsNotSameDomain: Comparing &#039;$check_from&#039;/&#039;$check_replyTo&quot;
    );

    if ( ( $check_from eq &#039;&#039; ) || ( $check_replyTo eq &#039;&#039; ) ) {
        return 0;    #PASS, empty from or reply to
    }

    my ( @check_fromParts, @check_replyToParts );

    #short-circuit logic
    if ( $check_from ne $check_replyTo ) {

        #create arrays to make life easier
        @check_fromParts    = split( /\./, $check_from );
        @check_replyToParts = split( /\./, $check_replyTo );

        if ( ( $#check_fromParts ge 1 ) &amp;&amp; ( $#check_fromParts ge 1 ) ) {
            if ( $check_fromParts[-1] ne $check_replyToParts[-1] ) {
                return 1;    #fail, not the same .tld
            }
            if ( $check_fromParts[-2] ne $check_replyToParts[-2] ) {
                return 1;    #fail, not the same domain.tld / tld.tld
            }
        }
        if ( ( $#check_fromParts ge 3 ) &amp;&amp; ( $#check_fromParts ge 3 ) ) {
            if ( $check_fromParts[-3] ne $check_replyToParts[-3] ) {
                return 1;    #fail,not the same sub.domain.tld / domain.tld.tld
            }
        }
        if ( ( $#check_fromParts ge 4 ) &amp;&amp; ( $#check_fromParts ge 4 ) ) {
            if ( ( $#check_fromParts gt 4 ) || ( $#check_fromParts gt 4 ) ) {
                if ( $check_fromParts[-4] ne $check_replyToParts[-4] ) {
                    return
                      1
                      ; #fail,not the same domain sub.sub.sub.domain.tld / sub.sub.domain.tld.tld
                }
            }
            else {
                if ( $check_fromParts[-3] ne $check_replyToParts[-3] ) {
                    return
                      1
                      ; #fail,not the same domain sub.sub.domain.tld / sub.domain.tld.tld
                }
            }
        }
    }
    return 0;           #PASS
}

# This ;1 is importa</code></pre></div><p>1- sudo nano /etc/spamassassin/header-keywords.cf</p><div class="codebox"><pre><code># Domain does not match Reply-To domain
loadplugin FromAndReplyToIsNotSameDomain /etc/spamassassin/plugins/FromAndReplyToIsNotSameDomain.pm
header FROM_NOT_REPLYTO_SAME_DOMAIN eval:check_for_from_and_reply_to_is_not_same_domain()
score FROM_NOT_REPLYTO_SAME_DOMAIN 10.1
describe FROM_NOT_REPLYTO_SAME_DOMAIN From domain does not match Reply-To domain</code></pre></div><p>2 - Flags messages where the “From” display name looks like a domain that matches the recipient’s domain, indicating possible phishing.<br /></p><div class="codebox"><pre><code>header   __PDS_FROM_NAME_TO_DOMAIN  ALL =~ /From: [&quot;&#039;]?([a-z0-9\.-]+\.[0-9a-z\.-]+)[&quot;&#039;]? [^\n]+\n+To:[^\n]+\@\1/ism
meta     PDS_FROM_NAME_TO_DOMAIN __PDS_FROM_NAME_TO_DOMAIN
score    PDS_FROM_NAME_TO_DOMAIN 10.1
describe PDS_FROM_NAME_TO_DOMAIN From:name looks like To:domain</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (WhoAmI68)]]></author>
			<pubDate>Wed, 19 Nov 2025 14:06:20 +0000</pubDate>
			<guid>https://forum.iredmail.org/post91434.html#p91434</guid>
		</item>
		<item>
			<title><![CDATA[Re: Blacklist]]></title>
			<link>https://forum.iredmail.org/post91433.html#p91433</link>
			<description><![CDATA[<p>SpamAssassin is more flexible for these bad guys <img src="https://forum.iredmail.org/img/smilies/smile.png" width="15" height="15" alt="smile" />. You can check the body and discard emails based on body keywords or by top-level domains.</p><div class="codebox"><pre><code># Body Checks
body BODY_CHECKS_RULE_01 /\CANNABIS|viagra|free.hr\b/i
body BODY_CHECKS_RULE_02 /\ZENTIVA|velko-mix.cz\b/i
meta BODY_CHECKS_RULE (( BODY_CHECKS_RULE_01 + BODY_CHECKS_RULE_02 ))
score BODY_CHECKS_RULE 10.1</code></pre></div><br /><div class="codebox"><pre><code># Blacklist Top-Level-Domains
header   TLD_BLOCK From =~ /@([a-zA-Z0-9-]+\.)?(top|shop|live|io|biz)\b/i
describe TLD_BLOCK Blacklisted TLDs
score    TLD_BLOCK 10.1</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (WhoAmI68)]]></author>
			<pubDate>Wed, 19 Nov 2025 13:02:31 +0000</pubDate>
			<guid>https://forum.iredmail.org/post91433.html#p91433</guid>
		</item>
		<item>
			<title><![CDATA[Re: Blacklist]]></title>
			<link>https://forum.iredmail.org/post91431.html#p91431</link>
			<description><![CDATA[<p>You can add a bad domain to SpamAssassin. Below is an example.</p><p>sudo nano /etc/spamassassin/header-keywords.cf</p><div class="codebox"><pre><code>header DOMAINE_FROM_01 From =~ /\@badguys\.de|\@badguys\.com/i
header DOMAINE_FROM_02 From =~ /\@badguys\.es|\@badguys\.net/i
meta DOMAINE_FROM (( DOMAINE_FROM_01 + DOMAINE_FROM_02 ))
score DOMAINE_FROM  10.1</code></pre></div><p>Also add a score to the Sieve filter.</p><p>sudo nano /var/vmail/sieve/dovecot.sieve</p><div class="codebox"><pre><code>if header :contains &quot;X-Spam-Level&quot; &quot;**********&quot; {
    discard;
    stop;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (WhoAmI68)]]></author>
			<pubDate>Wed, 19 Nov 2025 12:39:55 +0000</pubDate>
			<guid>https://forum.iredmail.org/post91431.html#p91431</guid>
		</item>
		<item>
			<title><![CDATA[Re: Blacklist]]></title>
			<link>https://forum.iredmail.org/post91428.html#p91428</link>
			<description><![CDATA[<p>I have same issue, no solution ? Thanks all.</p>]]></description>
			<author><![CDATA[null@example.com (iamapo)]]></author>
			<pubDate>Tue, 18 Nov 2025 04:16:09 +0000</pubDate>
			<guid>https://forum.iredmail.org/post91428.html#p91428</guid>
		</item>
		<item>
			<title><![CDATA[Blacklist]]></title>
			<link>https://forum.iredmail.org/post90973.html#p90973</link>
			<description><![CDATA[<p>==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====<br />- iRedMail version (check /etc/iredmail-release): 1.7.4<br />- Deployed with iRedMail Easy or the downloadable installer?<br />- Linux/BSD distribution name and version: <br />- Store mail accounts in which backend (LDAP/MySQL/PGSQL): <br />- Web server (Apache or Nginx):<br />- Manage mail accounts with iRedAdmin-Pro?<br />- [IMPORTANT] Related original log or error message is required if you&#039;re experiencing an issue.<br />====</p><p>Good day. I added two addresses to the blacklist <br />python3 /opt/iredapd/tools/wblist_admin.py --add --blacklist @XXX.com<br />but the letters still come from this domain, they are marked as spam. Is it possible to block them so as not to receive these letters at all? Thanks</p>]]></description>
			<author><![CDATA[null@example.com (lexx063)]]></author>
			<pubDate>Thu, 19 Jun 2025 07:21:26 +0000</pubDate>
			<guid>https://forum.iredmail.org/post90973.html#p90973</guid>
		</item>
	</channel>
</rss>
