### Docker Setup for Mailbagit Source: https://github.com/ualbanyarchives/mailbagit/blob/main/README.md Pulls the Mailbagit Docker image and sets up a docker-compose file for running the tool. It then starts the mailbagit service and checks its version. ```bash docker pull ualbanyarchives/mailbagit wget https://raw.githubusercontent.com/UAlbanyArchives/mailbagit/main/docker-compose.yml docker compose run mailbagit mailbagit -v ``` -------------------------------- ### Mailbagit Development Setup Source: https://github.com/ualbanyarchives/mailbagit/blob/main/README.md Clones the Mailbagit repository, switches to the develop branch, and installs the package in editable mode. ```bash git clone git@github.com:UAlbanyArchives/mailbagit.git cd mailbagit git switch develop pip install -e . ``` -------------------------------- ### Install Mailbagit Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md Install the core mailbagit package using pip. This is the basic installation command. ```bash pip install mailbagit ``` -------------------------------- ### Install Mailbagit with GUI Support Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md Install mailbagit with the extra dependencies required for the Graphical User Interface (GUI). ```bash pip install 'mailbagit[gui]' ``` -------------------------------- ### Setup Speaker Notes UI Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Initializes references to the DOM elements used for displaying speaker notes. ```javascript function setupNotes() { notes = document.querySelector( '.speaker-controls-notes' ); notesValue = document.querySelector( '.speaker-controls-notes .value' ); } ``` -------------------------------- ### Install Mailbagit Source: https://github.com/ualbanyarchives/mailbagit/blob/main/README.md Installs the mailbagit package. Use the `[pst]` extra for PST file support and `[gui]` for the graphical user interface. ```bash pip install mailbagit ``` ```bash pip install mailbagit[pst] ``` ```bash pip install mailbagit[gui] ``` -------------------------------- ### Mailbagit Input Examples Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Demonstrates mailbagit's flexibility in accepting paths to individual files or directories for various email formats. ```bash mailbagit path/to/account --mailbag-name account -i eml -d pdf mailbagit path/to/account.pst --mailbag-name account -i pst -d eml pdf mailbagit path/to/email.msg --mailbag-name email -i msg -d pdf mailbagit path/to/account.mbox -m account -i mbox -d eml mailbagit path/to/email -m email -i mbox -d pdf ``` -------------------------------- ### Test Chrome Headless Installation (Linux/macOS) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/pdf.md Confirm that Chrome is installed and added to your PATH by attempting to launch it with a URL. This command should open a Chrome browser window. ```bash chrome https://archives.albany.edu/mailbag ``` ```bash google-chrome https://archives.albany.edu/mailbag ``` ```bash Google\ Chrome https://archives.albany.edu/mailbag ``` -------------------------------- ### Install mailbagit with pip Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/index.html Install the mailbagit package using pip. For non-Windows users, install with PST support. ```bash pip install mailbagit pip install 'mailbagit[pst]' ``` -------------------------------- ### Install Mailbagit GUI Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Installs the graphical user interface components for mailbagit. Note that this may cause issues on Linux and might require a specific wxPython installation first. ```bash pip install mailbagit[gui] ``` -------------------------------- ### Create Custom Plugin Directory in Home (Unix) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/plugins.md This example demonstrates creating custom derivative format plugins in the default .mailbagit/derivatives directory within a user's home directory on Unix-like systems. ```bash mkdir ~/.mailbagit/derivatives touch ~/.mailbagit/derivatives/pdf.py ``` -------------------------------- ### Setup Speaker View Layout Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Initializes the speaker view layout by populating a dropdown with available layouts and setting up an event listener to change the layout. ```javascript function setupLayout() { layoutDropdown = document.querySelector( '.speaker-layout-dropdown' ); layoutLabel = document.querySelector( '.speaker-layout-label' ); // Render the list of available layouts for( var id in SPEAKER_LAYOUTS ) { var option = document.createElement( 'option' ); option.setAttribute( 'value', id ); option.textContent = SPEAKER_LAYOUTS[ id ]; layoutDropdown.appendChild( option ); } // Monitor the dropdown for changes layoutDropdown.addEventListener( 'change', function( event ) { setLayout( layoutDropdown.value ); }, false ); // Restore any currently persisted layout setLayout( getLayout() ); } ``` -------------------------------- ### Custom Plugin Path (Windows) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/plugins.md This example shows the typical path structure for custom format plugins in the user's home directory on a Windows system. ```text C:\Users\[my_username]\.mailbagit\formats\imap.py ``` -------------------------------- ### Test wkhtmltopdf Installation Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/pdf.md Verify that wkhtmltopdf is installed and accessible in your system's PATH by checking its version. ```bash wkhtmltopdf -V ``` ```bash wkhtmltopdf.exe -V ``` -------------------------------- ### Test Chrome Headless Installation (Windows) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/pdf.md Verify that Chrome is installed and accessible in your system's PATH on Windows. Executing this command should open a Chrome browser window to the specified URL. ```bash chrome.exe https://archives.albany.edu/mailbag ``` -------------------------------- ### Install Pipenv (Alternative) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Alternative commands to install pipenv if the primary command fails or for specific Python versions. Ensures pipenv is available for your Python installation. ```bash pip3 install pipenv python -m pip install pipenv python3 -m pip install pipenv ``` -------------------------------- ### Mailbagit MBOX Input Example Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Shows the expected structure of input MBOX files for mailbagit processing. Mailbagit ignores files without the .mbox extension. ```text path/to/parentDirectory/Inbox.mbox path/to/parentDirectory/Inbox/Listservs.mbox path/to/parentDirectory/Trash.mbox path/to/parentDirectory/otherFile.docx ``` -------------------------------- ### Bag-info.txt Metadata Example Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/index.html An example of the metadata typically found in a bag-info.txt file, detailing the mailbag's properties and the agents used for its creation. ```text Bag-Size: 34 MB Bag-Software-Agent: bagit.py v1.8.1 Bag-Type: Mailbag Bagging-Date: 2022-05-26 Bagging-Timestamp: 2022-05-26T16:15:48 EML-Agent: email EML-Agent-Version: 3.9.12 External-Identifier: adeb0ab6-59b8-494c-be6a-de066f5c8f23 MSG-Agent: extract_msg MSG-Agent-Version: 0.30.12 Mailbag-Agent: mailbagit Mailbag-Agent-Version: 0.2.1 Mailbag-Source: msg Mailbag-Specification-Version: 0.3 Original-Included: True PDF-Agent: wkhtmltopdf PDF-Agent-Version: wkhtmltopdf 0.12.6 (with patched qt) Payload-Oxum: 36529495.87 WARC-Agent: warcio WARC-Agent-Version: 1.7.4 ``` -------------------------------- ### Install Mailbagit with PST Support Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md Install mailbagit with the extra dependencies required for working with PST files. This includes the libpff-python library. ```bash pip install 'mailbagit[pst]' ``` -------------------------------- ### Install Specific wxPython Version on Ubuntu Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md Install a specific version of wxPython for Ubuntu 20.04 to resolve potential installation issues with the mailbagit GUI. This command is used when the default 'pip install mailbagit[gui]' fails. ```bash pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython ``` -------------------------------- ### Logger Initiation and Usage in Python Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/logging.md Demonstrates how to initialize and use the Mailbagit logger in Python. Ensure 'mailbagit.loggerx' is imported and configured before getting the logger instance. ```python from structlog import get_logger import mailbagit.loggerx loggerx.configure() log = get_logger() log.error("Error message here") log.info("Information message here") ``` -------------------------------- ### Mailbagit PST Input Example Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Shows the expected structure of input PST files for mailbagit processing. Ensure your PST files are organized within the specified parent directory. ```text path/to/parentDirectory/faculty/Dave.pst path/to/parentDirectory/faculty/Fatima.pst path/to/parentDirectory/staff/Eric.pst path/to/parentDirectory/staff/save.pst path/to/parentDirectory/otherFile.docx ``` -------------------------------- ### Build Windows Executables Source: https://github.com/ualbanyarchives/mailbagit/blob/main/release.md Compiles Windows executable versions of Mailbagit using PyInstaller. This includes the core CLI, GUI, and guided installer. ```bash pyinstaller mailbagit.spec pyinstaller mailbagit-gui.spec pyinstaller mailbagit-guided.spec ``` -------------------------------- ### Run Mailbagit Command Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Executes the mailbagit command-line tool to display its version. Useful for verifying the installation and checking the installed version. ```bash mailbagit -v ``` -------------------------------- ### Input mbox files for processing Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples This is the input file list for the command in Example 4. It specifies the .mbox files to be processed. ```text path/to/parentDirectory/Dave/inbox.mbox path/to/parentDirectory/Dave/trash.mbox path/to/parentDirectory/Fatima/inbox.mbox path/to/parentDirectory/Fatima/listservs.mbox ``` -------------------------------- ### Retry PST Installation after Setting Environment Variables Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md Retry installing mailbagit with PST support after setting the necessary environment variables on Windows. ```bash pip install mailbagit[pst] ``` -------------------------------- ### Install Pipenv Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Installs pipenv, a tool for managing Python virtual environments and dependencies. Use this to create isolated environments for your projects. ```bash pip install pipenv pipenv shell ``` -------------------------------- ### Mailbagit MBOX to PDF Conversion Example Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Demonstrates converting MBOX files to PDF format, organizing output by message path and derivative type. Use this for processing mail folders stored in MBOX format. ```bash mailbagit path/to/parentDirectory -m account_export -i mbox -d pdf ``` -------------------------------- ### Mailbagit PST Output Example Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Illustrates the directory structure and files generated after processing PST inputs. Note the organization into metadata files, original data, and derivative formats like PDF. ```text path/to/parentDirectory/allfacstaff/bagit.txt path/to/parentDirectory/allfacstaff/bagit.txt path/to/parentDirectory/allfacstaff/mailbag.csv ... path/to/parentDirectory/allfacstaff/data/pst/faculty/Dave.pst path/to/parentDirectory/allfacstaff/data/pst/faculty/Fatima.pst path/to/parentDirectory/allfacstaff/data/pst/staff/Eric.pst path/to/parentDirectory/allfacstaff/data/pst/staff/save.pst path/to/parentDirectory/allfacstaff/data/pdf/faculty/Dave/Top of Outlook data file/Inbox/1.pdf path/to/parentDirectory/allfacstaff/data/pdf/faculty/Dave/Top of Outlook data file/Inbox/Listservs/2.pdf path/to/parentDirectory/allfacstaff/data/pdf/faculty/Fatima/Top of Outlook data file/Inbox/3.pdf path/to/parentDirectory/allfacstaff/data/pdf/staff/Eric/Top of Outlook data file/Inbox/4.pdf path/to/parentDirectory/allfacstaff/data/pdf/staff/save/Top of Outlook data file/Save/5.pdf path/to/parentDirectory/otherFile.docx ``` -------------------------------- ### Mailbagit MBOX Output Example Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Illustrates the directory structure and files generated after processing MBOX inputs. Note the organization into metadata files, original data, and derivative formats like EML and PDF. ```text path/to/parentDirectory/account_export/bagit.txt path/to/parentDirectory/account_export/bagit.txt path/to/parentDirectory/account_export/mailbag.csv ... path/to/parentDirectory/account_export/data/mbox/Inbox/Inbox.mbox path/to/parentDirectory/account_export/data/mbox/Inbox/Listservs/Inbox/Listservs.mbox path/to/parentDirectory/account_export/data/mbox/Trash/Trash.mbox path/to/parentDirectory/account_export/data/eml/Inbox/Inbox/1.eml path/to/parentDirectory/account_export/data/eml/Inbox/Inbox/2.eml path/to/parentDirectory/account_export/data/eml/Inbox/Listservs/Inbox/Listservs/3.eml path/to/parentDirectory/account_export/data/eml/Inbox/Listservs/Inbox/Listservs/4.eml path/to/parentDirectory/account_export/data/eml/Trash/Trash/5.eml path/to/parentDirectory/account_export/data/pdf/Inbox/Inbox/1.pdf path/to/parentDirectory/account_export/data/pdf/Inbox/Inbox/2.pdf path/to/parentDirectory/account_export/data/pdf/Inbox/Listservs/Inbox/Listservs/3.pdf path/to/parentDirectory/account_export/data/pdf/Inbox/Listservs/Inbox/Listservs/4.pdf path/to/parentDirectory/account_export/data/pdf/Trash/Trash/5.pdf path/to/parentDirectory/otherFile.docx ``` -------------------------------- ### Mailbagit PST to PDF Conversion Example Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Demonstrates converting PST files to PDF format, organizing output by message path and derivative type. Use this for processing Outlook data files. ```bash mailbagit path/to/parentDirectory -m allfacstaff -i pst -d pdf ``` -------------------------------- ### Setup Heartbeat for Connection Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Establishes a recurring heartbeat signal to maintain connection with the main presentation window, crucial for handling reloads. ```javascript function setupHeartbeat() { setInterval( () => { window.opener.postMessage( JSON.stringify({ namespace: 'reveal-notes', type: 'heartbeat'}), '*' ); }, 1000 ); } ``` -------------------------------- ### Setup and Update Timer Display Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Initializes the timer and clock elements, then updates them every second. It fetches slide timings to enable pacing display. ```javascript function setupTimer() { var start = new Date(), timeEl = document.querySelector( '.speaker-controls-time' ), clockEl = timeEl.querySelector( '.clock-value' ), hoursEl = timeEl.querySelector( '.hours-value' ), minutesEl = timeEl.querySelector( '.minutes-value' ), secondsEl = timeEl.querySelector( '.seconds-value' ), pacingTitleEl = timeEl.querySelector( '.pacing-title' ), pacingEl = timeEl.querySelector( '.pacing' ), pacingHoursEl = pacingEl.querySelector( '.hours-value' ), pacingMinutesEl = pacingEl.querySelector( '.minutes-value' ), pacingSecondsEl = pacingEl.querySelector( '.seconds-value' ); var timings = null; getTimings( function ( _timings ) { timings = _timings; if (_timings !== null) { pacingTitleEl.style.removeProperty('display'); pacingEl.style.removeProperty('display'); } // Update once directly _updateTimer(); // Then update every second setInterval( _updateTimer, 1000 ); } ); function _resetTimer() { if (timings == null) { start = new Date(); _updateTimer(); } else { // Reset timer to beginning of current slide getTimeAllocated( timings, function ( slideEndTimingSeconds ) { var slideEndTiming = slideEndTimingSeconds * 1000; callRevealApi( 'getSlidePastCount', [], function ( currentSlide ) { var currentSlideTiming = timings[currentSlide] * 1000; var previousSlidesTiming = slideEndTiming - currentSlideTiming; var now = new Date(); start = new Date(now.getTime() - previousSlidesTiming); _updateTimer(); } ); } ); } } timeEl.addEventListener( 'click', functio ``` -------------------------------- ### Run mailbagit Docker image directly Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/docker.md Start the mailbagit Docker image as a container and access its bash shell. This command allows interactive use but requires manual filesystem mounting for data access. ```bash docker run -it ualbanyarchives/mailbagit:latest bash ``` -------------------------------- ### Mailbagit PST Input Command Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Example command for processing a PST file with mailbagit, specifying input and derivative formats. ```bash mailbagit path/to/account.pst --mailbag-name allfacstaff --input pst --derivatives eml pdf ``` -------------------------------- ### Input files for single mbox processing Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples This is the input for Example 5, specifying a single mbox file and another file to be ignored. Mailbagit ignores files without the .mbox extension. ```text path/to/All mail Including Spam and Trash.mbox path/to/otherFile.docx ``` -------------------------------- ### Handling directories with mixed file types Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples This example highlights a scenario where a directory contains both .msg files and other file types (e.g., .docx). Mailbagit includes these other files but does not document them in mailbag.csv or use them for derivative creation. ```text path/to/parentDirectory/Inbox/message1.msg path/to/parentDirectory/Inbox/message2.msg --> path/to/parentDirectory/Inbox/otherFile.docx path/to/parentDirectory/Inbox/Listservs/message1.msg path/to/parentDirectory/Inbox/Listservs/message2.msg path/to/parentDirectory/Inbox/Listservs/Code4Lib/message1.msg path/to/parentDirectory/Inbox/Listservs/Code4Lib/message2.msg path/to/parentDirectory/Trash/spam.msg ``` -------------------------------- ### Set MAILBAG_PLUGIN_DIR Environment Variable (Unix) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/plugins.md This example shows how to create a custom plugin directory and set the MAILBAG_PLUGIN_DIR environment variable on Unix-like systems. This directs Mailbagit to look for custom formats in the specified directory. ```bash mkdir ~/myplugindir mkdir ~/myplugindir/formats touch ~/myplugindir/formats/pst.py export MAILBAGIT_PLUGIN_DIR=$HOME/myplugindir ``` -------------------------------- ### Build and Push Dev Docker Image Source: https://github.com/ualbanyarchives/mailbagit/blob/main/release.md Builds the development Docker image and pushes it to the registry. Use `--no-cache` to ensure a clean build. ```bash docker build --no-cache -t ualbanyarchives/mailbagit:dev . docker push ualbanyarchives/mailbagit:dev ``` -------------------------------- ### Build and Push to PyPI Source: https://github.com/ualbanyarchives/mailbagit/blob/main/release.md Builds the distribution packages for PyPI and uploads them using Twine. Ensure you have distribution files in the 'dist/' directory. ```bash python -m build twine upload dist/*.gz dist/*.whl ``` -------------------------------- ### Format and Test Code Locally Source: https://github.com/ualbanyarchives/mailbagit/blob/main/branching_workflow.md Run the code formatter and the test suite to ensure code quality and correctness before pushing changes. ```bash black . pytest ``` -------------------------------- ### Mailbag.csv Headers Example Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/index.html Displays the header row for a mailbag.csv file, outlining the columns that contain metadata about each message. ```text Error Mailbag-Message-ID Message-ID Original-File Message-Path Derivatives-Path Attachments (int) Date From To Cc Bcc Subject Content-Type ``` -------------------------------- ### Validate Mailbag using bagit-python Source: https://github.com/ualbanyarchives/mailbagit/blob/main/README.md Validates a created mailbag using the bagit-python command-line tool. Ensure bagit-python is installed. ```bash bagit.py --validate /path/to/mailbag ``` -------------------------------- ### Initialize Speaker View Slides Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Sets up the current and upcoming slide iframes for the speaker view. Ensures the correct dimensions and sources are applied. ```javascript var currentSlide = document.createElement( 'iframe' ); currentSlide.setAttribute( 'width', 1280 ); currentSlide.setAttribute( 'height', 1024 ); currentSlide.setAttribute( 'src', currentURL ); document.querySelector( '#current-slide' ).appendChild( currentSlide ); upcomingSlide = document.createElement( 'iframe' ); upcomingSlide.setAttribute( 'width', 640 ); upcomingSlide.setAttribute( 'height', 512 ); upcomingSlide.setAttribute( 'src', upcomingURL ); document.querySelector( '#upcoming-slide' ).appendChild( upcomingSlide ); whitelistedWindows.push( currentSlide.contentWindow, upcomingSlide.contentWindow ); ``` -------------------------------- ### Reveal.js Initialization Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Initializes the Reveal.js presentation framework with default options, merged with query string options and a specific transition setting. This code is responsible for setting up the slide deck. ```javascript function extend() { var target = {}; for (var i = 0; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (source.hasOwnProperty(key)) { target[key] = source[key]; } } } return target; } // default options to init reveal.js var defaultOptions = { controls: true, progress: true, history: true, center: true, transition: 'default', // none/fade/slide/convex/concave/zoom plugins: [ RevealMarkdown, RevealHighlight, RevealZoom, RevealNotes, RevealMath ] }; // options from URL query string var queryOptions = Reveal().getQueryHash() || {}; var options = extend(defaultOptions, {"transition":"fade"}, queryOptions); Reveal.initialize(options); ``` -------------------------------- ### Example WARC-Target-URIs for Mailbagit Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/warcs.md These are common WARC-Target-URIs generated by mailbagit when valid Message-IDs are not present. They are used by WARC replay software to access archived content. ```text http://mailbag/39/body.html http://mailbag/39/headers.json http://mailbag/39/attachmentFilename.pdf ``` -------------------------------- ### Run Mailbagit GUI Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Launches the Mailbagit graphical user interface. This provides a visual way to interact with the mailbagit tool. ```bash mailbagit-gui ``` -------------------------------- ### Run mailbagit using docker-compose Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/docker.md Execute mailbagit within a Docker container using docker-compose. This method simplifies the setup by automatically mounting the current directory. ```bash docker compose run mailbagit ``` -------------------------------- ### Build and Push Production Docker Image Source: https://github.com/ualbanyarchives/mailbagit/blob/main/release.md Builds the production-ready Docker image using a specific Dockerfile and pushes it to the registry. This image is tagged as 'latest'. ```bash docker build --no-cache -t ualbanyarchives/mailbagit:latest -f Dockerfile.production . docker push ualbanyarchives/mailbagit:latest ``` -------------------------------- ### Get Speaker View Layout Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Retrieves the previously selected speaker view layout from local storage, or returns the default layout if none is found or local storage is unavailable. ```javascript function getLayout() { if( supportsLocalStorage() ) { var layout = window.localStorage.getItem( 'reveal-speaker-layout' ); if( layout ) { return layout; } } // Default to the first record in the layouts hash for( var id in SPEAKER_LAYOUTS ) { return id; } } ``` -------------------------------- ### Run mailbagit with a bind mount (Windows) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/docker.md Use a bind mount to grant the mailbagit container access to a specific Windows host directory. The host directory is mounted at `/data` within the container, using Windows-style paths for the source. ```bash docker run -it --mount type=bind,source="C:\Users\Me\path\to\data",target=/data ualbanyarchives/mailbagit:latest bash ``` -------------------------------- ### Run mailbagit with a bind mount (Unix-like) Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/docker.md Use a bind mount to grant the mailbagit container access to a specific host directory. The host directory is mounted at `/data` within the container. ```bash docker run -it --mount type=bind,source="path/to/data",target=/data ualbanyarchives/mailbagit:latest bash ``` -------------------------------- ### Set INCLUDE and LIB Environment Variables on Windows Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md Troubleshoots common Windows build errors for PST dependencies by setting INCLUDE and LIB environment variables in PowerShell. This is necessary when 'windows.h' is not found. ```powershell $env:INCLUDE = "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt;$env:INCLUDE" $env:LIB = "C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.26100.0\\um\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.26100.0\\ucrt\\x64;$env:LIB" ``` -------------------------------- ### Connection Message Handler Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Handles the 'connect' message from the main window to establish the connection. It initializes various components of the speaker view upon successful connection. ```javascript function handleConnectMessage( data ) { if( connected === false ) { connected = true; setupIframes( data ); setupKeyboard(); setupNotes(); setupTimer(); setupHeartbeat(); } } ``` -------------------------------- ### Bagit-Python Directory Input Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Shows how bagit-python handles multiple directory inputs, which mailbagit does not support. ```bash bagit.py path/to/stuff path/to/more/stuff ``` -------------------------------- ### Speaker View Initialization and Event Handling Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/plugin/notes/speaker-view.html Initializes the speaker view and sets up event listeners for messages from the main presentation window. It handles connection, state updates, and API calls. ```javascript var notes, notesValue, currentState, currentSlide, upcomingSlide, layoutLabel, layoutDropdown, pendingCalls = {}, lastRevealApiCallId = 0, connected = false, whitelistedWindows = [window.opener]; var SPEAKER_LAYOUTS = { 'default': 'Default', 'wide': 'Wide', 'tall': 'Tall', 'notes-only': 'Notes only' }; setupLayout(); var connectionStatus = document.querySelector( '#connection-status' ); var connectionTimeout = setTimeout( function() { connectionStatus.innerHTML = 'Error connecting to main window.
Please try closing and reopening the speaker view.'; }, 5000 ); window.addEventListener( 'message', function( event ) { // Validate the origin of this message to prevent XSS if( window.location.origin !== event.origin && whitelistedWindows.indexOf( event.source ) === -1 ) { return; } clearTimeout( connectionTimeout ); connectionStatus.style.display = 'none'; var data = JSON.parse( event.data ); // The overview mode is only useful to the reveal.js instance // where navigation occurs so we don't sync it if( data.state ) delete data.state.overview; // Messages sent by the notes plugin inside of the main window if( data && data.namespace === 'reveal-notes' ) { if( data.type === 'connect' ) { handleConnectMessage( data ); } else if( data.type === 'state' ) { handleStateMessage( data ); } else if( data.type === 'return' ) { pendingCalls[data.callId](data.result); delete pendingCalls[data.callId]; } } // Messages sent by the reveal.js inside of the current slide preview else if( data && data.namespace === 'reveal' ) { if( /ready/.test( data.eventName ) ) { // Send a message back to notify that the handshake is complete window.opener.postMessage( JSON.stringify({ namespace: 'reveal-notes', type: 'connected' }), '*' ); } else if( /slidechanged|fragmentshown|fragmenthidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) { dispatchStateToMainWindow( data.state ); } } } ); ``` -------------------------------- ### Input EML Files for Processing Source: https://github.com/ualbanyarchives/mailbagit/wiki/Mailbagit-Input-Output-Examples Illustrates the expected input file structure for mailbagit, focusing on .eml files. Non-EML files and directories lacking .eml files are ignored. ```text path/to/parentDirectory/message1.eml path/to/parentDirectory/message2.eml path/to/parentDirectory/message3.eml path/to/parentDirectory/message4.eml path/to/parentDirectory/message5.eml path/to/parentDirectory/message6.eml path/to/parentDirectory/message7.eml path/to/parentDirectory/otherFile.docx ``` -------------------------------- ### Package PST Files to EML, HTML, and PDF Derivatives Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/mailbagit.md Packages all PST files in a directory into a mailbag with EML, HTML, and PDF derivatives. It uses directory structure and email folder trees for arrangement. ```bash mailbagit path/to/export -i pst -d eml html pdf -m allfacstafflistserv ``` -------------------------------- ### Run Mailbagit Executable from Command Line Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/exe.md Use this command to run the mailbagit.exe in the command line, specifying the input PST file, output formats, and mailbag name. ```bash mailbagit.exe path/to/export.pst -i pst -d eml warc -m my_mailbag -r ``` -------------------------------- ### Run Mailbagit Development Docker Image Source: https://github.com/ualbanyarchives/mailbagit/blob/main/README.md Pull the development Docker image and run Mailbagit in editable mode. Assumes email data is in a local ./sampleData directory. ```bash docker pull ualbanyarchives/mailbagit:dev git clone git@github.com:UAlbanyArchives/mailbagit.git cd mailbagit git switch develop docker-compose -f docker-compose-dev.yml run mailbagit mailbagit -v ``` -------------------------------- ### Run Mailbagit GUI Script on Windows Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md Execute the mailbagit GUI using the Python interpreter after creating the 'mailbagit-gui.py' script. ```bash python3 mailbagit-gui.py ``` -------------------------------- ### Run Mailbagit GUI with Python interpreter Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Launches the Mailbagit GUI by executing the main GUI script using the Python interpreter. This is a common way to run Python applications. ```bash python mailbagit-gui.py ``` -------------------------------- ### Run Mailbagit for Real Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/mailbagitTestingDay.html Executes mailbagit to process email data and create derivatives. This command processes 'account.mbox' and generates HTML and EML derivatives, saving them to 'test1'. ```bash mailbagit account.mbox -i mbox -d html eml -m test1 ``` -------------------------------- ### Run Mailbagit GUI on Windows Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/installing_mailbagit/python.md A workaround for running the mailbagit GUI on Windows by creating a Python script. This is used when the direct 'mailbagit-gui' command fails. ```python from mailbagit import gui gui() ``` -------------------------------- ### Adding Fields to bag-info.txt Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/mailbagit-guided.md To add fields to bag-info.txt, enter the field name, followed by a colon, and then the value. Enter 'done' when finished. ```text source-organization: University at Albany, SUNY ``` -------------------------------- ### Package EML Files to PDF and WARC with Dry-Run Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/using_mailbagit/mailbagit.md Packages EML files into a mailbag with PDF (using headless Chrome) and WARC derivatives. Includes a dry-run option to test parsing without altering files. Writes errors to a report directory. ```bash mailbagit path/to/directory -i eml -d pdf-chrome warc -mailbag-name fundraising_emails -r ``` -------------------------------- ### Run mailbagit Docker container Source: https://github.com/ualbanyarchives/mailbagit/blob/main/docs/testingdayslides/index.html Pull the latest mailbagit Docker image and run it interactively. ```bash docker pull ualbanyarchives/mailbagit docker run -it ualbanyarchives/mailbagit:latest ```