App-wsgetmail
view release on metacpan or search on metacpan
# NAME
App::wsgetmail - Fetch mail from the cloud using webservices
# SYNOPSIS
Run:
wsgetmail [options] --config=wsgetmail.json
where `wsgetmail.json` looks like:
{
"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,
"size_limit": 10485760,
"body_size_limit": 1048576,
"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"
}
Using App::wsgetmail as a library looks like:
my $getmail = App::wsgetmail->new({config => {
# The config hashref takes all the same keys and values as the
# command line tool configuration JSON.
}});
while (my $message = $getmail->get_next_message()) {
$getmail->process_message($message)
or warn "could not process $message->id";
}
# DESCRIPTION
wsgetmail retrieves mail from a folder available through a web services API
and delivers it to another system. Currently, it only knows how to retrieve
mail from the Microsoft Graph API, and deliver it by running another command
on the local system.
# INSTALLATION
perl Makefile.PL
make
make test
sudo make install
`wsgetmail` will be installed under `/usr/local/bin` if you're using the
system Perl, or in the same directory as `perl` if you built your own.
# ATTRIBUTES
## config
A hash ref that is passed to construct the `mda` and `client` (see below).
## mda
An instance of [App::wsgetmail::MDA](https://metacpan.org/pod/App%3A%3Awsgetmail%3A%3AMDA) created from our `config` object.
## client\_class
The name of the App::wsgetmail package used to construct the
`client`. Default `MS365`.
## client
An instance of the `client_class` created from our `config` object.
# METHODS
## process\_message($message)
Given a Message object, retrieves the full message content, delivers it
using the `mda`, and then executes the configured post-fetch
action. Returns a boolean indicating success.
## post\_fetch\_action($message)
( run in 0.689 second using v1.01-cache-2.11-cpan-f889d44b568 )