2.6.3 Email-based ticket creation

Tickets can be created from received emails.

(Figure) Configuration of the “Email-based Ticket Creation” function

(Figure) Configuration of the “Email-based Ticket Creation” function (Figure) Configuration of the “Email-based Ticket Creation” function


The prerequisites and setting items are as follows.

[Prerequisites]
To use the “Email-based Ticket Creation” function, an email receiving environment is required.
In addition, one of the following functions is also required to use the “Auto Response” function.

■ Environment preparation

For receiving emails:
・Email server that receives emails from OTOBO
The mail server must be in an environment open to the Internet with connectivity from Ops I.
・Authorization servers that can be connected to from OTOBO (when OAuth2 is used for authentication of received email)
・OTOBO must be registered as a client application for the authorization server.
・The email server must be linked to the authorization server in advance.
・Protocols available on the email server
・POP3 (port number: 110)
・POP3S (port number: 995)
・POP3TLS (port number: 110)
・POP3OAUTH2 (port number used to receive emails: 110)
・IMAP (port number: 143)
・IMAPS (port number: 993)
・IMAPTLS (port number: 143)
・IMAPOAUTH2 (port number: 993)

NoteNote

  • The port number used for each protocol cannot be changed.
  • In order to communicate from Ops I to the email server or authorization server, it is necessary to set the information (IP address and port number) of the connection destination when building the Ops I environment.
    In the hearing sheet provided by us, please provide information on the mail server or authorization server to be connected from Ops I.
  • For email servers and authorization servers connected from OTOBO, it is necessary to allow communication from Ops I.
    Information (IP address, etc.) used for communication from Ops I is configured when the Ops I environment is built, so please inquire about the information after the environment is built.


■ Prepare an email account (email address)
・Email address used by OTOBO to receive emails (when using the "Email-based Ticket Creation" function)
   This email address is used by OTOBO to receive emails.
   When registered as an email account, it polls the system once every 10 minutes to see if email can be received.
   OTOBO also deletes emails from the mailbox when they are received.
   For this reason, it is recommended that a dedicated email address be provided.

[Setting items]

To receive emails, configure the settings for the following items. Setting is performed by a user with the role of System Administrator or Site Reliability Engineer.

(Table) Email receipt setting items

Setting items Description Required
Setting OAuth2 This setting registers an authorization server when OAuth2 is used for receiving email. Optional
Register email account (for OAuth2 authentication)
Register email account (for Basic authentication)
This setting registers an email account to be polled by OTOBO. Required
Register system address This setting registers the email address to be used by OTOBO. You can specify the queue to which tickets are created when you register your email address in your email account to receive email. It also registers the email address to be designated as the sender of the auto response reply email. Optional
Create rules for sorting tickets to be created when receiving emails This creates a ticket when OTOBO is able to receive the email. Optional
Setting auto responses This setting issues automatic responses to incoming email. Optional

The queue is the “Contact person” in Ops I ticket management. For details on creating and editing queues, see “Create and edit the contact person”.


(1) Setting OAuth2

■ Preparation (user environment)

1. Prepare a email server and authorization server capable of OAuth2 authentication.
2. Configure OAuth2 to enable connection from OTOBO.
Register OTOBO as a client application to the OAuth2 authorization server, and configure it to be able to connect from OTOBO.
Also, check the specifications of each authorization server for how to register as a client application.
In this case, set the following for the redirect URI to be specified when registering the client application.
"https://itsm.Ops I domain/otobo/index.pl?Action=AdminMailAccount"
3. Obtain the following information to register settings in OTOBO.
・client id*
・client secret (handle with care as it is equivalent to a password)*
・Authentication URL of the authorization server*
・Token URL of the authorization server*
・Host name of the POP3 or IMAP server
・Scope of OAuth2 Authentication*
*The format and contents vary depending on the authorization server.
4. Prepare an email account to connect from OTOBO.
・A password is required for authentication.
・Browsing a mailbox in a poll deletes the email in the mailbox.

