ANVEDI POP3
This communication code unit allows to read mails using the POP3 protocol via the File Exchange Service.
To use this service you need Anvaigo EDI Connect version 5.3.0.4 and the File Exchange Service must be reachable.
Configuration
To configure the communication channel, find it in the EDI Communication Channel List and click on “Configure”. If you’ve just created the channel you might need to refresh the page first.
General
Select or create a new File Exchange Service instance. You have to configure the URL (can be copied from the configuration and is shown on startup if you start the service directly). The default value is http://localhost:7098 and you have to set the API Key corresponding to the configuration file. You can use the server for multiple communication partners.
Specifies how the File Exchange Server shall handle duplicate files. The two options are:
Files with a name that have previously been imported will not be imported again.
Files with a name that have previously been imported will be imported again.
Specifies what to do with the files after the import to Dynamics. The options are:
The files are left in the remote path as they are.
The files are deleted from the remote path.
The files are moved to the remote archive path.
Server
Specifies the address of the mail server.
Specifies the port of the mail server.
Specifies the encryption method to be used. The available options are:
The encryption is automatically negotiated between the File Exchange Service and the remote host. This is the default setting.
No encryption is used.
An encrypted connection is established.
An unencrypted connection is started and the server is asked to continue the communication with encryption.
Specifies how to authenticate at the remote host. The available options are:
Anonymous login is used.
A combination of Username ans Password is used. This is the default setting.
Uses the Exchange OAuth2 method for authentification. See below for more details.
OAuth2
In case you want to use OAuth2 with Exchange 365 you will need to create a new “App registrations” in the Azure portal.
Got to the Azure Portal, search for “App registration” and create a new one. Call it, for example, Anvaigo File Exchange Service. You can leave all the other settings on the default values and click on “Register”. (You can learn more about App regsitrations here: https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app)
Afterwards take a note of the “Application (client) ID” and “Directory (tenant) ID” you’ll need to put these values into the configuration settings of the communication channel.
There is one setting that has to be changed for the new app registrations: Select “Authentication” in the left pane and search for “Allow public client flows”. This has to be enabled to allow the login via the Device ID.
In Dynamics, make sure to select “Exchange OAuth2” as the authorization method. Select “DeviceCode” as the OAuth Method and enter the Tenant ID and Client ID from the portal (this might be different from the Dynamics Tenant ID!).
To login, click on “Authenticate” in the POP3 settings page. You’ll get a URL and DeviceID, which allows you to sign in. Anencrypted token is stored on the File Exchange Server and can be used to get the emails, until the token lifetime has expired. In this case fetching the messages will fail and you have to log in again.
