Created
September 9, 2021 03:37
-
-
Save TheLonelyGhost/cdf9482d5f405ddb43bb7b9edf51fa4c to your computer and use it in GitHub Desktop.
Compose valid Seive code (Fastmail filters) for recruiter spam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
import json | |
def is_wildcard(email) -> bool: | |
return bool('*' in email) | |
def main(): | |
wildcards: List[str] = [] | |
explicit: List[str] = [] | |
with open('./recruiters.deduped.txt', 'r') as f: | |
for _, email in enumerate(f): | |
email = email.rstrip() | |
if not email: | |
continue | |
if is_wildcard(email): | |
wildcards.append(email) | |
else: | |
explicit.append(email) | |
if len(wildcards + explicit) == 0: | |
return | |
conditions = 'anyof(\n address :matches "From" {wildcards},\n address :is "From" {explicit})'.format(wildcards=json.dumps(wildcards), explicit=json.dumps(explicit)) | |
action = r"""{ | |
addflag "\\Seen"; | |
fileinto "INBOX.Recruiters"; | |
removeflag "\\Seen"; | |
} | |
""" | |
print('if {cond} {action}'.format(cond=conditions, action=action)) | |
if __name__ == '__main__': | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*@3ipeople.com | |
*@abacusservice.com | |
*@adventglobal.com | |
*@akraya.com | |
*@amigainformatics.com | |
*@amzur.com | |
*@anteogroup.com | |
*@apexsystems.com | |
*@apexsystemsinc.com | |
*@apnconsultinginc.com | |
*@appliedrg.com | |
*@aquesst.com | |
*@arminus.co | |
*@arminus.us | |
*@askstaffing.com | |
*@atlanticpartnerscorp.com | |
*@axelon.com | |
*@best-infosystems.com | |
*@careerbuilder.com | |
*@charterglobal.com | |
*@choicetechgroup.com | |
*@compnova.com | |
*@crystalequation.com | |
*@cybercoders.com | |
*@diversant.com | |
*@diverselynx.com | |
*@dtglobalstaffing.com | |
*@ehire.com | |
*@elev8staffing.com | |
*@empowerprofessionals.com | |
*@first-tek.com | |
*@gdhconsulting.com | |
*@genesis10.com | |
*@genuent.com | |
*@globalsyst.com | |
*@gttit.com | |
*@hackerxevents.com | |
*@hiredynamics.com | |
*@htrjobs.com | |
*@humanmicrosystemsinc.com | |
*@idctechnologies.com | |
*@idexcel.com | |
*@iic.com | |
*@indeed.com | |
*@infobahnsw.com | |
*@insightglobal.net | |
*@irishrecruiter.com | |
*@itmmi.com | |
*@itstaffinc.com | |
*@ittblazers.com | |
*@jdc-group.com | |
*@johnsonjobs.com | |
*@kimblegroup.com | |
*@kinetixhr.com | |
*@kochdavis.com | |
*@lancesoft.com | |
*@lincolnaim.com | |
*@lorventech.com | |
*@mastech.com | |
*@mastechdigital.com | |
*@matrixonweb.com | |
*@mavenalpha.com | |
*@meridiantechnologies.net | |
*@mondo.com | |
*@nescoresource.com | |
*@netmatrixsolutions.com | |
*@nutechsoft.com | |
*@nypunya.com | |
*@openviewpartners.com | |
*@panzersols.com | |
*@panzersolutions.com | |
*@paramountsoft.net | |
*@paretosg.com | |
*@pega.com | |
*@phisearch.com | |
*@placingit.com | |
*@prestigestaffing.com | |
*@principlesolutions.com | |
*@prutech.com | |
*@pyramidci.com | |
*@qgsearch.com | |
*@quantitativesystems.com | |
*@randstadusa.com | |
*@realsoftinc.com | |
*@relus.com | |
*@rht.com | |
*@roberthalf.com | |
*@roseit.com | |
*@route.monster.com | |
*@sgainc.com | |
*@simplion.com | |
*@smart-tek.net | |
*@softpath.net | |
*@spectraforce.com | |
*@stoneresource.net | |
*@strivector.com | |
*@suntechnologies.com | |
*@synergygbl.com | |
*@systelcomputers.com | |
*@systelinc.com | |
*@talenthound.us | |
*@tcml.com | |
*@theintersectgroup.com | |
*@themavengroup.com | |
*@thompsontalent.com | |
*@usgrpinc.com | |
*@ustechsolutionsinc.com | |
*@velossent.com | |
*@vereduscorp.com | |
*@veteranssourcinggroup.com | |
*@vui-inc.com | |
*@vui-inc.us | |
*@xduce.com | |
*@zolon.com | |
jobs-listings@linkedin.com | |
pridemorechristin@usa.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment