Sending malicious email as a test

Orphans asked:

I have set up a working SMTP relay together with MailScanner.
This SMTP relay is not — and will not be — able to relay email from the outside, only local email.

Is it possible to send a malicious email with the terminal? I have googled around but could not find anything that could answer my question.
For example, I want to use:

echo "{malicious-string}" | mail name@email.com

What could the "{malicious-string}" be?

My answer:


To be sure, you should use the EICAR test virus, and attach it to the email, rather than simply putting it in the body.

echo -n 'X5O!P%@AP[4PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > ducklin.docx
echo "Here is 10 million dollars" | mailx -a ducklin.docx user@example.com

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.