On Thu, 16 May 2019 13:31:27 +0000 (UTC) Pedro David Marco wrote: > Hi! > I have a Recived like this: > > Received: from pafkiet.edu.pk (email.pafkiet.edu.pk [203.170.75.90]) > by .... > > > I want a rule to match the beginning of a Received: > A rule like this works ok: > > header MY_RULE Received =~ /.*from pafkiet.edu.pk/ > > and in debug mode it shows: > MY_RULE ======> got hit: "from pafkiet.edu.pk" > > BUT if i add the ^ anchor to the rule then it does not work... > header MY_RULE Received =~ /^from pafkiet.edu.pk/ > > Why???
Because you missed out the /m modifier. Without it your rule can only match the top received header. So header MY_RULE Received =~ /^from pafkiet.edu.pk/m