1

Topic: Marking as SPAM emails from account belonging to ORIGINATING domain

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):  1.3
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: Ubuntu 18.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I am trying to somehow discard emails sent by one recipient account belonging to the domain I am administering. The MTA is Outlook various versions on Windows machines. The behaviour is as following: using the instructions form docs.iredmail.org/manage.iredapd.html I blaclisted the desired account (for another one), the message is marked correctly as ***Spam*** but it PASSES to the destination recipient and at MTA level goes directly to Junk Email folder. No matter what I do to change the Outlook options it seems that message is stoned forever in Junk Email folder. If I setup a rule to permanently delete messages that contains ***Spam*** in the subject line, nothing is happened.

/etc/amavis/conf.d/50-user file contains the following settings:

 $policy_bank{'ORIGINATING'} = {
    originating => 1,         # declare that mail was submitted by our smtp client
    allow_disclaimers => 1,   # enables disclaimer insertion if available
    enable_dkim_signing => 1,

    # notify administrator of locally originating malware
    #spam_admin_maps  => ["postmaster\@$mydomain"],
    # notify administrator of locally originating malware
    virus_admin_maps => ["postmaster\@$mydomain"],
    spam_admin_maps  => ["postmaster\@$mydomain"],
    bad_header_admin_maps => ["postmaster\@$mydomain"],
    banned_admin_maps => ["postmaster\@$mydomain"],
    warnbadhsender   => 0,
    warnbannedsender => 0,
    #warnspamsender => 0, #declare it outside policy

    # force MTA conversion to 7-bit (e.g. before DKIM signing)
    smtpd_discard_ehlo_keywords => ['8BITMIME'],
    terminate_dsn_on_notify_success => 0,  # don't remove NOTIFY=SUCCESS option

    # Bypass checks
    #bypass_spam_checks_maps => [1],    # don't check spam
    #bypass_virus_checks_maps => [1],   # don't check virus
    #bypass_banned_checks_maps => [1],  # don't check banned file names and types
    #bypass_header_checks_maps => [1],  # don't check bad header
};
# SPAM.
$final_spam_destiny = D_BOUNCE;
$spam_quarantine_method = 'sql:';
$spam_quarantine_to = 'spam-quarantine';

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.