■ Configuring OTOBO

1. Configure the provider settings necessary for OAuth2 authentication.
① From the main menu, select [Admin] and open [Administration] - [System Configuration].
② Select [Navigation] - [Core] - [Email] - [OAuth2].
③ Select the provider setting widget [OAuth2::MailAccount::Providers###Custom?] (?: any value between 1 and 3). Because the setting is not enabled by default, click the [Enable this setting] button that appears when your mouse pointer is on the widget to enable the setting.
④ Fill in and save the following setting fields.

(Table) OAuth2 setting fields (provider)

Field Value
AuthURL Specify the authorization URL of the authorization server.
IMAP-Host If IMAP is used, specify the host name of the IMAP server.
IMAP-Scope If IMAP is used, specify the scope of OAuth2 authentication.
Name Enter any name. It is specified in the profile described later.
POP3-Host If POP3 is used, specify the host name of the POP3 server.
POP3-Scope If POP3 is used, specify the scope of OAuth2 authentication.
TokenURL Specify the token URL of the authorization server.

2. Configure the profile settings required for OAuth2 authentication.
① From the main menu, select [Admin] and open [Administration] - [System Configuration].
② Select [Navigation] - [Core] - [Email] - [OAuth2].
③ Select the profile setting widget [OAuth2::MailAccount::Profiles###Custom?] (?: any value between 1 and 3). Because the setting is not enabled by default, click the [Enable this setting] button that appears when your mouse pointer is on the widget to enable the setting.
④ Fill in and save the following setting fields.

(Table) OAuth2 setting fields (profile)

Field Value
ClientID Specify the client Id obtained in advance.
ClientSecret Specify the client secret obtained in advance.
Name Enter any name. This will be used to register an email account.
ProviderName Specify the widget name for the provider setting selected in "Select the provider setting widget [OAuth2::MailAccount::Providers###Custom?] (?: any value between 1 and 3)".

3. Click the [Actions] - [Deployment] button to deploy the system settings.


(2) Register email account (for OAuth2 authentication)

When registering an email account, the Web screen switches to the authorization server for authentication. Because it is necessary to return to the URL specified in the redirect URI after authentication, please access “https://itsm.Ops I domain” to register your email account.

■ Configuring OTOBO

1. Register an email account.
① From the main menu, select [Admin] and open [Communication & Notifications] - [PostMaster Mail Accounts].
② Click the [Actions] - [Add Mail Account] button.
③ Fill in the following setting fields and click the [Save] button.
If an authentication screen appears when the [Save] button is clicked, the registered user name will be used for authentication.

(Table) Edit fields for email account (for OAuth2 authentication)

Field Value
Type Specify "IMAPOAuth2" (when using IMAP) or "POP3OAuth3" (when using POP3).
Profile From the select box, select the profile registered in "Configure the profile settings required for OAuth2 authentication.".
Username Specify the username of the email account on the email server.
IMAP Folder IMAP folder name
"INBOX" will be displayed. Modify this only if you want to retrieve email from folders other than "INBOX".
Trusted Specify "No".
Dispatching Specify how to sort the queue to create tickets.
Specify "Dispatching by email To: field." or "Dispatching by selected Queue.".
When "Dispatching by email To: field." is specified, the queue settings configured for the system address are used for sorting.
When "Dispatching by selected Queue." is specified, the queue settings specified for the mail account are used for sorting.
Validity "valid": Specify this if you wish to use this email account to receive email on a regular basis.
"invalid" or "invalid-temporarily": Specify this if you want to stop receiving email for this email account.

④ Click [List] - [Fetch mail] and confirm that you can receive emails.
⑤ Receiving emails can be confirmed from the main menu by selecting [Admin], then [Communication & Notifications] - [Communication Log].


NoteNote

  • If the authorization server performs two-factor authentication or authentication that redirects the user to another server during authentication, the user might not be redirected from the authorization server and might not be able to register correctly during authentication. In this case, perform OAuth2 authentication on your browser and then register your email account on the same browser.
  • For Ops I (OTOBO) client applications registered with the authorization server, permission for use by the user might be requested at the time of initial authentication. Registration of email accounts might fail when setting permissions for use from OTOBO. In this case, register your email account again. You can also register an email account after setting permissions for its use by the user in advance.
  • Some Ops I (OTOBO) client applications registered on the authorization server have a usage period depending on your environment. Make sure to re-create the client application and re-register before the usage period expires.
  • OTOBO will attempt to receive email using the token information issued by your authorization server. The token information might have a usage period. Check the usage period and re-create your email account before the period expires.



(3) Register email account (for Basic authentication)

■ Preparation (user environment)

1. Prepare a POP3 or IMAP server to connect from OTOBO.
2. Prepare a POP3 or IMAP email account (email address and password).
*It is recommended that you prepare a dedicated OTOBO account.
・A password is required for authentication.
・Browsing a mailbox in a poll deletes the email in the mailbox.

■ Configuring OTOBO

1. Register an email account.
① From the main menu, select [Admin] and open [Communication & Notifications] - [PostMaster Mail Accounts].
② Click the [Actions] - [Add Mail Account] button.
③ Fill in the following setting fields and click the [Save] button.
If an authentication screen appears when the [Save] button is clicked, the registered user name will be used for authentication.

(Table) Edit fields for email account (for basic authentication)

Field Value
Type When using IMAP:
Specify either "IMAP," "IMAPS", or "IMAPTLS".
When using POP3:
Specify either "POP3," "POP3S", or "POP3TLS".
Username Specify the username of the email account on the email server.
Password Specify the password for the email account.
Host Specify the host name of the email server.
IMAP Folder IMAP folder name
"INBOX" will be displayed. Modify this only if you want to retrieve email from folders other than "INBOX".
Trusted Specify "No".
Dispatching Specify how to sort the queue to create tickets.
Specify "Dispatching by email To: field." or "Dispatching by selected Queue.".
When "Dispatching by email To: field." is specified, the queue settings configured for the system address are used for sorting.
When "Dispatching by selected Queue." is specified, the queue settings specified for the mail account are used for sorting.
Validity "valid": Specify this if you wish to use this email account to receive email on a regular basis.
"invalid" or "invalid-temporarily": Specify this if you want to stop receiving email for this email account.
④ Click [Fetch mail] and confirm that you can receive email.
Similarly, "Click [List] - [Fetch mail] and confirm that you can receive emails.".
⑤ Receiving emails can be confirmed on the following page.
From the main menu, select [Admin] and open [Communication & Notifications] - [Communication Log]. Similarly, "Receiving emails can be confirmed from the main menu by selecting [Admin], then [Communication & Notifications] - [Communication Log].".


(4) Register system address

■ Preparation (user environment)

1. Prepare an email address to register with OTOBO.
Register the following email addresses.
・Email address to be used for receiving emails
You can also specify an email address for each queue, so you can register multiple email addresses.
・Email address to be used as the sender of the auto response reply email
Register the following value depending on the notification function:
・Ops I notification function: "noreply.opsi@itg.hitachi.co.jp"
・Function using an email server: The email address to be used for receiving emails can be used.

■ Configuring OTOBO
1. Register the system address.
① From the main menu, select [Admin] and open [Communication & Notifications] - [Email Addresses].
② Click the [Actions] - [Add System Address] button.
③ Fill in the following setting fields and click the [Save] button. Note that "OTOBO System (otobo@localhost)" is set by default. You can disable this email address or change the email address.

(Table) Edit fields for system email address

Field Value
Email address Specify the following values:
  • For email-based ticket creation: Prepared email address
  • For auto responses
    • Ops I notification function: "noreply.opsi@itg.hitachi.co.jp"
    • Function using an email server: Prepared email address
Display name Specify the name of the system address that will appear in the sender name of the email.
Queue Specify the queue from which tickets are created upon receiving the email specified in the To: header of the email.
If "Dispatching by selected Queue." is specified in the "Dispatching" field of the Edit Mail Account field, the "Dispatching by selected Queue." setting takes precedence.
*If only one system email address can be set, but you wish to assign it to multiple queues, register a sorting rule in the PostMaster Filter. See "Create rules for sorting tickets to be created when receiving emails".
Validity Specify "valid," "invalid," or "invalid-temporarily". Because the system email address cannot be deleted, specify "invalid" when it is no longer needed.
Comment Enter any comments.


(5) Create rules for sorting tickets to be created when receiving emails

A ticket is created when OTOBO receives an email.

・Tickets are sorted by the email address used to receive them.
・If "Dispatching by selected Queue." is set in the "Dispatching" settings for the mail account, it will be created in the queue set for the email account.
・If the address is registered in the system address, it is created in the queue registered in the system address.
・If there is no destination queue, it is created in the Raw queue.
*If the [Validity] setting of a queue designated as the destination queue is set to "invalid" or "invalid-temporarily", the queue will not appear in the destination queue settings screen, but the setting remains unchanged and tickets will be created in the designated queue when emails are received.
If you change the [Validity] setting of a queue, review the queue designated as the destination queue and save the setting again.
・If the email address of the sender of the received email is registered as a customer user, a customer user is automatically assigned.
・The creator of the ticket that is created upon receiving the email will be marked as "--".

If you wish to customize the sorting of tickets created by incoming email, configure the PostMaster Filter settings. The PostMaster Filter can add an OTOBO-specific header (X-OTOBO-????) from the headers of incoming emails. This OTOBO-specific header can also be used to change the ticket sorting.

Examples: Selecting a queue to distribute to, assigning a customer name or customer user name, setting an Owner for a ticket, etc.
For details, see the OTOBO manual (PostMaster Filters).
https://doc.otobo.org/manual/admin/11.0/en/content/administration-area/communication-notifications/postmaster-filters.html

■ Configuring OTOBO

1. Register a PostMaster Filter.
① From the main menu, select [Admin] and open [Communication & Notifications] - [PostMaster Filters].
② Click the [Actions] - [Add PostMaster Filter] button, fill in the following setting fields, and click the [Save] button.
Multiple PostMaster filters can be specified to assign rules to each customer, etc.

(Table) Registration fields for email sorting rules

Field Value
Name Specify the name of the PostMaster filter to be added.
Search header field Select the header of the email.
for value Specify the value of the condition. (Regular expressions can also be specified.)
Set email header Select an OTOBO-specific header.
with value Specify the value to be appended to the OTOBO-specific header.


(6) Setting auto responses

1. Change the format of the auto response.
① From the main menu, select [Admin] and open [Ticket Settings] - [Auto Responses].
② To create a new auto response, click the [Actions] - [Add Auto Response] button. To edit the auto response, go to [List] and select a format whose [TYPE] is "auto reply".
③ On the [Edit Auto Response] screen, make the following necessary settings and click the [Save] button.

(Table) Edit fields for auto response setting

Field Value
Type Specify "auto reply".
Auto response from Specify the following value depending on the notification function:
  • Ops I notification function: "noreply.opsi@itg.hitachi.co.jp"
  • Function using an email server: Specify one of the system addresses. If you want to change the address for each queue, create multiple formats for auto responses.
Validity This specifies whether the format can be used as an auto response format.

2. Associate queues with auto responses.
① From the main menu, select [Admin] and open [Ticket Settings] - [Queues<->Auto Responses].
② Select a queue from [Overview].
③ Click in the [auto reply] field, select a format, and click the [Save] button.