1

Topic: Notify users about quarantined mails when they blacklist no-reply

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

I have enable notifications for quarantined mail on the server.  One user has added

no-reply@localhost.local

to their blacklist.  This causes a bounce email to root like the below.

There does not seem to be a way to force delivery.  There also does not seem to be a way to exempt the user from being sent the notice.

I tried adding

  bypass_spam_checks_maps   => [1],  # don't spam-check internal mail
  bypass_banned_checks_maps => [1],  # don't banned-check internal mail
  bypass_header_checks_maps => [1],  # don't header-check internal mail 

to the MYNETS policy bank in the 50-user file, but they are still being blocked and generating a bounce email to root.

Thinking of creating a cron job to scan the database and remove the no-reply@localhost.local  address, but that's a kludge for sure.

-Steve

-----Notice eMail----------------------------------------------------
Content type: Spam
Internal reference code for the message is 3146491-20/sHkMD6bUMv_7

First upstream SMTP client IP address: [127.0.0.1]

Return-Path: <no-reply@localhost.local>
From: No Reply <no-reply@localhost.local>
Message-ID: <xxxxxx@xxxxxx.com>
Subject:
  =?utf-8?q?=5BAttention=5D_You_have_1_emails_quarantined_and_not_delivered_to_mailbox?=
The message has been quarantined as: sHkMD6bUMv_7

The message WAS NOT relayed to:
<yyyy@yyyyyy.com>:
   250 2.7.0 Ok, discarded, id=3146491-20 - spam

Spam scanner report:

----

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

2

Re: Notify users about quarantined mails when they blacklist no-reply

From reading the amavisd docs, it seems I have to force the address to use the MYNETS with the following code.

# Define the hash for bypassing specific senders
%noreply_bypass_maps = (
    'no-reply@localhost.local' => 'MYNETS',  #  assignment
);

$bypass_maps = [ 'HASH:noreply_bypass_maps' ]; # tell Amavisd to use this hash


Anyone who has more experience with Amavisd, feel free to chime in.

3

Re: Notify users about quarantined mails when they blacklist no-reply

Dug a little deeper into the 50-user config file.  Seems there is a FULL_WHITELIST policy bank.

I added

my %noreply_bypass_maps = (
    'no-reply@localhost.local' => 'FULL_WHITELIST',  # assignment
);

my $bypass_maps = [ 'HASH:noreply_bypass_maps' ]; # use it

Apparently I have to add "my" in front of the code to explicitly define it, or amavisd reload complained.

-Steve