1

Topic: Quarantined Mails

==== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Linux/BSD distribution name and version: Debian 7
- Related log if you're reporting an issue:
====

Not sure if this is a silly question or not but I literally NEVER have anything in Quarantined Mails. I know mails are being blocked but when I look in my iredadmin (pro 1.4.1) there is never anything being displayed.

Can I somehow test if my amavis is actually catching viruses / spam?

Thanks

----

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

2

Re: Quarantined Mails

Did you follow this tutorial to enable SQL integration in Amavisd?

- Quarantining SPAMs and manage them with iRedAdmin-Pro
http://www.iredmail.org/wiki/index.php? … dAdmin-Pro

3

Re: Quarantined Mails

I had done everything except this bit

# Change below two settings to D_DISCARD.
$final_spam_destiny = D_DISCARD;
$final_banned_destiny = D_DISCARD;

would that have made a big difference?

4

Re: Quarantined Mails

If you didn't set $final_spam_destiny and $final_banned_destiny to D_DISCARD, spam and banned emails will be delivered to user mailbox directly. And if you have below settings also, spam and banned emails will be saved in SQL database too:

$spam_quarantine_to = 'spam-quarantine';
$spam_quarantine_method = 'sql:';

$banned_quarantine_to = 'banned-quarantine';
$banned_files_quarantine_method = 'sql:';

5

Re: Quarantined Mails

I have made the changes, is there any way to test?

Thanks

6

Re: Quarantined Mails

Package spamassassin ships a sample spam text, you can send a new email with this sample spam text as mail body. Then it should be quarantined into SQL database.

# dpkg -L spamassassin |grep 'sample'

7

Re: Quarantined Mails

Hi

I tested and get the following in my mail.log

root@XXX:~# cat /var/log/mail.log | grep XYZ
Jan 22 09:28:44 bushveld cbpolicyd[3220]: module=Greylisting, action=defer, host=209.85.160.41, helo=mail-pb0-f41.google.com, from=XYZ, to=ABC, reason=greylisted
Jan 22 09:28:44 bushveld postfix/smtpd[32725]: NOQUEUE: reject: RCPT from mail-pb0-f41.google.com[209.85.160.41]: 451 4.7.1 <ABC>: Recipient address rejected: Greylisting in effect, please come back later; from=<XYZ> to=<ABC> proto=ESMTP helo=<mail-pb0-f41.google.com>
Jan 22 09:34:42 bushveld cbpolicyd[27895]: module=Greylisting, action=pass, host=209.85.160.52, helo=mail-pb0-f52.google.com, from=XYZ, to=ABC, reason=authenticated
Jan 22 09:34:43 bushveld postfix/qmgr[5473]: 8BFB512A68: from=<XYZ>, size=3416, nrcpt=1 (queue active)
Jan 22 09:34:49 bushveld amavis[32075]: (32075-04) Blocked SPAM {DiscardedInternal}, LOCAL [209.85.160.52]:41242 [209.85.160.52] <XYZ> -> <ABC>, Queue-ID: 8BFB512A68, Message-ID: <CAGZ8q8yw7YXCPV8qXyNTH2nhgs42qi=-EP_Ve6NgXecu9opqMQ@mail.gmail.com>, mail_id: Y3SEeLGlO9es, Hits: 899.201, size: 3416, dkim_sd=20120113:gmail.com, 5575 ms


The spam is being blocked but there is still absolutely nothing in my quarantined queue in iRedAdmin-Pro!

please assist!

8

Re: Quarantined Mails

*) Any SQL record in table "amavisd.quarantine"?
*) Do you have Amavisd integration in iRedAdmin-Pro? Config file (amavisd integration part) should looks like this:

amavisd_enable_logging = True

amavisd_db_host = '127.0.0.1'
amavisd_db_port = 3306
amavisd_db_name = 'amavisd'
amavisd_db_user = 'amavisd'
amavisd_db_password = 'password'

# #### Quarantining ####
# Release quarantined SPAM/Virus mails: True, False.
# iRedAdmin-Pro will connect to @quarantine_server to release quarantined mails.
# How to enable quarantining in Amavisd-new:
# http://www.iredmail.org/wiki/index.php?title=IRedMail/FAQ/Quarantining.SPAM
amavisd_enable_quarantine = True

# Port of Amavisd protocol 'AM.PDP-INET'. Default is 9998.
amavisd_quarantine_port = 9998

9

Re: Quarantined Mails

root@bushveld:/usr/share/apache2/iredadmin# cat settings.py | grep amavis
# It's @storage_sql_dsn setting in amavisd. You can find this setting
# in amavisd-new config files:
#   - On RHEL/CentOS:   /etc/amavisd.conf or /etc/amavisd/amavisd.conf
#   - On Debian/Ubuntu: /etc/amavis/conf.d/50-user.conf
#   - On FreeBSD:       /usr/local/etc/amavisd.conf
amavisd_enable_logging = True
amavisd_db_host = '127.0.0.1'
amavisd_db_port = 5432
amavisd_db_name = 'amavisd'
amavisd_db_user = 'amavisd'
amavisd_db_password = 'XXXXX'
amavisd_enable_quarantine = True
amavisd_quarantine_port = 9998

I did check these and it all seems right

my port is different though but this is the same port everything else is on, and the same port from the old config file.

if I check amavisd.quarentine via phppgadmin there is no data at all!

10

Re: Quarantined Mails

Port 5432 is PostgreSQL service, 3306 is MySQL. Your setting is just fine.

Could you please show me output of below commands?

# cd /etc/amavis/conf.d/
# grep 'spam_quarantine_' 50-user
# grep 'final_spam_destiny' 50-user
# grep '@storage_sql_dsn' 50-user

11

Re: Quarantined Mails

root@bushveld:/etc/amavis/conf.d# grep 'spam_quarantine_' 50-user
$spam_quarantine_to = 'spam-quarantine';
$spam_quarantine_method = 'sql:';
$spam_quarantine_method = undef;
root@bushveld:/etc/amavis/conf.d# grep 'final_spam_destiny' 50-user
$final_spam_destiny       = D_DISCARD;
root@bushveld:/etc/amavis/conf.d# grep '@storage_sql_dsn' 50-user
#   - 'sql:', quarantine mail in SQL server specified in @storage_sql_dsn.
@storage_sql_dsn = (
#@lookup_sql_dsn = @storage_sql_dsn;
root@bushveld:/etc/amavis/conf.d#

12

Re: Quarantined Mails

Please comment out this line:

$spam_quarantine_method = undef;

it overrides "$spam_quarantine_method = 'sql';".
Restarting Amavisd service is required. Then please try again.

13

Re: Quarantined Mails

Ah! Working!
Thanks so much!