Just as a company doesn’t just have one department which receives traditional mail, your service desk will also serve multiple teams. Each team can have its physical email mailbox.
OTRS eases setup for email mailboxes. OTRS manages polling one or multiple email mailboxes of any internet standard type.
Use this screen to add mail accounts to the system. The mail account management screen is available in the PostMaster Mail Accounts module of the Communication & Notifications group.

Warning
When fetching mail, OTRS deletes the mail from the POP or IMAP server. There is no option to also keep a copy on the server. If you want to retain a copy on the server, you should create forwarding rules on your mail server. Please consult your mail server documentation for details.
Note
If you choose IMAP, you can specify a folder for collection. Selective dispatching of mails is then possible.
All data for the mail accounts are saved in the OTRS database. The bin/otrs.Console.pl Maint::PostMaster::MailAccountFetch command uses the settings in the database and fetches the mail. You can execute it manually to check if all your mail settings are working properly.
On a default installation, the mail is fetched every 10 minutes when the OTRS daemon is running.
Manage Mail Accounts
To add a mail account:
-
Click on the Add Mail Account button in the left sidebar.
-
Fill in the required fields.
-
Click on the Save button.

To edit a mail account:
-
Click on a mail account in the list of mail accounts.
-
Modify the fields.
-
Click on the Save or Save and finish button.

To delete a mail account:
-
Click on the trash icon in the list of mail accounts.
-
Click on the Confirm button.

