Filter, tag, and organize your emails locally with privacy perserving LLMs.
This guide will help you set up your own Google API client and configure the gmail_spam_filter.py
to use the Gmail API for filtering or classifying emails using a locally hosted LLM.
- Go to the Google Developers Console.
- Create a new project by clicking on the "New Project" button.
- Enter a project name and click "Create".
- Once the project is created, select it from the project list.
- Navigate to the "Credentials" section in the sidebar.
- Click on "Create credentials" and select "OAuth client ID".
- If prompted, configure the consent screen by entering the required information and save it.
- Select "Web application" as the application type.
- Add a name for your OAuth 2.0 client and click "Create".
- Your client ID and client secret will be displayed. Download the JSON file containing these credentials.
- In the Google Developers Console, select your project.
- Go to the "Library" section in the sidebar.
- Search for "Gmail API" and select it.
- Click on the "Enable" button to enable the Gmail API for your project.
- Ensure you have the latest version of the Ollama Email Filter package installed by running
pip install .
in the root directory of the project. - Rename the downloaded JSON file containing your OAuth 2.0 credentials to
google_cred.json
. - Place the
google_cred.json
file in theetc
directory located in the same directory as yourgmail_spam_filter.py
script. - If the
etc
directory does not exist, create it at the same level asgmail_spam_filter.py
.
Actively seeking contributions to extend the functionality of the Ollama Email Filter. If you're interested in contributing, here are some areas where we'd love your help:
-
Microsoft Outlook Integration: Develop a provider similar to
GmailProvider
that interfaces with Microsoft Outlook, allowing users to filter and classify emails within Outlook. -
POP3/IMAP Support: Implement support for email accounts that use POP3 or IMAP protocols, expanding the range of email services that can be used.
-
Additional Classification Actions: Create new actions for classifying emails into categories beyond sales or promotion, such as personal, work-related, or spam from different categories.
If you would like to contribute to any of these areas, please fork the repository, make your changes, and submit a pull request. For more information on how to contribute, please see CONTRIBUTING.md
file.