Commit f5e5c0c3 authored by Mark Sapiro's avatar Mark Sapiro Committed by Abhilash Raj

Updated Domains for the alias_domain attribute.

parent 9027008f
......@@ -49,7 +49,7 @@ setup(
install_requires=[
'Django>=1.11,<1.12',
'django-mailman3>=1.2.0a1',
'mailmanclient~=3.1.1a1'
'mailmanclient>=3.1.2a1'
],
tests_require=[
"mock",
......
......@@ -52,6 +52,11 @@ class DomainForm(forms.Form):
description = forms.CharField(
label=_('Description'),
required=False)
alias_domain = forms.CharField(
label=_('Alias Domain'),
required=False,
help_text=_('Normally empty. Used only for unusual Postfix configs.'),
)
site = SiteModelChoiceField(
label=_('Web Host'),
error_messages={'required': _('Please enter a domain name'),
......
......@@ -20,6 +20,7 @@
<tr>
<th>{% trans 'Mail Host' %}</th>
<th>{% trans 'Description' %}</th>
<th>{% trans 'Alias Domain' %}</th>
<th>{% trans 'Web Host' %}</th>
<th>&nbsp;</th>
</tr>
......@@ -29,6 +30,7 @@
<tr>
<td>{{ domain.mail_host }}</td>
<td>{% if domain.description %}{{ domain.description }}{% endif %}</td>
<td>{% if domain.alias_domain %}{{ domain.alias_domain }}{% endif %}</td>
<td>{{ domain.site.name }} ({{ domain.site.domain }})</td>
<td>
<a href="{% url 'domain_edit' domain.mail_host %}" class="btn btn-xs btn-primary">{% trans 'Edit' %}</a>
......
interactions:
- request:
body: !!python/unicode 'mail_host=example.com'
body: mail_host=example.com
headers:
accept-encoding: ['gzip, deflate']
!!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded']
method: !!python/unicode 'POST'
content-type: [application/x-www-form-urlencoded]
method: POST
uri: http://localhost:9001/3.0/domains
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
content-type: [application/json; charset=UTF-8]
......@@ -17,24 +17,24 @@ interactions:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/domains/example.com
response:
body: {string: !!python/unicode '{"description": null, "http_etag": "\"d150abd34fabbcef42a2c654bfac81aa04ea4d6f\"",
body: {string: '{"alias_domain": null, "description": null, "http_etag": "\"492652d581dc93af101db450d81ae93a074bff49\"",
"mail_host": "example.com", "self_link": "http://localhost:9001/3.0/domains/example.com"}'}
headers:
content-length: ['172']
content-length: ['194']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: !!python/unicode 'fqdn_listname=foo%40example.com'
body: fqdn_listname=foo%40example.com
headers:
accept-encoding: ['gzip, deflate']
!!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded']
method: !!python/unicode 'POST'
content-type: [application/x-www-form-urlencoded]
method: POST
uri: http://localhost:9001/3.0/lists
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
content-type: [application/json; charset=UTF-8]
......@@ -44,11 +44,11 @@ interactions:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/lists/foo@example.com
response:
body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com",
"http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com",
body: {string: '{"display_name": "Foo", "fqdn_listname": "foo@example.com", "http_etag":
"\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com",
"list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link":
"http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'}
headers:
......@@ -56,28 +56,28 @@ interactions:
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: !!python/unicode 'list_id=foo.example.com&role=moderator&subscriber=newmod%40example.com'
body: list_id=foo.example.com&role=moderator&subscriber=newmod%40example.com
headers:
accept-encoding: ['gzip, deflate']
!!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded']
method: !!python/unicode 'POST'
content-type: [application/x-www-form-urlencoded]
method: POST
uri: http://localhost:9001/3.0/members
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
content-type: [application/json; charset=UTF-8]
location: ['http://localhost:9001/3.0/members/5518']
location: ['http://localhost:9001/3.0/members/88']
status: {code: 201, message: Created}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/lists/foo@example.com
response:
body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com",
"http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com",
body: {string: '{"display_name": "Foo", "fqdn_listname": "foo@example.com", "http_etag":
"\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com",
"list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link":
"http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'}
headers:
......@@ -88,56 +88,56 @@ interactions:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/lists/foo.example.com/roster/moderator
response:
body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/newmod@example.com",
"delivery_mode": "regular", "email": "newmod@example.com", "http_etag": "\"8ded74b6a7fe87ae82c46a6492fcf6ee0e246779\"",
"list_id": "foo.example.com", "member_id": 5518, "moderation_action": "accept",
"role": "moderator", "self_link": "http://localhost:9001/3.0/members/5518",
"user": "http://localhost:9001/3.0/users/3629"}], "http_etag": "\"e1f73e5c9c2c0637ab5ac69cfc1132b71cb07f44\"",
body: {string: '{"entries": [{"address": "http://localhost:9001/3.0/addresses/newmod@example.com",
"delivery_mode": "regular", "email": "newmod@example.com", "http_etag": "\"f4f475b6c487d7c4cddeb2d40ab2f185445d589d\"",
"list_id": "foo.example.com", "member_id": 88, "moderation_action": "accept",
"role": "moderator", "self_link": "http://localhost:9001/3.0/members/88",
"user": "http://localhost:9001/3.0/users/91"}], "http_etag": "\"60f23f06e05ed33d8d40310fbff7aabb27e1a507\"",
"start": 0, "total_size": 1}'}
headers:
content-length: ['498']
content-length: ['492']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/lists/foo.example.com/roster/moderator
response:
body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/newmod@example.com",
"delivery_mode": "regular", "email": "newmod@example.com", "http_etag": "\"8ded74b6a7fe87ae82c46a6492fcf6ee0e246779\"",
"list_id": "foo.example.com", "member_id": 5518, "moderation_action": "accept",
"role": "moderator", "self_link": "http://localhost:9001/3.0/members/5518",
"user": "http://localhost:9001/3.0/users/3629"}], "http_etag": "\"e1f73e5c9c2c0637ab5ac69cfc1132b71cb07f44\"",
body: {string: '{"entries": [{"address": "http://localhost:9001/3.0/addresses/newmod@example.com",
"delivery_mode": "regular", "email": "newmod@example.com", "http_etag": "\"f4f475b6c487d7c4cddeb2d40ab2f185445d589d\"",
"list_id": "foo.example.com", "member_id": 88, "moderation_action": "accept",
"role": "moderator", "self_link": "http://localhost:9001/3.0/members/88",
"user": "http://localhost:9001/3.0/users/91"}], "http_etag": "\"60f23f06e05ed33d8d40310fbff7aabb27e1a507\"",
"start": 0, "total_size": 1}'}
headers:
content-length: ['498']
content-length: ['492']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'DELETE'
method: DELETE
uri: http://localhost:9001/3.0/lists/foo.example.com
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
Content-Length: ['0']
status: {code: 204, message: No Content}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'DELETE'
method: DELETE
uri: http://localhost:9001/3.0/domains/example.com
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
Content-Length: ['0']
status: {code: 204, message: No Content}
version: 1
interactions:
- request:
body: !!python/unicode 'description=A+new+Domain.&mail_host=example.com&owner=su%40example.com'
body: description=A+new+Domain.&mail_host=example.com&owner=su%40example.com
headers:
accept-encoding: ['gzip, deflate']
!!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded']
method: !!python/unicode 'POST'
content-type: [application/x-www-form-urlencoded]
method: POST
uri: http://localhost:9001/3.0/domains
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
content-type: [application/json; charset=UTF-8]
......@@ -17,109 +17,109 @@ interactions:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/domains
response:
body: {string: !!python/unicode '{"entries": [{"description": "A new Domain.",
"http_etag": "\"c6e72672613e4356ea2b456732e7ac6a944c7895\"", "mail_host":
body: {string: '{"entries": [{"alias_domain": "", "description": "A new Domain.",
"http_etag": "\"dfe5dd5f4f41e0480f95173f44f6bef01cb3be01\"", "mail_host":
"example.com", "self_link": "http://localhost:9001/3.0/domains/example.com"}],
"http_etag": "\"d24e513367f58024924e08c348757556eba0c853\"", "start": 0, "total_size":
"http_etag": "\"18ceeb08612dc16288dc254ca59e47b158448331\"", "start": 0, "total_size":
1}'}
headers:
content-length: ['288']
content-length: ['308']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/domains/example.com
response:
body: {string: !!python/unicode '{"description": "A new Domain.", "http_etag":
"\"c6e72672613e4356ea2b456732e7ac6a944c7895\"", "mail_host": "example.com",
body: {string: '{"alias_domain": "", "description": "A new Domain.", "http_etag":
"\"dfe5dd5f4f41e0480f95173f44f6bef01cb3be01\"", "mail_host": "example.com",
"self_link": "http://localhost:9001/3.0/domains/example.com"}'}
headers:
content-length: ['183']
content-length: ['203']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/domains/example.com
response:
body: {string: !!python/unicode '{"description": "A new Domain.", "http_etag":
"\"c6e72672613e4356ea2b456732e7ac6a944c7895\"", "mail_host": "example.com",
body: {string: '{"alias_domain": "", "description": "A new Domain.", "http_etag":
"\"dfe5dd5f4f41e0480f95173f44f6bef01cb3be01\"", "mail_host": "example.com",
"self_link": "http://localhost:9001/3.0/domains/example.com"}'}
headers:
content-length: ['183']
content-length: ['203']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/domains/example.com
response:
body: {string: !!python/unicode '{"description": "A new Domain.", "http_etag":
"\"c6e72672613e4356ea2b456732e7ac6a944c7895\"", "mail_host": "example.com",
body: {string: '{"alias_domain": "", "description": "A new Domain.", "http_etag":
"\"dfe5dd5f4f41e0480f95173f44f6bef01cb3be01\"", "mail_host": "example.com",
"self_link": "http://localhost:9001/3.0/domains/example.com"}'}
headers:
content-length: ['183']
content-length: ['203']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/domains/example.com/owners
response:
body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23",
"http_etag": "\"197704edf200b777417e75b01809af2dc0e036dc\"", "is_server_owner":
false, "self_link": "http://localhost:9001/3.0/users/3706", "user_id": 3706}],
"http_etag": "\"3799ae94522f6f38816feab632ccb536c8775308\"", "start": 0, "total_size":
body: {string: '{"entries": [{"created_on": "2005-08-01T07:49:23", "http_etag":
"\"1e86381735f77312260a704e0b6dc204d733f858\"", "is_server_owner": false,
"self_link": "http://localhost:9001/3.0/users/24", "user_id": 24}], "http_etag":
"\"e8d85c2de304ab3c6a2e748002c26e8107b9732a\"", "start": 0, "total_size":
1}'}
headers:
content-length: ['299']
content-length: ['295']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/users/su@example.com
response:
body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag":
"\"197704edf200b777417e75b01809af2dc0e036dc\"", "is_server_owner": false,
"self_link": "http://localhost:9001/3.0/users/3706", "user_id": 3706}'}
body: {string: '{"created_on": "2005-08-01T07:49:23", "http_etag": "\"1e86381735f77312260a704e0b6dc204d733f858\"",
"is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/24",
"user_id": 24}'}
headers:
content-length: ['194']
content-length: ['190']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'DELETE'
method: DELETE
uri: http://localhost:9001/3.0/domains/example.com
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
Content-Length: ['0']
status: {code: 204, message: No Content}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/domains
response:
body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"",
body: {string: '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"",
"start": 0, "total_size": 0}'}
headers:
content-length: ['90']
......@@ -129,27 +129,27 @@ interactions:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
method: GET
uri: http://localhost:9001/3.0/users
response:
body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23",
"http_etag": "\"197704edf200b777417e75b01809af2dc0e036dc\"", "is_server_owner":
false, "self_link": "http://localhost:9001/3.0/users/3706", "user_id": 3706}],
"http_etag": "\"3799ae94522f6f38816feab632ccb536c8775308\"", "start": 0, "total_size":
body: {string: '{"entries": [{"created_on": "2005-08-01T07:49:23", "http_etag":
"\"1e86381735f77312260a704e0b6dc204d733f858\"", "is_server_owner": false,
"self_link": "http://localhost:9001/3.0/users/24", "user_id": 24}], "http_etag":
"\"e8d85c2de304ab3c6a2e748002c26e8107b9732a\"", "start": 0, "total_size":
1}'}
headers:
content-length: ['299']
content-length: ['295']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'DELETE'
uri: http://localhost:9001/3.0/users/3706
method: DELETE
uri: http://localhost:9001/3.0/users/24
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
Content-Length: ['0']
status: {code: 204, message: No Content}
version: 1
interactions:
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode GET
uri: http://localhost:9001/3.0/users/su@example.com
response:
body: {string: !!python/unicode 404 Not Found}
headers:
content-length: ['13']
content-type: [application/json; charset=UTF-8]
status: {code: 404, message: Not Found}
- request:
body: base_url=http%3A%2F%2Fexample.com&description=A+new+Domain.&mail_host=example.com&owner=su%40example.com
body: description=A+new+Domain.&mail_host=example.com&owner=su%40example.com
headers:
accept-encoding: ['gzip, deflate']
!!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded]
method: !!python/unicode POST
content-type: [application/x-www-form-urlencoded]
method: POST
uri: http://localhost:9001/3.0/domains
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
content-type: [application/json; charset=UTF-8]
location: ['http://localhost:9001/3.0/domains/example.com']
status: {code: 201, message: Created}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode GET
uri: http://localhost:9001/3.0/users/su@example.com
response:
body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag":
"\"f5fdcfb3183052b27f01c2242df9b6004fd145f9\"", "is_server_owner": false,
"self_link": "http://localhost:9001/3.0/users/2839", "user_id": 2839}'}
headers:
content-length: ['194']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
body: description=A+new+Domain.&mail_host=example.com&owner=su%40example.com
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode GET
uri: http://localhost:9001/3.0/users/2839/addresses
response:
body: {string: !!python/unicode '{"entries": [{"email": "su@example.com", "http_etag":
"\"10b3a65090b9bdc5d284eec69c79f09cf571c7ab\"", "original_email": "su@example.com",
"registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/su@example.com",
"user": "http://localhost:9001/3.0/users/2839"}], "http_etag": "\"ed3742102d66d365550f4b0f8e9cf3aa98a08833\"",
"start": 0, "total_size": 1}'}
headers:
content-length: ['384']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: base_url=http%3A%2F%2Fexample.com&description=A+new+Domain.&mail_host=example.com&owner=su%40example.com
headers:
accept-encoding: ['gzip, deflate']
!!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded]
method: !!python/unicode POST
content-type: [application/x-www-form-urlencoded]
method: POST
uri: http://localhost:9001/3.0/domains
response:
body: {string: !!python/unicode 'Duplicate email host: example.com'}
body: {string: 'Duplicate email host: example.com'}
headers:
content-length: ['33']
content-type: [application/json; charset=UTF-8]
......@@ -72,54 +30,54 @@ interactions:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode GET
method: GET
uri: http://localhost:9001/3.0/domains
response:
body: {string: !!python/unicode '{"entries": [{"base_url": "http://example.com",
"description": "A new Domain.", "http_etag": "\"f574263235a622b271bd1115317117aee0e171f0\"",
"mail_host": "example.com", "self_link": "http://localhost:9001/3.0/domains/example.com",
"url_host": "example.com"}], "http_etag": "\"38f84ff58faee37a60c2f95a37be70303d2cfb59\"",
"start": 0, "total_size": 1}'}
body: {string: '{"entries": [{"alias_domain": "", "description": "A new Domain.",
"http_etag": "\"dfe5dd5f4f41e0480f95173f44f6bef01cb3be01\"", "mail_host":
"example.com", "self_link": "http://localhost:9001/3.0/domains/example.com"}],
"http_etag": "\"18ceeb08612dc16288dc254ca59e47b158448331\"", "start": 0, "total_size":
1}'}
headers:
content-length: ['349']
content-length: ['308']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode DELETE
method: DELETE
uri: http://localhost:9001/3.0/domains/example.com
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers:
content-length: ['0']
Content-Length: ['0']
status: {code: 204, message: No Content}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode GET
method: GET
uri: http://localhost:9001/3.0/users
response:
body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23",
"http_etag": "\"f5fdcfb3183052b27f01c2242df9b6004fd145f9\"", "is_server_owner":
false, "self_link": "http://localhost:9001/3.0/users/2839", "user_id": 2839}],
"http_etag": "\"4a073dc24ef419faf7f15af630340a6b535c5cfd\"", "start": 0, "total_size":
body: {string: '{"entries": [{"created_on": "2005-08-01T07:49:23", "http_etag":
"\"0c3f6e8712fd05b9da49c42bf9600a5414b7958f\"", "is_server_owner": false,
"self_link": "http://localhost:9001/3.0/users/25", "user_id": 25}], "http_etag":
"\"348e2549d7cb4eb7f86ecd8a5bf61142377beffa\"", "start": 0, "total_size":
1}'}
headers:
content-length: ['299']
content-length: ['295']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode DELETE
uri: http://localhost:9001/3.0/users/2839
method: DELETE
uri: http://localhost:9001/3.0/users/25
response:
body: {string: !!python/unicode ''}
body: {string: ''}
headers: