20200612
This commit is contained in:
78
scripts/DefineRules.sh
Executable file
78
scripts/DefineRules.sh
Executable file
@@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# https://documentation.mailgun.com/en/latest/api-routes.html
|
||||||
|
MG_USER=
|
||||||
|
MG_URL="https://api.mailgun.net/v3/routes"
|
||||||
|
MG_APIKEY="api:key-6e4b01ba0681141a509c1c462fca40f4"
|
||||||
|
MG_ORDER="GET /routes"
|
||||||
|
|
||||||
|
declare -A MyRules
|
||||||
|
|
||||||
|
"5ce42a14bf802e0001684668,2,Tout ce qui arrive sur le domaine pour mg.iwanclement.eu,match_recipient(".*@mg.iade-lyon.eu")
|
||||||
|
5cd48c308b3cd70001f79bfb
|
||||||
|
5cd48b47a4764a00013cee72
|
||||||
|
5db1e61d11c830a64e8e2dba
|
||||||
|
5ce18c92629574000195c8de
|
||||||
|
5ca2330d6295740001322814
|
||||||
|
5c726e2f8b3cd70001237ee5
|
||||||
|
5c570e59bf802e00012989e9
|
||||||
|
5baa01368ecd8700013c5010
|
||||||
|
5b6d4d826295740001913849
|
||||||
|
5b6d4c278b3cd70001ebdfda
|
||||||
|
5c5499376295740001fe1e27
|
||||||
|
5c5343c345d85900018ceee6
|
||||||
|
5c5eb3376295740001546abf
|
||||||
|
5c534e78bf802e00013232e5
|
||||||
|
5bbe45dc6295740001b26ffd
|
||||||
|
5b9b758aa4764a000133bfbe
|
||||||
|
5bae76a745d8590001287978
|
||||||
|
5b8d79f98b3cd700019d5205
|
||||||
|
5b799e80a4764a000192cf3b
|
||||||
|
5c726e7e8ecd870001264998
|
||||||
|
5c726b408ecd870001264739
|
||||||
|
5c726b19bf802e000162d921
|
||||||
|
5c419a518b3cd70001c5ddea
|
||||||
|
5b8a5bcd8b3cd700017130ed
|
||||||
|
5ce18d97bf802e00019eaace
|
||||||
|
5ce18cf4a4764a0001d95b58
|
||||||
|
5baf5ac78b3cd70001ebae82
|
||||||
|
5b6cbd328b3cd70001eb4eb2
|
||||||
|
|
||||||
|
for i in "${MyRules[@]}"; do echo "$i"; done
|
||||||
|
for i in "${MyRules[*]}"; do echo "$i"; done
|
||||||
|
|
||||||
|
curl -s --user $MG_APIKEY -X PUT \
|
||||||
|
"$MG_URL/5ce18c92629574000195c8de" \
|
||||||
|
-F priority=2 \
|
||||||
|
-F description='Tout ce qui arrive sur le domaine pour mg.iwanclement.eu' \
|
||||||
|
-F expression='match_recipient(".*@mg.iade-lyon.eu")' \
|
||||||
|
-F action='forward("iwan.pubclement@gmx.fr")' \
|
||||||
|
-F action='stop()'
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
curl -s --user $MG_APIKEY -X PUT \
|
||||||
|
"$MG_URL/5c726e2f8b3cd70001237ee5" \
|
||||||
|
-F priority=2 \
|
||||||
|
-F description='Tout pour Nadine Clement' \
|
||||||
|
-F expression='match_recipient(".*@mg.iade-lyon.eu")' \
|
||||||
|
-F action='forward("nadineclement@mail.fr")' \
|
||||||
|
-F action='stop()'
|
||||||
|
|
||||||
|
curl -s --user $MG_APIKEY -G \
|
||||||
|
$MG_URL \
|
||||||
|
-d skip=1 \
|
||||||
|
-d limit=1
|
||||||
|
|
||||||
|
# curl -s --user 'api:YOUR_API_KEY' -G \
|
||||||
|
# https://api.mailgun.net/v3/routes \
|
||||||
|
# -d skip=1 \
|
||||||
|
# -d limit=1
|
||||||
|
|
||||||
|
|
||||||
|
# curl -s --user $MG_APIKEY \
|
||||||
|
# $MG_URL \
|
||||||
|
# -F priority=0 \
|
||||||
|
# -F description='Recuperation des routes' \
|
||||||
|
# -F expression='match_recipient(".*@YOUR_DOMAIN_NAME")' \
|
||||||
|
# -F action='forward("http://myhost.com/messages/")' \
|
||||||
|
# -F action='stop()'
|
||||||
@@ -5,6 +5,16 @@ MG_URL="https://api.mailgun.net/v3/routes"
|
|||||||
MG_APIKEY="api:key-6e4b01ba0681141a509c1c462fca40f4"
|
MG_APIKEY="api:key-6e4b01ba0681141a509c1c462fca40f4"
|
||||||
MG_ORDER="GET /routes"
|
MG_ORDER="GET /routes"
|
||||||
|
|
||||||
|
curl -s --user $MG_APIKEY -X PUT \
|
||||||
|
"$MG_URL/5ce18c92629574000195c8de" \
|
||||||
|
-F priority=2 \
|
||||||
|
-F description='Tout ce qui arrive sur le domaine pour mg.iwanclement.eu' \
|
||||||
|
-F expression='match_recipient(".*@mg.iade-lyon.eu")' \
|
||||||
|
-F action='forward("iwan.pubclement@gmx.fr")' \
|
||||||
|
-F action='stop()'
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
curl -s --user $MG_APIKEY -X PUT \
|
curl -s --user $MG_APIKEY -X PUT \
|
||||||
"$MG_URL/5c726e2f8b3cd70001237ee5" \
|
"$MG_URL/5c726e2f8b3cd70001237ee5" \
|
||||||
-F priority=2 \
|
-F priority=2 \
|
||||||
@@ -13,7 +23,6 @@ curl -s --user $MG_APIKEY -X PUT \
|
|||||||
-F action='forward("nadineclement@mail.fr")' \
|
-F action='forward("nadineclement@mail.fr")' \
|
||||||
-F action='stop()'
|
-F action='stop()'
|
||||||
|
|
||||||
exit 0
|
|
||||||
curl -s --user $MG_APIKEY -G \
|
curl -s --user $MG_APIKEY -G \
|
||||||
$MG_URL \
|
$MG_URL \
|
||||||
-d skip=1 \
|
-d skip=1 \
|
||||||
|
|||||||
Reference in New Issue
Block a user