Compare commits
No commits in common. "93ee76e1305a20913cf7a3f617b1426bd7c61992" and "f1bbd0c27448592a472aa2324fbc8e65aa96a214" have entirely different histories.
93ee76e130
...
f1bbd0c274
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
data/*
|
data/*
|
||||||
*.yml
|
*.yml
|
||||||
*.conf
|
*.conf
|
||||||
*.swp
|
|
||||||
|
|||||||
11
ovh-mail.py
11
ovh-mail.py
@ -33,15 +33,6 @@ def addRedirection(client,domain,fr,to):
|
|||||||
print(json.dumps(result,indent=4))
|
print(json.dumps(result,indent=4))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def delRedirection(client,domain,fr,to):
|
|
||||||
id_redir = checkRedirExists(client,domain,fr,to)
|
|
||||||
if not id_redir:
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
result = client.delete('/email/domain/'+ domain +'/redirection/' + str(id_redir))
|
|
||||||
print(json.dumps(result,indent=4))
|
|
||||||
return 0
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Process arguments')
|
parser = argparse.ArgumentParser(description='Process arguments')
|
||||||
parser.add_argument('method', metavar='method', type=str, help='Function to use')
|
parser.add_argument('method', metavar='method', type=str, help='Function to use')
|
||||||
parser.add_argument('domain', metavar='domain', type=str, help='domain')
|
parser.add_argument('domain', metavar='domain', type=str, help='domain')
|
||||||
@ -61,5 +52,3 @@ if (args.method == "write"):
|
|||||||
elif (args.method == "add"):
|
elif (args.method == "add"):
|
||||||
if not (checkRedirExists(client,args.domain,args.fr,args.to)):
|
if not (checkRedirExists(client,args.domain,args.fr,args.to)):
|
||||||
addRedirection(client,args.domain,args.fr,args.to)
|
addRedirection(client,args.domain,args.fr,args.to)
|
||||||
elif (args.method == "del"):
|
|
||||||
status = delRedirection(client,args.domain,args.fr,args.to)
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user