Coder Social home page Coder Social logo

caeml's Introduction

CAEML

Reads an email file from either STDIN or from a file passed as the first argument, digests it and outputs it to STDOUT in a more human readable format. This means only From, To, Cc, Bcc, Date and Subject headers are kept and these are decoded and of all the parts only text/plain is returned.

Why?

A modern email will have about 60 lines of headers before the From header and the "interesting" headers will be encoded in a way, that is pretty hard for humans to read. And that's if the email was two lines. If there were also attachments, then good luck finding anything useful quickly.

Of course this is why you use a MUA instead of reading raw emails, but caeml was written for two use cases. One, poking around in your maildir folder, when trying to figure out what's going wrong with your syncing and previewing message/rfc822 attachments in aerc.

Installation

go install github.com/ferdinandyb/caeml@latest

Usage

  • read from STDIN: cat test.eml | caeml
  • read from file: caeml test.eml
  • change order of headers: caeml -H "Subject,To,From,Message-Id" test.eml
  • print only headers: caeml -O test.eml
  • also print contents of any message/rfc822 parts: caeml -D test.eml (respects -O and -H for these as well)

Default header order is: caeml -H "From,To,Cc,Bcc,Date,Subject" If a header is empty it will not be displayed.

Integration

aerc

message/rfc822=caeml | colorize

Contribution

Patches sent in email are also welcome :)

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.