On 21 Feb 2012, at 11:06, Tanstaafl wrote:
> On 2012-02-19 3:19 PM, Tanstaafl <tan...@li...> wrote:
>> Here is another example of one I just saw go out (was watching the logs
>> for something else):
>
> This is the line that I want to test for:
>
>> Feb 19 15:03:26 myhost postfix/qmgr[11885]: CCD158B3D5B:
>> from=<m-g...@bo...>,
>> size=6660, nrcpt=2 (queue active)
>
No… the filter script is operating on the contents of the email - not the postfix mail log.
I'd suggest you open the linked in email, and view it's source - that's what the filter script runs on.
You could probably just do a regexp on e.g.
elsif(/^X-LinkedIn-/) {
$logger->debug("linked in spam stuff");
exit(0);
}
Considering a random email I have here from LinkedIn contains :
Subject: Add skills and expertise like …….
X-LinkedIn-Template: suggested_skills
X-LinkedIn-Class: TIK
X-LinkedIn-fbl: m-vwEVIlxpMe6S2lEblahblahblahblahblahblahblahblahaU4gyFze1CwQBhcj4Nq_
From: LinkedIn <mes...@li...>
Sender: mes...@bo...
If you want to do a match on from, then :
elsif(/^from:\sLinkedIn.*messages-noreply\@linkedin.com.*/i) {
….
}
would probably work (I've not tested this); the X-LinkedIn looks easiest to me :) as the from variant is longer.
thanks,
David.
|