Commit 8627553b authored by Zied SELLAMI's avatar Zied SELLAMI
Browse files

Update README.md

parent 33b368cd
Priority-Inbox
# Priority-Inbox Module
The priority-inbox is a maven java projet. This module allows to assign to an email a category (**IMPORTANT, TO_READ or NOTIFICATION**) and a score. The priority-inbox is based on a set of generic rules.
The priority-inbox is a java projet. This module allows to assign to an email a category (IMPORTANT, TO_READ or NOTIFICATION) and a score. The priority-inbox is based on a set of generic rules.
The tools is a rest-api that compute the category and a score from a email json file.
### Supported categories
1. **IMPORTANT**: is returned if the email is important. **14 generic rules** are implemented to indicate if an email is important or not. For instance, we analyse the signature of the email. An email will be considered important if its sender (from) is the CEO of a company or a Director of a Department. An email is important if the body contains many thread (many replies) or many forwards.
3. **NOTIFICATION**: is returned if the email is a notification email. For instance a chat notification, a social media notification or each email with a not-reply email.
4. **TO_READ**: if the email is not **IMPORTANT** and not a **NOTIFICATION**
# Running the service with Docker
## Building the image
```
wget https://ci.linagora.com/zsellami/priority-inbox/blob/master/Dockerfile
docker build -t demo:priorityInbox .
```
## Running the image
**The image expose the port 9991 with the IP 0.0.0.0 .** To run the service on a host port do the next instruction:
```
docker run -it -p 5551:9991 demo:priorityInbox
```
## Calling the service
### Keywords extractor service
```
curl -X POST 'http://0.0.0.0:5551/rest/priorityinbox/parsejson -F "file=@/path/to/email.json"
```
Sample of json file :
```
{
"messageId" : "messageId",
"from" : {
"address" : "from@test.com",
"personal" : "first_name last_name"
},
"to" : [ {
"address" : "to1@test.com",
"personal" : "first_name last_name of to1"
} ],
"cc" : [ {
"address" : "cc1@test.com",
"personal" : null
}, {
"address" : "cc2@test.com",
"personal" : "first_name last_name of cc2"
}, {
"address" : "cc3@test.com",
"personal" : "first_name last_name of cc3"
} ],
"bcc" : [ ],
"Received" : "Mon, 28 Jan 2019 07:56:43 +0000",
"Date" : "Mon, 28 Jan 2019 07:56:43 +0000",
"in-Reply-To" : "messageId_in_reply_to",
"subject" : "IMPORTANT: Testing The Priority Inbox",
"body" : "\nDear, \n\n this a test of the priority inbox\n regards, first_name last_name of to1\nDirector Tester",
"attachments" : [{
"file_size" : "243534",
"content_name" : "presentation.pdf",
"content_type" : "APPLICATION/PDF"
}, {
"file_size": "243534",
"content_name" : "APPLICATION/PDF",
"content_type" : "performance.pdf"
}],
"emailFolder" : "INBOX",
"user" : "first_name last_name of to1",
"alternativeAddress" : [ "t1@test.com", "first_name.last_name@test.com" ],
"X-Spam-Flag" : "NO"
}
```
Expected result:
```
{
"category" : "IMPORTANT",
"score" : 4.25
}
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment