emailforwardparser

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2023 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

email-forward-parser

Go Reference Build and Test codecov

Parses forwarded emails and extracts original content.

This is a Go port of crisp-oss/email-forward-parser.

Installation

go get "https://github.com/darnfish/email-forward-parser"

Usage

import efp "github.com/darnfish/email-forward-parser"

result := efp.Read(body, subject)

log.Println(result.Forwarded) // true

log.Println(result)
// {
//   Forwarded: true,
//   Message: "Praesent suscipit egestas hendrerit.",
//   Email: {
//     Body: "Aenean quis diam urna.",
//     From: {
//       Name: "John Doe",
//       Address: "john.doe@acme.com"
//     },
//     To: [{
//       Name: "Bessie Berry",
//       Address: "bessie.berry@acme.com"
//     }],
//     CC: [{
//       Name: "Walter Sheltan",
//       Address: "walter.sheltan@acme.com"
//     }],
//     Subject: "Integer consequat non purus",
//     Date: "25 October 2021 at 11:17:21 EEST"
//   }
// }

Licence

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadResult

type ReadResult struct {
	Forwarded bool
	Message   string
	Email     ReadResultEmail
}

func Read

func Read(body string, subject string) ReadResult

type ReadResultEmail added in v1.0.1

type ReadResultEmail struct {
	Body    string
	From    _MailboxResult
	To      []_MailboxResult
	CC      []_MailboxResult
	Subject string
	Date    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址