View Single Post
Old 15 Jul 2017, 08:17 AM   #6
camner
Cornerstone of the Community
 
Join Date: Jul 2002
Location: Tacoma, WA
Posts: 642
Quote:
Originally Posted by n5bb View Post
With regards to the To header, this depends on what you munged in the headers you posted. There are addresses in the To header, and I'm not sure if one is yours. There are usually three ways someone can send an email which is delivered to your account:
  • To header
  • Cc header
  • Bcc, which forces blind sending so does not place your address in the normal headers. If you receive a message, your email address will always be in the "envelope" To, which is just what the sending server tells the FastMail receiving server is the destination during the initial SMTP connection protocol. The envelope is normally hidden, but FastMail copies the envelope To into the X-Delivered-to normal header.
So you can see that custom sieve looking at the To header only discovers one out of the three delivery methods shown above. The normal rules are much easier to use, since the "Any recipient's email" condition catches all of the cases described above.

If you use a wildcard alias for your domain, a better way to block certain specific addresses is to make aliases for these addresses which are set to Reject all mail sent to this address. This causes that address to not exist at the SMTP receiving stage.

Bill
Thanks for the reply.

I didn't munge any of the "To:" addresses because none of the ones listed are mine.

My Sieve code only looks at "From" and "To", so I think the next step will be to add "X-Delivered-to" to the list of headers to check. If I understand you correctly, if, for example, someone sends me an email with the email address <me@mydomain.com> in the BCC field, this email address won't show up in to "To" header but will be in the envelope header and will therefore be copied to the "X-Delivered-to" header. Do I understand this correctly?

If I understand this correctly, can I just use the "X-Delivered-to" header and skip the checking of the "To" header?
camner is offline   Reply With Quote