gary417

Q: mail: Can I filter by partial IP address?

Even after many years of marking junk emails as spam, a few are still getting through to my inbox. Tracking them, I see that a percentage of them repeatedly come from particular ISPs (i.e., the same leading 2 or 3 groups of numbers in the IP address).  Is there a way to filter by the leading part of an IP address?  (Wouldn't it be great if we could?)

Posted on Oct 17, 2016 2:24 PM

Close

Q: mail: Can I filter by partial IP address?

  • All replies
  • Helpful answers

  • by Eric Root,

    Eric Root Eric Root Oct 17, 2016 5:44 PM in response to gary417
    Level 9 (74,064 points)
    iTunes
    Oct 17, 2016 5:44 PM in response to gary417

    Try a rule in Mail/Preferences/Rules. Sample below.

     

    Rule - Block Hansen.png

     

    Screen Shot 2016-10-17 at 8.43.46 PM.png

  • by gary417,

    gary417 gary417 Oct 18, 2016 8:49 AM in response to Eric Root
    Level 1 (4 points)
    Mac OS X
    Oct 18, 2016 8:49 AM in response to Eric Root

    One extra step required:  The condition 'From' does not pick up the IP address, just the emailer's name (always spoofed with spam of course) and the default conditions offered do not include ones from the full header.  But, if you look at the bottom of the conditions list, you can 'Edit header list'.  I added 'Received' to the header list. So:  'Received' 'contains' '(part of IP address)' works!