Download the PHP package mlocati/tbfilters2gmail without Composer

On this page you can find all versions of the php package mlocati/tbfilters2gmail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tbfilters2gmail

Thunderbird to Gmail library

This library helps you copying Thunderbird filters to Gmail.

Introduction

Thunderbird saves email filters in a file named msgFilterRules.dat. This library can read this file, and create automatically the required folders and filters in a Gmail account.

Requirements

Locate the msgFilterRules.dat file

You need to know where Thunderbird saves the msgFilterRules.dat file. In order to do that, open Thunderbird and:

  1. show the menu (use the ALT-F keys)
  2. under the Tools menu, choose Account Settings
  3. in the left list, choose the Server Settings item under the account name
  4. in the right pane, you'll see the Message Storage section: the folder containing the file msgFilterRules.dat should be the one specified in the Local Directory field

Create a Gmail Service account

You need a Gmail service account in order to use this library. Here's the complete list of steps required to correctly create and configure it:

  1. create a Google project
    1. go to the Google Cloud Platform dashboard page
    2. create a new project
  2. enable the Gmail API
    1. go to the Google Cloud Platform dashboard page
    2. from the menu, choose APIs & ServicesLibrary
    3. search for Gmail API and enable them for the project created above
  3. create a Service Account
    1. go to the Google Cloud Platform dashboard page
    2. from the menu, choose IAM & AdminService Accounts
    3. click the + Create service account button
      1. in the Step 1, enter any name/description you like
      2. in the Step 2, choose the Owner Role (Full access to all resources.)
      3. in the Step 3, you can leave the default (empty) values
    4. in the Service Account list, choose the Create key action for the newly created service account
      1. download the key in JSON format
      2. save the .json file in a secure location
    5. in the Service Account list, choose the Edit action for the newly created service account
      1. in the Service account status section, click the Show domain-wide delegation
      2. check the Enable G Suite Domain-wide Delegation option
      3. save
  4. grant the required OAuth scopes
    1. go to the Google Admin page
    2. from the menu, choose SecurityAPI Controls
    3. in the Domain wide delegation section, click the Manage domain wide delegation link
    4. add a new API client
      1. in the Client ID field enter the number associated to the client_id key in the .json file you downloaded above
      2. you have to specify these OAuth scopes (here you can find all the available scopes):
        • https://www.googleapis.com/auth/gmail.labels (required to manage the folders of the Gmail accounts)
        • https://www.googleapis.com/auth/gmail.settings.basic (required to manage the filters of the Gmail accounts)

Sample usage

Let's assume that:

With the above data, you can copy the Thunderbird filters to Gmail with a few lines of code like these:

Ad this point, you should have the Thunderbird filters available in Gmail.

Known issues

How to delete all the Gmail filters and/or folders

If you want to test this library, you may need to delete all the existing Gmail filters and/or folders. You can do that with this code (we assume that the $client variable is initialized as described in the Sample usage section above)


All versions of tbfilters2gmail with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8
google/apiclient Version ^2.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mlocati/tbfilters2gmail contains the following files

Loading the files please wait ....