Git Product home page Git Product logo

c-mail-parser's Introduction

mail-parser

mail-parser is a WIP command-line utility with the goal of parsing Maildir-stored e-mail files.

The early versions of the program will use parsing code written from scratch to familiarise myself with the e-mail and related RFCs that specify how e-mails should be interpreted.

Later versions may rely on a library to handle some of the parsing.

Goals

  • mmap (as read-only) the file specified in a command-line argument.
  • Index the line-endings of headers and where the message body (if any) begins.
  • Print the header names.
  • Parse the MIME-Version header.
  • Parse the Content-Type header.
  • Print the body if there is no Content-Type header.
  • Print the body if Content-Type: text/plain.
  • Parse the first level of Content-Type: multipart/alternative and index the boundary delimiters.
  • Parse nested levels of multipart MIME message bodies.

Compiling

The current source code should compile with gcc if the necessary C libraries are available:

gcc c-mail-parser.c -o mail-parser

Usage

The current code creates a program that requires one argument: a single e-mail file to parse.

./mail-parser path/to/email-message-file

As the program is being designed for files stored in Maildir format mailboxes, on Linux systems where the LDA is dovecot, files with lines terminated by LF will likely be better tested than those with CRLF line endings.

c-mail-parser's People

Contributors

watfordjc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.