App-wsgetmail
view release on metacpan or search on metacpan
quickstart](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis#application-permission-to-microsoft-graph),
under the section "Add permissions to access Microsoft Graph." When selecting
the type of permissions, select "Application permissions." When prompted to
select permissions, select the following items:
- Mail.Read
- Mail.ReadWrite
### Configuring client secret authentication
We recommend you deploy wsgetmail by configuring it with a client
secret. Client secrets can be granted limited access to only the mailboxes
you choose. You can adjust or revoke wsgetmail's access without interfering
with other applications.
Microsoft documents how to create a client secret in the ["Register an
application with the Microsoft identity platform"
quickstart](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#add-a-client-secret),
under the section "Add a client secret." Take care to record the secret
token when it appears; it will never be displayed again. It should look like
a completely random string, not a UUID/GUID.
- global\_access
Set this to `1` in your wsgetmail configuration file.
- secret
Set this to the secret token string you recorded earlier in your wsgetmail
configuration file.
- username
wsgetmail will fetch mail from this user's account. Set this to an email
address string in your wsgetmail configuration file.
### Configuring user+password authentication
If you do not want to use a client secret, you can also configure wsgetmail
to authenticate with a traditional username+password combination. As noted
above, this method is not recommended by Microsoft. It also does not work
for systems with federated authentication enabled.
- global\_access
Set this to `0` in your wsgetmail configuration file.
- username
wsgetmail will authenticate as this user. Set this to an email address
string in your wsgetmail configuration file.
- user\_password
Set this to the password string for `username` in your wsgetmail
configuration file.
### Configuring Microsoft Government Cloud
If you are connecting to a Microsoft Government Cloud tenant (GCC High or
DoD), the default Microsoft Graph API and OAuth endpoints will not work. Use
the following options to point wsgetmail at the correct endpoints.
- resource\_url
Set this to the Microsoft Graph API base URL for your cloud environment.
The default is `https://graph.microsoft.com/`. For GCC High, use
`https://graph.microsoft.us/`. For DoD, use
`https://dod-graph.microsoft.us/`.
- login\_base\_url
Set this to the base URL for OAuth authentication. The default is
`https://login.windows.net`. For GCC High and DoD, use
`https://login.microsoftonline.us`.
## Configuring the mail delivery command
Now that you've configured wsgetmail to access a mail account, all that's
left is configuring delivery. Set the following in your wsgetmail
configuration file.
- folder
Set this to the name string of a mail folder to read.
- stripcr
Set this to 1 to make wsgetmail convert the messages from the CRLF
line-ending encoding to the LF line-ending encoding.
This emulates the fetchmail option of the same name, which enabled
the stripcr option if an MDA was declared. The feature is similar,
but you need to enable it explicitly in your configuration.
This option is helpful if you are forwarding email to a Linux
utility that doesn't work with CRLF line-endings.
- size\_limit
Set this to the max size in bytes. Messages bigger than it will be skipped.
Absence or 0 means to not limit size.
E.g. to skip messages bigger than `10MiB`, you can set it to `10485760`.
- body\_size\_limit
Set this to the max body size in bytes. Messages with body bigger than it will
be skipped. Absence or 0 means to not limit body size.
E.g. to skip messages with body bigger than `1MiB`, you can set it to
`1048576`.
The difference between `size_limit` and `body_size_limit` is the former
limits the size of the whole message, while the latter parses messages, skips
attachments and only checks text/plain and text/html parts.
- command
Set this to an executable command. You can specify an absolute path,
or a plain command name which will be found from `$PATH`. For each
email wsgetmail retrieves, it will run this command and pass the
( run in 0.964 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )