Patch to list pangea mail addresses (#4)

This commit is contained in:
Santiago Lamora 2020-02-17 11:29:58 +01:00
parent f599dc6ca9
commit 425d090522
1 changed files with 16 additions and 0 deletions

View File

@ -137,6 +137,22 @@ class Orchestra(object):
data['names'] = aliases
addresses.append(MailService.new_from_json(data))
# PATCH to include Pangea addresses not shown by orchestra
# described on issue #4
raw_mailboxes = self.retrieve_service_list('mailbox')
for mailbox in raw_mailboxes:
if mailbox['addresses'] == []:
address_data = {
'names': [mailbox['name']],
'forward': '',
'domain': {
'name': 'pangea.org.',
},
'mailboxes': [mailbox],
}
pangea_address = MailService.new_from_json(address_data)
addresses.append(pangea_address)
return addresses
def retrieve_domain(self, pk):