Helpdesk Mailbox

Added in version 3.0.0.

Requires Redmine >= 5.0 and the redmine_expert_helpdesk plugin >= 0.20.0. All operations, including read ones, require the manage_helpdesk permission.

Manager

All operations on the HelpdeskMailbox resource are provided by its manager. To get access to it you have to call redmine.helpdesk_mailbox where redmine is a configured redmine object. See the Configuration about how to configure redmine object.

Create methods

create

redminelib.managers.ResourceManager.create(**fields)

Creates new HelpdeskMailbox resource with given fields. See the plugin’s API.md for the complete list of fields, the most important ones are listed below. Secrets (mail_password, oauth_client_secret, oauth_sa_key) are write-only: a blank value keeps the stored secret and '-' clears it, responses only contain *_set booleans.

Parameters:
  • project_id (int or string) – (required). Id or identifier of mailbox’s project.

  • mailbox_address (string) – (required). Mailbox address, globally unique.

  • provider (string) – (optional). One of graph or imap.

  • enabled (bool) – (optional). Whether the mailbox is fetched.

  • auth_method (string) – (optional). One of oauth2 or password.

  • imap_host (string) – (optional). IMAP host.

  • mail_password (string) – (optional). Mailbox password (write-only).

Returns:

Resource object

>>> mailbox = redmine.helpdesk_mailbox.create(
...     project_id='support',
...     mailbox_address='support@example.com',
...     provider='imap',
...     imap_host='imap.example.com',
...     auth_method='password',
...     mail_password='secret'
... )
>>> mailbox
<redminelib.resources.HelpdeskMailbox #7 "support@example.com">

Read methods

get

redminelib.managers.ResourceManager.get(resource_id)

Returns single HelpdeskMailbox resource by its id.

Parameters:

resource_id (int) – (required). Id of the mailbox.

Returns:

Resource object

>>> mailbox = redmine.helpdesk_mailbox.get(7)
>>> mailbox.mail_password_set
True

all

Not supported by the Helpdesk plugin

filter

redminelib.managers.ResourceManager.filter(**filters)

Returns HelpdeskMailbox resources of a project.

Parameters:
  • project_id (int or string) – (required). Id or identifier of mailboxes’ project.

  • enabled (bool) – (optional). Only enabled or disabled mailboxes.

  • provider (string) – (optional). Only mailboxes of the provider, graph or imap.

  • limit (int) – (optional). How much resources to return.

  • offset (int) – (optional). Starting from what resource to return the other resources.

Returns:

ResourceSet object

>>> mailboxes = redmine.helpdesk_mailbox.filter(project_id='support', enabled=True)

Update methods

update

redminelib.managers.ResourceManager.update(resource_id, **fields)

Updates values of given fields of a HelpdeskMailbox resource. Accepts the same fields as create() except project_id.

Parameters:

resource_id (int) – (required). Mailbox id.

Returns:

True

>>> redmine.helpdesk_mailbox.update(7, enabled=False)
True

save

redminelib.resources.HelpdeskMailbox.save(**attrs)

Saves current state of a HelpdeskMailbox resource.

Returns:

Resource object

Delete methods

delete

redminelib.managers.ResourceManager.delete(resource_id)

Deletes single HelpdeskMailbox resource by its id.

Parameters:

resource_id (int) – (required). Mailbox id.

Returns:

True

Other methods

test_connection

redminelib.managers.HelpdeskMailboxManager.test_connection(mailbox_id)

Tests the connection of a mailbox. A failed test is not raised as an exception but returned with ok set to False.

Parameters:

mailbox_id (int) – (required). Mailbox id.

Returns:

dict with ok, message and optionally folders and sent_folder

>>> redmine.helpdesk_mailbox.test_connection(7)
{'ok': True, 'message': 'OK', 'folders': ['INBOX', 'Sent']}
>>> redmine.helpdesk_mailbox.get(7).test_connection()
{'ok': False, 'message': 'Authentication failed'}

Export

Not supported by the Helpdesk plugin