On Mon, 21 Nov 2011, Bowie Bailey wrote:

On 11/20/2011 10:02 PM, Sergio wrote:

header   __ENV_FROM_DHL    Received =~ /envelope-from [^ @]+@dhl[^
.]+\.com/i
header   __FROM_DHL        From =~ /\bdhl[^ .]+\.com/i

These will match any domain that starts with "dh" and ends with ".com".

You overlooked the "l".

For example, they will match "someu...@dhalailama.com".  Is this
expected?

It won't.

If you just want to match a single character, then get rid of
the +.

It's to match "-usa" or other dhl domain name variants. The line wrap in email makes that look like a single character RE. The actual RE I suggested is:

  /envelope-from [^ @]+@dhl[^ .]+\.com/i

It also won't match "dhl.com". My bad. As I said, it was off the top of my head.

These might be better:

  /envelope-from [^ @]+@dhl(?:[-_][^ .]+)?\.com/i

  /\bdhl(?:[-_][^ .]+)?\.com/i

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 jhar...@impsec.org    FALaholic #11174     pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  Mine eyes have seen the horror of the voting of the horde;
  They've looted the fromagerie where guv'ment cheese is stored;
  If war's not won before the break they grow so quickly bored;
  Their vote counts as much as yours.                          -- Tam
-----------------------------------------------------------------------
 348 days since the first successful private orbital launch (SpaceX)

Reply via email to