This commit is contained in:
Iwan Clement
2020-06-13 17:20:54 +02:00
parent 89ecf0ff97
commit f2de90c577
2 changed files with 55 additions and 53 deletions

View File

@@ -8,15 +8,17 @@ f = open('rules.yaml')
EXE = open('ModifyRules.sh','w') EXE = open('ModifyRules.sh','w')
dohicky = yaml.safe_load(f) dohicky = yaml.safe_load(f)
EXE.writelines("#!/bin/bash\n") EXE.writelines("#!/bin/bash\n")
for i in dohicky: for priorite in range(0,10):
CHAINE=HEADER+"/"+i['id']+ "\" -F priority="+str(i['priority']) for i in dohicky:
if len(i['description'])>0: if i['priority']==priorite:
CHAINE=CHAINE+ " -F description='"+str(i['description'])+"'" CHAINE=HEADER+"/"+i['id']+ "\" -F priority="+str(i['priority'])
CHAINE=CHAINE+ " -F expression='"+str(i['expression'])+"'" if len(i['description'])>0:
for j in i['actions']: CHAINE=CHAINE+ " -F description='"+str(i['description'])+"'"
CHAINE=CHAINE+ " -F action='"+str(j)+"'" CHAINE=CHAINE+ " -F expression='"+str(i['expression'])+"'"
#print(CHAINE) for j in i['actions']:
EXE.writelines(CHAINE+"\n") CHAINE=CHAINE+ " -F action='"+str(j)+"'"
#print(CHAINE)
EXE.writelines(CHAINE+"\n")
f.close() f.close()
EXE.close() EXE.close()

View File

@@ -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 - id: 5ce42a14bf802e0001684668
actions: actions:
- forward("gwladys.clement@gmail.com") - forward("gwladys.clement@gmail.com")
@@ -6,6 +13,13 @@
description: Tout pour Gwladys sur space description: Tout pour Gwladys sur space
expression: match_recipient("gwladys.*@mg.*.space") expression: match_recipient("gwladys.*@mg.*.space")
priority: 0 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 - id: 5c726e2f8b3cd70001237ee5
actions: actions:
- forward("ophelie.clement@gmail.com") - forward("ophelie.clement@gmail.com")
@@ -13,13 +27,41 @@
description: Tout pour Ophelie sur space description: Tout pour Ophelie sur space
expression: match_recipient("ophelie.*@mg.*.space") expression: match_recipient("ophelie.*@mg.*.space")
priority: 0 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 - id: 5cd48c308b3cd70001f79bfb
actions: actions:
- forward("nadinepub.clement@free.fr") - forward("nadineclement@mail.fr")
- stop() - stop()
description: EU domains for Nadine description: EU domains for Nadine
expression: match_recipient("nadine.*@mg.*.eu") expression: match_recipient("nadine.*@mg.*.eu")
priority: 0 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 - id: 5cd48b47a4764a00013cee72
actions: actions:
- forward("iwan.clement@gmx.fr") - forward("iwan.clement@gmx.fr")
@@ -29,18 +71,11 @@
priority: 0 priority: 0
- id: 5db1e61d11c830a64e8e2dba - id: 5db1e61d11c830a64e8e2dba
actions: actions:
- forward("iwan.clement@mail.fr") - forward("iwan.pubclement@mail.fr")
- stop() - stop()
description: iwanpub@mg.*.eu description: iwanpub@mg.*.eu
expression: match_recipient("iwanpub.*@mg.*.eu") expression: match_recipient("iwanpub.*@mg.*.eu")
priority: 1 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 - id: 5ca2330d6295740001322814
actions: actions:
- forward("iwan.pubclement@mail.fr, nadineclement@mail.fr") - forward("iwan.pubclement@mail.fr, nadineclement@mail.fr")
@@ -55,13 +90,6 @@
description: Iwan Professionnel description: Iwan Professionnel
expression: match_recipient("iwanpro.*@mg.*.space") expression: match_recipient("iwanpro.*@mg.*.space")
priority: 2 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 - id: 5b6d4d826295740001913849
actions: actions:
- forward("aristide1clement@gmail.com,iwan.clement@free.fr") - forward("aristide1clement@gmail.com,iwan.clement@free.fr")
@@ -139,27 +167,6 @@
description: Pour Piwigo description: Pour Piwigo
expression: match_recipient("iwanadm@free.fr") expression: match_recipient("iwanadm@free.fr")
priority: 5 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 - id: 5c419a518b3cd70001c5ddea
actions: actions:
- forward("iwan.clement@gmx.fr") - forward("iwan.clement@gmx.fr")
@@ -188,13 +195,6 @@
description: Bruno Joachim description: Bruno Joachim
expression: match_recipient("bruno.*@mg.*.space") expression: match_recipient("bruno.*@mg.*.space")
priority: 8 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 - id: 5b6cbd328b3cd70001eb4eb2
actions: actions:
- forward("iwan.pubclement@mail.fr") - forward("iwan.pubclement@mail.fr")