Plugins

You can make plugins for both the mailbagit format parsers and derivatives classes. This allows you to easily override the behavior for how mailbagit reads email exports or creates derivative formats. New input and derivative formats may also be provided to mailbagit to extend its functionality.

The files that can be overridden can be found in the Github repo in the mailbagit/formats and mailbagit/derivatives subdirectories.

By default, mailbagit will look for formats in the following places:

  1. a formats or derivatives subdirectory within a directory specified in the MAILBAG_PLUGIN_DIR environment variable.

    Unix Example:

         mkdir ~/myplugindir
         mkdir ~/myplugindir/formats
         touch ~/myplugindir/formats/pst.py
         export MAILBAGIT_PLUGIN_DIR=$HOME/myplugindir
    
  2. .mailbagit/formats and .mailbagit/derivatives subdirectories in the user’s home directory.

    Unix Example:

         mkdir ~/.mailbagit/derivatives
         touch ~/.mailbagit/derivatives/pdf.py
    

    Example Windows path:

     C:\Users\[my_username]\.mailbagit\formats\imap.py
    
  3. The formats and derivatives built into mailbagit.