RFC 3028 which defined SIEVE has the following (section 5.1):
--------------------------------------------------------------------------
"5.1. Test address
Syntax: address [ADDRESS-PART] [COMPARATOR] [MATCH-TYPE]
<header-list: string-list> <key-list: string-list>
The address test matches Internet addresses in structured headers
that contain addresses. It returns true if any header contains any
key in the specified part of the address, as modified by the
comparator and the match keyword.
....
Implementations MUST restrict the address test to headers that
contain addresses, but MUST include at least From, To, Cc, Bcc,
Sender, Resent-From, Resent-To, and SHOULD include any other header
that utilizes an "address-list" structured header body.
--------------------------------------------------------------------------
I didn't have the time, but we can check any of the implementations
listed on http://www.cyrusoft.com/sieve/ to see the exact way they do it.
I wound guess that they following a similar algorithm.