Filter for Envelope-To or Delivered-To:

Will Yardley mutt-users at veggiechinese.net
Sun Sep 7 21:58:20 UTC 2025


On Sun, Sep 07, 2025 at 04:48:16PM -0500, Tim Chase wrote:
> Is there a proper way to create a filter that would catch an address if
> it was in the To:, CC:, BCC:, Envelope-To or Delivered-To: header?
> 
> I see that ~h can be used for matching *any* header, but I was hoping
> for recipient-y headers only.

It would be cool if there was a builtin filter that matched that; absent
that, though, you an use regex within the filter to do that, e.g.,


~h "^(Envelope|X-Original|Delivered)-To: foo at example\.org"

You won't be able to filter on BCC directly, so whether you can infer it
via X-Original-To or similar depends on your MTA's configuration.

HTH.

/w



More information about the Mutt-users mailing list