Skip to content

micz/mbox_creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mbox_creator

This guide explains how to use the provided files to run the mbox_creator script to generate a test mbox file.
I'm using this script to create emails to test ThunderStats my statistics add-on for Thunderbird.
The emails wil be sent and received, also with replies, that will be matched in the same conversation.

There isn't much creativity in the subject, body, or correspondents addresses of the emails, but testing the statistical add-on doesn't require it at the moment. I believe we'll eventually reach the point where we'll perform statistical analysis of the text, but we're not there yet.
Please feel free to enhance the script with any necessary creativity 😄 and submit a pull request. Thank you!


Overview

  • mbox_creator.js: It's the script that creates the mbox file.
  • test_mailbox: It's the example mbox file generated with the mbox_creator.js script.

Defining the parameters

These are the parameters you can change:

  • ownerEmail: The email address of the mailbox owner.

    Example:

   const ownerEmail = "[email protected]";

  • numEmailsToday: The number of emails to create for today.

    Example:

const numEmailsToday = 5;

  • numEmailsYesterday: The number of emails to create for yesterday.

    Example:

const numEmailsYesterday = 7;

  • numEmailsLast7Days: The number of emails to create for the last 7 days.

    Example:

const numEmailsLast7Days = 30;

  • mboxFileName: The name of the mbox file to create.

    Example:

const mboxFileName = 'test_mailbox';

Usage

Ensure you have installed Node.js.

Run the script with node mbox_creator.js.


How to import the mbox file in a mail client (Thunderbird example)

Using Thunderbird, you need to locate your profile path. With Thunderbird closed, copy the file to the Local Folders directory. Then, open Thunderbird, and you'll find a new folder in the tree view with the name of the file you copied earlier. If needed, move the emails to another folder or to the test account you're using, and you're done.


How to contribute

Feel free to fork the repository and make a pull request to improve the code or this guide.


LICENSE

This code is distributed under the MPL 2.0 license.