OAuth2 wsgetmail subfolders

I installed wsgetmail and in the documentation only one folder level is mentioned: “folder”: “Inbox”.

I use an O365 mailbox and wsgetmail works perfectly.

However I need to use a second level of subfolder, but when I configure “folder”: “clients/test” as I used previously in fetchmail, it gives an error saying that it can’t find the folder.

Is it possible to use subfolders in the configuration?

Thankful of any input on this.

Can you help me my error is Can’t find config file wsgetmail.json at /usr/local/bin/wsgetmail line 72.


You need to create the config file first and indicate it when running wsgetmail:

wsgetmail [options] --config=wsgetmail.json

You can find more information here:

can you help me the step, I already done make wsgetmail.json
“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.


Make sure you are using the latest version of the App::wsgetmail-0.08 module and please check if you have installed all the dependencies indicated on this site:

My configuration file looks like this:

“client_id”: “abcd1234-xxxx-xxxx-xxxx-1234abcdef99”,
“tenant_id”: “abcd1234-xxxx-xxxx-xxxx-123abcde1234”,
“secret”: “abcde1fghij2klmno3pqrst4uvwxy5~0”
“global_access”: 1,
“username”: “rt-comment@example.com”,
“folder”: “inbox”,
“stripcr”: 0,
“command”: “/opt/rt5/bin/rt-mailgate”,
“command_args”: “–url=http://rt.example.com/ --queue=General --action=comment”,
“command_timeout”: 30,
“action_on_fetched”: “mark_as_read”

My installation is done ,

perl Makefile.PL
make test
sudo make install

Please see error below

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

Looks to me like you might have “smart quotes” in that config file, rather than normal double quotes (they look similar but they’re different characters). Try replacing all the smart quotes with ordinary double quotes in a text editor (not a “smart” word processor, nor cut-n-paste, which can result in these smart quotes appearing).