diff --git a/scripts/CreateRoutes.py b/scripts/CreateRoutes.py index ae98e59..fbb9620 100755 --- a/scripts/CreateRoutes.py +++ b/scripts/CreateRoutes.py @@ -8,15 +8,17 @@ f = open('rules.yaml') EXE = open('ModifyRules.sh','w') dohicky = yaml.safe_load(f) EXE.writelines("#!/bin/bash\n") -for i in dohicky: - CHAINE=HEADER+"/"+i['id']+ "\" -F priority="+str(i['priority']) - if len(i['description'])>0: - CHAINE=CHAINE+ " -F description='"+str(i['description'])+"'" - CHAINE=CHAINE+ " -F expression='"+str(i['expression'])+"'" - for j in i['actions']: - CHAINE=CHAINE+ " -F action='"+str(j)+"'" - #print(CHAINE) - EXE.writelines(CHAINE+"\n") +for priorite in range(0,10): + for i in dohicky: + if i['priority']==priorite: + CHAINE=HEADER+"/"+i['id']+ "\" -F priority="+str(i['priority']) + if len(i['description'])>0: + CHAINE=CHAINE+ " -F description='"+str(i['description'])+"'" + CHAINE=CHAINE+ " -F expression='"+str(i['expression'])+"'" + for j in i['actions']: + CHAINE=CHAINE+ " -F action='"+str(j)+"'" + #print(CHAINE) + EXE.writelines(CHAINE+"\n") f.close() EXE.close() \ No newline at end of file diff --git a/scripts/rules.yaml b/scripts/rules.yaml index 2e228b5..b550c33 100644 --- a/scripts/rules.yaml +++ b/scripts/rules.yaml @@ -1,4 +1,11 @@ --- +- id: 5c726b408ecd870001264739 + actions: + - forward("gwladys.clement@gmail.com") + - stop() + description: Tout pour Gwladys sur eu + expression: match_recipient("gwladys.*@mg.*.eu") + priority: 0 - id: 5ce42a14bf802e0001684668 actions: - forward("gwladys.clement@gmail.com") @@ -6,6 +13,13 @@ description: Tout pour Gwladys sur space expression: match_recipient("gwladys.*@mg.*.space") priority: 0 +- id: 5c726b19bf802e000162d921 + actions: + - forward("ophelie.clement@gmail.com") + - stop() + description: Tout pour Ophelie sur eu + expression: match_recipient("ophelie.*@mg.*.eu") + priority: 0 - id: 5c726e2f8b3cd70001237ee5 actions: - forward("ophelie.clement@gmail.com") @@ -13,13 +27,41 @@ description: Tout pour Ophelie sur space expression: match_recipient("ophelie.*@mg.*.space") priority: 0 +- id: 5c726e7e8ecd870001264998 + actions: + - forward("aristide1clement@gmail.com") + - stop() + description: Tout pour Aristide sur space + expression: match_recipient("aristide.*@mg.*.space") + priority: 0 +- id: 5baf5ac78b3cd70001ebae82 + actions: + - forward("aristide1clement@gmail.com") + - stop() + description: Tout pour Aristide sur eu + expression: match_recipient("aristide.*@mg.*.eu") + priority: 0 - id: 5cd48c308b3cd70001f79bfb actions: - - forward("nadinepub.clement@free.fr") + - forward("nadineclement@mail.fr") - stop() description: EU domains for Nadine expression: match_recipient("nadine.*@mg.*.eu") priority: 0 +- id: 5baa01368ecd8700013c5010 + actions: + - forward("nadineclement@mail.fr") + - stop() + description: Tout ce qui arrive sur le domaine pour mg.nadineclement.eu + expression: match_recipient(".*@mg.nadineclement.eu") + priority: 2 +- id: 5ce18c92629574000195c8de + actions: + - forward("nadineclement@mail.fr") + - stop() + description: Tout ce qui arrive sur le domaine pour mg.iade-lyon.eu + expression: match_recipient(".*@mg.iade-lyon.eu") + priority: 2 - id: 5cd48b47a4764a00013cee72 actions: - forward("iwan.clement@gmx.fr") @@ -29,18 +71,11 @@ priority: 0 - id: 5db1e61d11c830a64e8e2dba actions: - - forward("iwan.clement@mail.fr") + - forward("iwan.pubclement@mail.fr") - stop() description: iwanpub@mg.*.eu expression: match_recipient("iwanpub.*@mg.*.eu") priority: 1 -- id: 5ce18c92629574000195c8de - actions: - - forward("nadineclement@mail.fr") - - stop() - description: Tout ce qui arrive sur le domaine pour mg.iade-lyon.eu - expression: match_recipient(".*@mg.iade-lyon.eu") - priority: 2 - id: 5ca2330d6295740001322814 actions: - forward("iwan.pubclement@mail.fr, nadineclement@mail.fr") @@ -55,13 +90,6 @@ description: Iwan Professionnel expression: match_recipient("iwanpro.*@mg.*.space") priority: 2 -- id: 5baa01368ecd8700013c5010 - actions: - - forward("nadineclement@mail.fr") - - stop() - description: Tout pour Nadine Clement - expression: match_recipient(".*@mg.nadineclement.eu") - priority: 2 - id: 5b6d4d826295740001913849 actions: - forward("aristide1clement@gmail.com,iwan.clement@free.fr") @@ -139,27 +167,6 @@ description: Pour Piwigo expression: match_recipient("iwanadm@free.fr") priority: 5 -- id: 5c726e7e8ecd870001264998 - actions: - - forward("aristide1clement@gmail.com") - - stop() - description: '' - expression: match_recipient("aristide.*@mg.*.space") - priority: 6 -- id: 5c726b408ecd870001264739 - actions: - - forward("gwladys.clement@gmail.com") - - stop() - description: Gwladys.qqc - expression: match_recipient("gwladys.*@mg.*.space") - priority: 6 -- id: 5c726b19bf802e000162d921 - actions: - - forward("ophelie.clement@gmail.com") - - stop() - description: Tout Ophelie.qqc - expression: match_recipient("ophelie.*@mg.*.space") - priority: 6 - id: 5c419a518b3cd70001c5ddea actions: - forward("iwan.clement@gmx.fr") @@ -188,13 +195,6 @@ description: Bruno Joachim expression: match_recipient("bruno.*@mg.*.space") priority: 8 -- id: 5baf5ac78b3cd70001ebae82 - actions: - - forward("stephane.guillot_32@kindle.com") - - stop() - description: Kindle de Stephane - expression: match_recipient("kindle.stephane@mg.*.space") - priority: 8 - id: 5b6cbd328b3cd70001eb4eb2 actions: - forward("iwan.pubclement@mail.fr")