Here is an example of how I have configured sieve to forward any mail sent to [nameA|nameB|nameC]@example.org
to my private email address.
if address :localpart :is ["To","Cc","Bcc"]
["nameA", "nameB", "nameC"] {
redirect "<my private email address>";
stop;
}
Sometimes though, email is not forwarded because the address that it was sent to is tucked away somewhere in a "Received" header.
Received: from ###server### ([###ip_address###])
by ###server### with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256)
(Exim 4.84)
(envelope-from <###email_address###>)
id 1alDM0-0000yT-60
for [email protected]; Wed, 30 Mar 2016 12:28:00 +0200
Is there an effective way to catch these emails in the sieve rule, too?
Received:
headers will contain the destination address, either; the only place this information is unambiguously exposed is in the SMTP envelope, which is typically discarded. If you can configure your mail server to always copy the SMTP envelope recipient to a particular header, you won't need this; but then, perhaps you would not need Sieve at all. – Bollworm