1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110 | **Code:**
#!/usr/bin/env python2.5
import xmlrpclib
# EDIT: webfaction credentials
username = "YOUR USERNAME"
password = "YOUR PASSWORD"
# no need to edit below this line
server = xmlrpclib.Server('https://api.webfaction.com/')
session_id, account = server.login(username, password)
domain = raw_input("Please enter your domain name (no www, etc): ")
mail = raw_input("Please enter the mail subdomain (mail): ")
cal = raw_input("Please enter the mail subdomain (calendar): ")
doc = raw_input("Please enter the mail subdomain (docs): ")
start = raw_input("Please enter the mail subdomain (start): ")
gstring = raw_input("Please enter the verefication string (gstring ): ")
# mx info
mx_info = (
('ASPMX.L.GOOGLE.COM','10'),
('ALT1.ASPMX.L.GOOGLE.COM','20'),
('ALT2.ASPMX.L.GOOGLE.COM','20'),
('ASPMX2.GOOGLEMAIL.COM','30'),
('ASPMX3.GOOGLEMAIL.COM','30'),
('ASPMX4.GOOGLEMAIL.COM','30'),
('ASPMX5.GOOGLEMAIL.COM','30'),
)
# create mx records
for mx in mx_info:
server.create_dns_override(session_id,
domain,
'',
'',
mx[0],
mx[1],
'')
# create CNAME record
try:
server.create_domain(session_id, domain, mail)
except:
pass
server.create_dns_override(session_id,
mail + "." + domain,
'',
'ghs.google.com',
'',
'',
'')
if cal:
try:
server.create_domain(session_id, domain, cal)
except:
pass
server.create_dns_override(session_id,
cal + "." + domain,
'',
'ghs.google.com',
'',
'',
'')
if doc:
try:
server.create_domain(session_id, domain, doc)
except:
pass
server.create_dns_override(session_id,
doc + "." + domain,
'',
'ghs.google.com',
'',
'',
'')
if start:
try:
server.create_domain(session_id, domain, start)
except:
pass
server.create_dns_override(session_id,
start + "." + domain,
'',
'ghs.google.com',
'',
'',
'')
if start:
try:
server.create_domain(session_id, domain, gstring)
except:
pass
server.create_dns_override(session_id,
gstring+ "." + domain,
'',
'google.com',
'',
'',
'')
|