# Pandora Imap # Introduction **Ver.** 12-07-2022 Plug-in with which you can filter mails and the number of mails that match the filters used. **Type**: Server or agent plug-in # Compatibility matrix
**Systems where tested** | Fedora |
**Systems where it should work** | Any linux system |
--server | Example: outlook.office365.com |
--user | User's e-mail address |
--password | User password |
--list | To list all mailboxes |
--mailbox | To choose mailbox to filter on (Inbox by default) |
--subject | To filter word or phrase in the subject. |
--from\_mail | To filter by e-mail |
--date | To filter from a certain date (example: '2020,1,1') |
--body | To filter by a word in the body |
--mail\_list | To create a new module with a list of matching mails. |
--tentacle\_port | Tentacle port in case you want to send the data in this way |
--tentacle\_address | Tentacle address in case you want to send the data in this way |
--agent\_name | Name of the agent that will contain the modules |
-g,--group | Target group in pandora |
--data\_dir | Data destination address |
--as\_agent\_plugin | Agent mode when activated with a 1 |
The user and password will only need to be entered the first time, in a manual execution, then a file will be created that will store the encrypted credentials and the plugin will read them from this file.
`` ``` python3 pandora_imap.py --serverRemember that the recommended path for the use of the server plugins is: /usr/share/pandora\_server/util/plugin/
[](https://pandorafms.com/guides/public/uploads/images/gallery/2022-07/image-1659089658886.png)Remember that you must run the plugin manually with user and password for the first time to create an imap\_credentials.txt file that will save the encrypted credentials.
And in plugin parameters we will introduce these followed by the macro "\_field<N>\_", the mandatory ones for the plugin to work are --server, (--user, --password must be introduced in a first manual execution only the first time) and at least one of the parameters used for filtering.Although it is not mandatory, the use of the --agent\_name parameter is highly recommended, since it allows us to customize the name of the agent that will contain the created modules.
**--SERVER** [](https://pandorafms.com/guides/public/uploads/images/gallery/2022-07/image-1658834684259.png) **--SUBJECT** [](https://pandorafms.com/guides/public/uploads/images/gallery/2022-07/image-1658834761517.png) **--BODY** [](https://pandorafms.com/guides/public/uploads/images/gallery/2022-07/image-1658834783278.png) Once this is done, we will click on "create". Once this is done, the only thing left to do is to call it, so we will go to some agent's view and create an add-in module: [](https://pandorafms.com/guides/public/uploads/images/gallery/2022-03/image-1646741530197.png) We will give it a name and in the section "plugin" we will put the one we have just configured. [](https://pandorafms.com/guides/public/uploads/images/gallery/2022-07/image-1658834560870.png) Once this is done, click on create. If the module is shown with 1, it means that it is running correctly. # Modules generated by the plugin The plugin will create a module called "Coincidences\_count" with the number of coincidences and if the ``--mail\_list`` parameter is used it will also create a module with a list of coincidences. [](https://pandorafms.com/guides/public/uploads/images/gallery/2022-07/image-1658831113098.png) **List module view** [](https://pandorafms.com/guides/public/uploads/images/gallery/2022-07/image-1658831122550.png)