1

Topic: Quarantine and whitelisting a recipient

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  postgreSQL
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: Ubuntu 14.04.2 LTS
- Related log if you're reporting an issue:
====

Hi,

I'd like to understand how the quarantine mechanism works in iRedmail.

I have a particular recipient that receives automated email from remote devices (printers). Some headers are incorrect and thus those emails are detected as SPAM.

In order to bypass spam detection for the user reports@mydomain.com, I tried the following settings in /etc/amavis/conf.d

```
@bad_header_lovers_maps = ( ['reports@mydomain.com'], );
@spam_lovers_maps = @bad_header_lovers_maps;
@bypass_header_checks_maps = @bad_header_lovers_maps;
@bypass_banned_checks_maps = @bad_header_lovers_maps;
```

However spam detection still occurs and valid email gets marked as SPAM. Do you have another suggested setting I could try?

Also some emails are not delivered to the mailbox, although I can clearly see in the logs the email in question "got through" amavis:

```
mail amavis[2234]: (02234-06) Passed CLEAN {RelayedInternal}, MYUSERS LOCAL ...
```

I noticed the following in psql:

```psql
postgres=# \c amavisd
You are now connected to database "amavisd" as user "postgres".

amavisd=# SELECT COUNT(*) FROM maddr;
count
-------
   200
(1 row)

amavisd=# SELECT COUNT(*) FROM msgrcpt;
count
-------
  7719
(1 row)

amavisd=# SELECT COUNT(*) FROM msgs;
count
-------
  7720
(1 row)

amavisd=# SELECT COUNT(*) FROM quarantine;                                                                                                                                                   
count
-------
     0 

```

I am not sure I understand the responsibilities of each table. Do you have a document explaining this.

Also how may I (manually) release a supposedly quarantined email, so that it gets delivered in the appropriate mailbox.

Thanks for your help.

----

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

2

Re: Quarantine and whitelisting a recipient

Dear bthomas,

It's easy to whitelist a sender (the sender address used in the printer, in your case) and manage (release or delete) quarantined emails with our iRedAdmin-Pro, screenshot attached for your reference.

If you don't have iRedAdmin-Pro, it's ok. Let me explain it below:

*) if you want to quarantine spam/virus/bad header/banned emails to SQL database, please follow our tutorial here:
http://www.iredmail.org/docs/quarantining.html

If you just set '$final_xxx_destiny = D_DISCARD;' without '$spam_quarantine_to =' and '$spam_quarantine_method', emails will be discard, or, depends on your setting, quarantined on file system.

If emails were quarantined on file system, you can find it under Amavisd quarantine directory (/var/lib/amavis on Ubuntu). To remove it, you can simply delete the file with 'rm'. To release it to user's mailbox, please follow Amavisd document here:
http://www.ijs.si/software/amavisd/README.protocol.txt (Read section "Releasing a message from a quarantine")

*) To whitelist a sender (for bad-header) in Amavisd, you can add '@bad_header_lovers_maps' in amavisd config file (/etc/amavis/conf.d/50-user on Debian/Ubuntu), if it doesn't work, here's another way:

1) enable per-recipient policy lookup first:
http://www.iredmail.org/docs/amavisd.pe … ookup.html

2) Then add required wblist records as described in Amavisd document:
http://www.ijs.si/software/amavisd/README.sql-mysql.txt

In iRedMail, we provide a iRedAPD plugin 'amavisd_wblist' to query wblist from Amavisd database, and reject or bypass senders listed in wblist during smtp session. If you don't enable this plugin, Amavisd will quarantine or bypass this sender after-queue.


http://iredmail.org/images/iredadmin/system_maillog_quarantined.png

http://iredmail.org/images/iredadmin/system_maillog_quarantined_expanded.png

3

Re: Quarantine and whitelisting a recipient

Thanks for your feedback ZhangHuangbin!

I'm going to try the suggested "per-recipient policy lookup"