Send a test mail with virus attached
We use EICAR test file.
Download EICAR file locally.
wget https://secure.eicar.org/eicar.com.txt
For command-line sending, you will need mutt package (mail doesn’t support sending attachment)
apt-get install mutt -y
Send a test test mail with EICAR file (virus) attached
echo "Test virus body" | mutt -a eicar.com.txt -s "This is virus" -- admin@example.com
Log Monitor
When your server receives a spam mail, you can see in postfix’s mail.log
a lines like:
Oct 12 11:00:25 test amavis[1576510]: (1576510-03) Blocked INFECTED (Eicar-Test-Signature), [192.241.254.103] [192.241.254.103] <root@test.rtcamp.com> -> <admin@example.com>, quarantine: S/virus-SA93AIGegqCY, Message-ID: <20131012145923.GA29765@example.com>, mail_id: SA93AIGegqCY, Hits: -, size: 976, 57 ms
There are online sites which can also email you EICAR files.
Debugging amavis
If results are not as per expectation, you can start amavis in debug mode using following commands:
service amavis stop amavisd-new debug