Fetch email from o365 - modern way

Do you have the “wsgetmail.json” file and is should be in the same directory as the services wsgetmail?

can you show me the path?

Where could I get the “wsgetmail.json” file?
After I install this:
perl Makefile.PL
make
make test
sudo make install

Each queue you have needs its own file they can not be combine like you would with fetchmail.

You need to create the file, it does not create the file when you install wsgetmail.

can you give me a example of that file

{
“client_id”: “S E C R E T”,
“tenant_id”: “S E C R E T”,
“secret”: “S E C R E T”,
“global_access”: 1,
“username”: “hrsupport@company.com”,
“folder”: “Inbox”,
“command”: “/opt/rt5/bin/rt-mailgate”,
“command_args”: “–url=https://examplecom/ --queue=General --action=comment”,
“command_timeout”: 30,
“action_on_fetched”: “mark_as_read”
}

this config in my wsgetmail.json example
but have error.

‘"’ expected, at character offset 4 (before “\x{201c}client_id\x{201d}…”) at /usr/local/bin/wsgetmail line 76.

Have you configured the app registration for your exchange? When you perform that you will receive the the client, tenant, secret information. With that info and the email user I’d you need to update the values in the json file you have displayed. Once you enter the correct info in the form you should be able to run it.

Sent from my iPhone

Touchtone Logo.png | Israel Maldonado
Network Support Technician
o 800.900.5474 | f 888.900.2882 | business.support@touchtone.net
www.touchtone.net

|

  • | - |

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

| Romeo_Fulo
January 31 |

  • | - |

{
“client_id”: “S E C R E T”,
“tenant_id”: “S E C R E T”,
“secret”: “S E C R E T”,
“global_access”: 1,
“username”: “hrsupport@company.com”,
“folder”: “Inbox”,
“command”: “/opt/rt5/bin/rt-mailgate”,
“command_args”: “–url=https://examplecom/ --queue=General --action=comment”,
“command_timeout”: 30,
“action_on_fetched”: “mark_as_read”
}

this config in my wsgetmail.json example
but have error.

‘"’ expected, at character offset 4 (before “\x{201c}client_id\x{201d}…”) at /usr/local/bin/wsgetmail line 76.

I’m done with app registration; can you tell me how to input the JSON values? I’m newbie in json.

in the file keep the quotes and replace each secret with the values you recived after the app registration was completed. Enter the correct username for the email account. the command_args should be replace with the same info in your fetchmailrc file.action on fetched i would suggest replace delete so your mailbox does not get full.

Thank you for the assistance.
but I’m getting a new error. I don’t read much in code.

usr/local/share/perl/5.30.0/App/wsgetmail/MS365/Client.pm line 240.
getting system access token at /usr/local/share/perl/5.30.0/App/wsgetmail/MS365/Client.pm line 306.
failed to fetch folder detail 403 Forbidden at /usr/local/share/perl/5.30.0/App/wsgetmail/MS365.pm line 370.
response from server : {“error”:{“code”:“ErrorAccessDenied”,“message”:“Access is denied. Check credentials and try again.”}} at /usr/local/share/perl/5.30.0/App/wsgetmail/MS365.pm line 371.
unable to fetch messages, can’t find folder Inbox at /usr/local/share/perl/5.30.0/App/wsgetmail/MS365.pm line 418.

Those are smart quotes; “ is code point 8220, for example. You need regular quotes, e.g. ", which is code point 34.

You can see it in ipython.

In [1]: hex(ord(‘“’))
Out[1]: ‘0x201c’

In [2]: hex(ord(‘"’))
Out[2]: ‘0x22’

Notice the reference to 0x201c in the error message.

run this command as this give more detail to the problem.

wsgetmail --debug --dry-run --config=wsgetmail.json

This is getting an error on the wsgetmail, but it was working before in my previous set in IMAP.

failed to run command “/opt/rt5/bin/rt-mailgate –url=https://secret/ --queue=General --action=correspond” for file /tmp/Xpffij0H4T.mime : 256 at /usr/local/share/perl/5.30.0/App/wsgetmail/MDA.pm line 206.
output
error:/opt/rt5/bin/rt-mailgate invoked improperly

No ‘url’ provided to mail gateway!

Rt-mailgate is not configured, what was retrieving the email prior to wsgetmail?

Israel Maldonado
TouchTone Communications
973.314.8887

image001.png

but before in IMAP it was working can you guide me in Rt-mailgate configure.

This has finally been successful in working. thank you for your help.

Your welcome, glad you was able to get it to work.

Sent from my iPhone

Touchtone Logo.png | Israel Maldonado
Network Support Technician
o 800.900.5474 | f 888.900.2882 | business.support@touchtone.net
www.touchtone.net

|

  • | - |

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

| Romeo_Fulo
February 2 |

  • | - |

This has finally been successful in working. thank you for your help.

wsgetmail seems to be working but still no email on RT’s site. Here is the screenshot of the debug command


Does anyone have any ideas?