1

Topic: Issue with releasing from amavisd-new quarantine

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

iRedAdmin Pro gives out a timeout when trying to release a message from quarantine. I have enabled the support for quarantine with these instructions: http://www.iredmail.org/wiki/index.php? … g.Messages

The instructions say that you can manually release the mail like this:

# telnet localhost 9998
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
request=release
mail_id=CynKoUgc0+Oz
secret_id=cKj-gQxqqJsN

This will give an error that the quarantine file does not exist. This works as it should instead:

# telnet localhost 9998
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
request=release
mail_id=CynKoUgc0+Oz
secret_id=cKj-gQxqqJsN
quar_type=Q

From what I see, it tries to release the mail from the local filesystem by default. If I understand right, quar_type=Q instructs it to release it from the database instead. Am I missing something from amavisd-new configuration to make this as the default?

It saves the mail correctly to the DB and can release the mail when you add that line to the connection. I think it may not be working from iRedAdmin if it behaves as with the instructions (not adding that one line to the end when releasing). iRedAdmin can delete the mails from DB without any problems, so it seems to be able to communicate with amavisd.

----

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

2

Re: Issue with releasing from amavisd-new quarantine

Did you follow this wiki tutorial? http://www.iredmail.org/wiki/index.php? … ining.SPAM
The link you pasted in post is for iRedMail-0.6.1 and older versions.

iRedAdmin-Pro can correctly release and delete quarantined mails.

3

Re: Issue with releasing from amavisd-new quarantine

Sorry about the confusion, yes, I used the link you posted. I used the other link I posted as help for debugging as it had more instructions on checking if you can manually release the mails.

However, I do have the configuration parts from both of these guides. They were already there, set up by the iRedMail installer - I have checked that they match with the documentation.

4

Re: Issue with releasing from amavisd-new quarantine

Could you please show me output of below commands?

# grep 'spam_quarantine' /etc/amavis/conf.d/50-user
# grep 'final_spam_destiny' /etc/amavis/conf.d/50-user

5 (edited by Unksi 2013-08-21 15:44:50)

Re: Issue with releasing from amavisd-new quarantine

It will give this output:

# grep 'spam_quarantine'

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

# grep 'final_spam_destiny'

$final_spam_destiny       = D_DISCARD;

And doing the same for our own custom config, which is loaded after 50-user file:

# grep 'spam_quarantine'

#$spam_quarantine_to = 'spam-quarantine';
#$spam_quarantine_method = 'sql:';
    spam_quarantine_method => 'sql:',

# grep 'final_spam_destiny'
$final_spam_destiny       = D_PASS;
    final_spam_destiny => 'D_DISCARD'

The system does not quarantine most of the spams, instead giving the user an option to choose what they do with it. The problematic mails in question are ones that contain banned attachments, however this issue also happens with a quarantined spam test message (I just verified this to be sure).

6

Re: Issue with releasing from amavisd-new quarantine

Obviously, you don't have correct settings of quarantining.

Unksi wrote:

# grep 'spam_quarantine'
#$spam_quarantine_to = 'spam-quarantine';
#$spam_quarantine_method = 'sql:';
#$spam_quarantine_method = undef;

You must uncomment first two lines, and leave the third line comment out:

$spam_quarantine_to = 'spam-quarantine';
$spam_quarantine_method = 'sql:';
#$spam_quarantine_method = undef;
Unksi wrote:

    spam_quarantine_method => 'sql:',

Missing '$' at the beginning.

Please follow out wiki tutorial strictly:
http://www.iredmail.org/wiki/index.php? … ining.SPAM

7

Re: Issue with releasing from amavisd-new quarantine

ZhangHuangbin wrote:

You must uncomment first two lines, and leave the third line comment out:

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

Changing this did not make a difference on its behaviour. These are not the kind of messages we want to quarantine here either, which is why it was not set on in the first place. Quarantining only virus and banned messages is desired. Still, after the first 2 lines are uncommented, it will time out on release.

ZhangHuangbin wrote:
Unksi wrote:

    spam_quarantine_method => 'sql:',

Missing '$' at the beginning.

It is missing $ from the beginning because it is inside a policy bank block, which requires a different syntax without preceeding $. Adding a $ there will make amavis refuse to startup.

8

Re: Issue with releasing from amavisd-new quarantine

Unksi wrote:

iRedAdmin Pro gives out a timeout when trying to release a message from quarantine.

Do you have correct quarantining related settings in iRedAdmin-Pro config file (settings.ini)?

[amavisd]
...

host =  127.0.0.1
port =  3306
db = amavisd
user = amavisd
passwd =  ...

quarantine = True
quarantine_port = 9998

9

Re: Issue with releasing from amavisd-new quarantine

ZhangHuangbin wrote:
Unksi wrote:

iRedAdmin Pro gives out a timeout when trying to release a message from quarantine.

Do you have correct quarantining related settings in iRedAdmin-Pro config file (settings.ini)?

Yes. If it helps, iRedAdmin can show quarantined messages and deletes them properly. This leads me to think that it works as it should, unless it removes them directly from the DB instead of via amavis on port 9998.

10

Re: Issue with releasing from amavisd-new quarantine

iRedAdmin-Pro deletes quarantined mails from DB directly, but release it via port 9998.

Do you have any files under /var/lib/amavis/ with file name starts with 'spam'?

11

Re: Issue with releasing from amavisd-new quarantine

ZhangHuangbin wrote:

iRedAdmin-Pro deletes quarantined mails from DB directly, but release it via port 9998.

Do you have any files under /var/lib/amavis/ with file name starts with 'spam'?

Ok. Nope. There is a folder called 'virusmails', though, which is where it would quarantine mails if it were to quarantine them to the disk.

12

Re: Issue with releasing from amavisd-new quarantine

It should work as expected if you have correct Amavisd related settings in iRedAdmin-Pro config file.
Still no idea yet, so sorry about this.