Configuration

Python

Measy configuration

Create a file called measy.json in the measy folder. It will have the following sample structure:

{
    "exchange": [{
      "alias": "my_alias",
      "server": "exchange_server.com",
      "username": "exchange_user",
      "password": "exchange_password",
      "email": "exchange_user@exchange_server.com",
      "product_owners": ["admin1@exchange_server.com"],
      "on_unrelated": {
        "action": "trash",
        "recipients": [],
        "subfolder": ""
      },
      "on_success": {
        "action": "trash",
        "recipients": [],
        "subfolder": ""
      },
      "disable_ssl_validation": true
    }],
    "earchive_strings": ["<INVOICE", "<cbc:ProfileID>EARSIVFATURA</cbc:ProfileID>"],
    "puller_module": "measy.puller.multi_exchange_earchive",
    "flask": {
      "active": true,
      "port": 5000
    },
    "sap": {
      "wsdl_link": "http://my_sap_server.com/sap/bc/srt/wsdl/bndg_EAF67B21AA6BD4F1AA73000C29B7663D/wsdl11/allinone/ws_policy/document?sap-client=100",
      "binding_address": "http://my_sap_server.com/sap/bc/srt/rfc/sap/zd3v_measy_sd_mail/100/zd3v_measy_mail/zd3v_measy_mail",
      "username": "my_sap_user",
      "password": "my_sap_password"
    }
}

Modify the values to match your own values. Note that Measy supports multiple Exchange accounts.

Most of the fields are very intuitive. on_unrelated and on_success requires special attention though. The first one determines the fate of unrelated E-Mails in the inbox. The second one determines the fate of a successfully received E-Archive E-Mail message. action should be filled with one of the following values:

  • An empty value tells Measy to do nothing. This may make sense for unrelated E-Mails.
  • delete: Deletes the E-Mail completely.
  • trash: Puts the E-Mail into the trash folder.
  • forward: Forwards the E-Mail to the accounts defined in recipients.
  • move_to_inbox_subfolder: Moves the E-Mail to the inbox subfolder defined in subfolder.
  • move_to_root_subfolder: Moves the E-Mail to the root subfolder defined in subfolder.

Being a Databus implementation, Measy can run on either local JSON files or an SQL Server database.

Out of the box, the application will run on local JSON files.

If you prefer to run it on SQL Server, you need to modify main.py accordingly. Check Databus documentation for details.

Databus configuration

Assuming that you will run the application on local JSON files, create the folder structure: measy/data/json_db/clients/my_client. "my_client" symbolizes the name of your company, you can pick another name (preferably without spaces).

Edit main.py so that the literals on DispatcherTicket matches your my_client value; replacing the default "ecztug" value.

    dispatcher_ticket = DispatcherTicket(
        p_run_web_server=flask_active,
        p_web_server_port=flask_port,
        p_external_config_files=[
            ExternalConfigFile("ecztug", "measy", path.join(databus.get_root_path(), "measy.json"))
        ],
        p_system_alias=alias
    )

Create two subfolders:

  • measy/data/json_db/clients/my_client/log

  • measy/data/json_db/clients/my_client/pqueue

Create a file called measy/data/json_db/clients/my_client/config.json , which has the following structure:

{
  "log_life_span": 1,
  "passengers": [
    {
      "name": "measy.passenger.email_earchive",
      "pullers": [ "measy.puller.multi_exchange_earchive" ],
      "queue": "databus.pqueue.primal_queue",
      "processors": [ "measy.processor.earchive_filter" ],
      "pushers": [ "measy.pusher.sap_earchive" ],
      "sync_frequency": 1,
      "queue_life_span": 1
    }
  ]
}

Here, you can alter the numeric values to change the behavior of Databus.

  • log_life_span : (days) For how many days should the log files be kept on the server?

  • sync_frequency : (minutes) How often should Measy check the Exchange accounts

  • queue_life_span : (days) For how many days should the finished queue entries be kept on the server?


ABAP

ABAP components need to be configured on your SAP system manually. You can contact us for that.