This example will copy emails to a secondary site and keep a copy at Fastmail. Note that you must include
copy in the
require declaration.
You must place the
redirect :copy statement in a location in your script where it captures the messages you want to redirect. So I would place it after any code which discards spam, but before filing code.
I have also included a test using the new
body search.
Code:
### Forwarding example using new copy feature
require ["envelope", "fileinto", "reject", "notify", "vacation",
"regex","relational","comparator-i;ascii-numeric","body","copy"];
redirect :copy "jcitizen@gmail.com";
if body :text :contains "testing"
{ fileinto "INBOX.Junk Mail"; stop; }