OAuth2 wsgetmail setup

Currently have installed teh wsgetmail, and setup the O365 side. Im able to connect to O365 but have been stuck with the following error message that I have not been able to resolve. I recieve this only if the mailbox has new emails. Normally if the mailbox is empty then it runs and gives me the processed 0 message.

/usr/local/bin$ wsgetmail --config=wsgetmail.json

fetching mail using configuration wsgetmail.json
failed to run command "/opt/rt5/bin/rt-mailgate " for file /tmp/tX6vc9hJDI.mime : 19200 at /usr/local/share/perl/5.30.0/App/wsgetmail/MDA.pm line 204.


I get the same failed message. Any solutions?

Finally have been able to get this working, by using the wsgetmail --debug --dry-run --config=wsgetmail.json command I realized the name of the queue was the problem in my case. Our queue in the fetchmail is “IT Support” and works with fetchmailrc, but wsgetmail will only look for single word IT and errored as a result of the space Support. I modified the queue to IT and the fetchmailrc file and it started to work correctly.