Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nu_plugin_mime_message

A Nushell plugin for parsing MIME messages and mail streams using the mail-parser crate. This plugin is ideal for analyzing .eml files or acting as a mail filter in a pipeline.

Installation

  1. Build the plugin:
    cargo build --release
  2. Add the plugin to Nushell:
    plugin add target/release/nu_plugin_mime_message
  3. Use the plugin in your Nushell session:
    plugin use mime_message

Usage

You can pipe binary or string data containing a MIME message to the mime-part command.

Mail Filtering & Analysis

The plugin can be used to filter or process emails from a stream. For example, to check the subject of an incoming stream:

$in | mime-part | get subject

Parsing Files

When parsing files, it is recommended to use open --raw to ensure the original MIME structure and body content are preserved (as Nushell's default .eml parsing may truncate data):

open --raw sample_email.eml | mime-part

Output

The command outputs a record with the following fields:

  • subject: The subject of the email (string)
  • from: A list of sender addresses, each containing name and address fields.
  • to: A list of recipient addresses.
  • date: The date the email was sent, in RFC3339 format.
  • body_text: The plain text body of the email.
  • body_html: The HTML body of the email.
  • attachments: A list of attachments. Each attachment record contains:
    • filename: The name of the attached file.
    • content_type: The MIME content type.
    • body: The binary payload of the attachment.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages