Your script is using a bad/missing header to send email and amavis tagged it as quarantine . It passes CLEAN because in your spam filter policy is defined so (check your policy). After the email is tagged an email is send to the quarantine admin (with information about the bad headers).
- Google the problem with de bad headers (you will find tons of info)
- If you want, you can tunning your amavis setting.