Note
If several mail accounts are added to the system, a filter box is useful to find a particular mail account by just typing to filter.
Warning
The maximum number of 10 valid mail accounts should not be exceeded. Exceeding this limit may affect the system performance.
Mail Account Settings
The following settings are available when adding or editing this resource. The fields marked with an asterisk are mandatory.
- Type *
-
There are different kind of protocols that are used for fetching mail. The following protocols are supported:
-
IMAP
-
IMAPS
-
IMAPTLS
-
Outlook365
-
POP3
-
POP3S
-
POP3TLS
-
- Credential *
-
Select a credential that has been added in the Credentials screen. Click on the Add credential button to open the credential management screen.
- E-mail Address *
-
The mail address of the mail account.
This setting is only available if Outlook365 is selected in the Type field.
- Host *
-
The host name of the mail account.
This setting is only available if IMAP or POP3 is selected in the Type field.
- Folder *
-
The folder in the mail account to be fetched. Other folders remain untouched. If you use a sub-folder, specify it as Parent/Sub.
This setting is only available if IMAP or Outlook365 is selected in the Type field.
- SSL Verify
-
If yes is selected, OTRS checks the server certificate against the trusted root certificates of the system. If no is selected OTRS does not check for a valid server certificate.
If the mail server uses a self-signed certificate or a certificate issued by a private or internal certificate authority, this check fails and no mail is fetched, unless the SSL Fingerprint setting is also set.
Warning
Selecting no disables the protection against man-in-the-middle attacks completely. To accept a self-signed or internal certificate, set the SSL Fingerprint instead.
This setting is only available if IMAPS, IMAPTLS, POP3S or POP3TLS is selected in the Type field.
- SSL Fingerprint
-
This setting is required if SSL Verify is set to yes and the server certificate is not signed by a publicly trusted certificate authority, for example a self-signed certificate or a certificate issued by an internal company CA. The fingerprint pins the exact certificate, so the verification succeeds without a trusted certificate chain and without disabling the verification at all.
Specify the fingerprint of the certificate as
algo$hex_fingerprint, wherealgois a fingerprint algorithm supported by OpenSSL, e.g.sha1,sha256etc. andhex_fingerprintis the hexadecimal representation of the binary fingerprint. Any colons inside the hex string will be ignored.If you have the certificate file, you can get the fingerprint with the following command:
openssl x509 -in <certificate file> -noout -fingerprint -sha256
Alternatively, you can read the fingerprint directly from the mail server. Use port
993for IMAPS and port995for POP3S:openssl s_client -connect <host>:993 </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256
For IMAPTLS and POP3TLS, add the
-starttls imapor-starttls pop3option and use port143or110respectively:openssl s_client -connect <host>:143 -starttls imap </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256
The command prints a line like
sha256 Fingerprint=1A:2B:3C:.... Enter it in this field assha256$1A:2B:3C:....Warning
Make sure you retrieve the fingerprint over a trusted network connection, or compare it with the fingerprint provided by the administrator of the mail server. The fingerprint has to be updated each time the certificate of the mail server is renewed.
At the moment we only support one fingerprint.
This setting is only available if IMAPS, IMAPTLS, POP3S or POP3TLS is selected in the Type field.
- SSL VerifyCN Name
-
This setting is only needed if the host name used to connect to the mail server does not match the name in the certificate, for example if you connect via an IP address or an internal alias. Set this field to the host name the certificate was actually issued for.
This setting is only available if IMAPS, IMAPTLS, POP3S or POP3TLS is selected in the Type field.
See also
The SSL settings are passed through IO::Socket::SSL. For detailed information read its official documentation.
- Trusted *
-
If Yes is selected, any
X-OTRSheaders attached to an incoming message are evaluated and executed. Because theX-OTRSheader can execute some actions in the ticket system, you should set this option to Yes only for known senders.See also
The
X-OTRSheaders are explained in the filter conditions of Postmaster Filters. - Dispatching *
-
The distribution of incoming messages can be controlled if they need to be sorted by queue or by the content of the To: field.
- Dispatching by email To: field
-
The system checks if a queue is linked with the address in the To: field of the incoming mail. You can link an address to a queue in the Email Addresses screen. If the address in the To: field is linked with a queue, the new message will be sorted into the linked queue. If no link is found between the address in the To: field and any queue, then the message flows into the Raw queue in the system, which is the postmaster default queue after a default installation.
See also
The postmaster default queue can be changed in system configuration setting PostmasterDefaultQueue.
- Dispatching by selected Queue
-
All incoming messages will be sorted into the specified queue. The address where the mail was sent to is disregarded in this case.
- Validity *
-
Set the validity of this resource. Each resource can be used in OTRS only, if this field is set to valid. Setting this field to invalid or invalid-temporarily will disable the use of the resource.
- Comment
-
Add additional information to this resource. It is recommended to always fill this field as a description of the resource with a full sentence for better clarity, because the comment will be also displayed in the overview table.
Troubleshooting SSL Verification
If SSL Verify is set to yes and no mail is fetched from a mail account, check the Communication Log or run the bin/otrs.Console.pl Maint::PostMaster::MailAccountFetch command manually. A failed certificate verification is indicated by the following or similar error:
IMAPS 'mail.example.com': Connection failed! (SSL error: SSL connect attempt failed error:...:certificate verify failed)
In this case, check the following points:
-
Is the certificate of the mail server signed by a publicly trusted certificate authority? If the mail server uses a self-signed certificate or a certificate issued by an internal company CA, set the SSL Fingerprint of the certificate in the mail account.
-
Has the certificate of the mail server been renewed recently? If an SSL Fingerprint is set, it has to be updated with the fingerprint of the new certificate.
-
Does the Host of the mail account match the name in the certificate? If you connect via an IP address or an internal alias, the verification fails with an error like
hostname verification failed. Set the SSL VerifyCN Name to the host name the certificate was issued for.
Note
Setting SSL Verify to no also makes the error disappear, but it disables the verification of the mail server completely. Use the SSL Fingerprint instead.
Setting up Incoming Emails
For incoming emails, OTRS can be configured in a variety of ways.The best option to do this might depend on your specific circumstances.
Receiving Mails via Local MDA
Using a local mail transfer agent (MTA) to receive mails directly is the recommended option. It provides near to real time mail delivery and the setup is more stable than when you poll your mails via IMAP(S) or POP(S). Authentication is also no longer an issue.
- Redirecting mails to another address
-
Your current mail server must relay the emails to the local MTA.
- SMTP Transport
-
An alternative router is setup on the receiving MTA to deliver mails from specific users to an external SMTP server.
In both cases, the use of Procmail is required as the mail delivery agent (MDA), as well as the proper $HOME setup for the user otrs on your system. An example file .procmailrc.dist can be used directly without modification. Just remove the .dist ending. Mails sent to the local otrs user are then piped to the console command for processing.
Warning
Please note that all “push” mail transferred directly to the otrs user (i.e. via the console command) is always trusted. This means X-OTRS headers in emails can and will affect the distribution of mails and setting of ticket properties. This includes the X-OTRS-FollowUp headers.
For more information, please read the Postmaster Filters chapter.
Note
Errors will send the mail to the directory var/spool/problem-email.
Read the Postfix documentation or the Exim4 documentation for more information on the setup.
Note
This feature is only available to On-Premise customers. If you are a Managed customer, this feature is taken care of by the Customer Solutions Team in OTRS. Please contact us via support@otrs.com or in the OTRS Portal.
Receiving Mails via External Email Provider
Alternatively, it is also possible to use an external email provider for incoming emails.
To setup the system to use Office 365 as email provider:
-
Read the POP and IMAP email settings for Outlook chapter in the official documentation.
-
Fill the form with the following data:
-
Type: select the desired protocol
-
Credential: your credential
-
Host: outlook.office365.com
-
Warning
On October 1st, 2022 Microsoft will stop supporting and retired basic authentication for POP3 and IMAP. Only OAuth2 can be used for authentication. For more information, please read the original blog post.
To setup the system to use Gmail as email provider:
-
Read the Check Gmail through other email platforms chapter in the official documentation.
-
Fill the form with the following data:
-
Type: select the desired protocol
-
Credential: your credential
-
Host: imap.gmail.com
-
To setup the system to use another external email provider:
-
Read the official documentation of the external provider.
-
Fill the form with the following data:
-
Type: select the desired protocol
-
Credential: your credential
-
Host: the POP3 or IMAP address of the external provider
-
See also
You can find detailed instructions in the Email Addresses chapter about how to configure outgoing emails.
