Redelivering mails from the Amavis quarantine

Problem:

An e-mail has been filtered by Amavis and not delivered to the recipient.

A corresponding notification mail is sent to the postmaster and the recipient containing the following relevant information:

Betreff: VIRUS (Eicar-Test-Signature) in mail FROM [0.1.2.3] petersen@univention.de bzw.
Betreff: VIRUS (Eicar-Test-Signature) in mail TO YOU from petersen@univention.de

A virus was found: Eicar-Test-Signature
Scanner detecting a virus: Clam Antivirus-clamd
Content type: Virus
...
The message has been quarantined as: L/virus-L+qGRZNCxJKd 

The original e-mail is not delivered to the recipient, but added to the Amavis quarantine queue.

Solution:

These e-mails can be redelivered from the quarantine if required. This can be done with the tool amavisd-release:

amavisd-release L/virus-L+qGRZNCxJKd

Alternatively, the e-mail can also be sent to another user, e.g.

amavisd-release L/virus-L+qGRZNCxJKd admin@example.com

The quarantine is not emptied automatically in the standard configuration. A cron job with the following command can be used to delete the mails in the quarantine after one month, for example:

find /var/lib/amavis/virusmails/ -type f -mtime +31 -delete
Mastodon