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:
-
a
formatsorderivativessubdirectory within a directory specified in theMAILBAG_PLUGIN_DIRenvironment variable.Unix Example:
mkdir ~/myplugindir mkdir ~/myplugindir/formats touch ~/myplugindir/formats/pst.py export MAILBAGIT_PLUGIN_DIR=$HOME/myplugindir -
.mailbagit/formatsand.mailbagit/derivativessubdirectories in the user’s home directory.Unix Example:
mkdir ~/.mailbagit/derivatives touch ~/.mailbagit/derivatives/pdf.pyExample Windows path:
C:\Users\[my_username]\.mailbagit\formats\imap.py -
The formats and derivatives built into mailbagit.