Skip to content

Commit

Permalink
Library
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano committed Jun 5, 2020
1 parent dd480ed commit f57a3d3
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ packages:
- bash
- findutils
sources:
- https://github.com/emersion/go-message
- https://github.com/STEFANOORLANDI/go-message
tasks:
- build: |
cd go-message
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ _testmain.go
*.exe
*.test
*.prof
.idea
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# go-message

[![GoDoc](https://godoc.org/github.com/emersion/go-message?status.svg)](https://godoc.org/github.com/emersion/go-message)
[![builds.sr.ht status](https://builds.sr.ht/~emersion/go-message.svg)](https://builds.sr.ht/~emersion/go-message?)
[![codecov](https://codecov.io/gh/emersion/go-message/branch/master/graph/badge.svg)](https://codecov.io/gh/emersion/go-message)
[![GoDoc](https://godoc.org/github.com/STEFANOORLANDI/go-message?status.svg)](https://godoc.org/github.com/STEFANOORLANDI/go-message)
[![builds.sr.ht status](https://builds.sr.ht/~STEFANOORLANDI/go-message.svg)](https://builds.sr.ht/~STEFANOORLANDI/go-message?)
[![codecov](https://codecov.io/gh/STEFANOORLANDI/go-message/branch/master/graph/badge.svg)](https://codecov.io/gh/STEFANOORLANDI/go-message)

A Go library for the Internet Message Format. It implements:

Expand All @@ -14,11 +14,11 @@ A Go library for the Internet Message Format. It implements:

* Streaming API
* Automatic encoding and charset handling (to decode all charsets, add
`import _ "github.com/emersion/go-message/charset"` to your application)
* A [`mail`](https://godoc.org/github.com/emersion/go-message/mail) subpackage
`import _ "github.com/STEFANOORLANDI/go-message/charset"` to your application)
* A [`mail`](https://godoc.org/github.com/STEFANOORLANDI/go-message/mail) subpackage
to read and write mail messages
* DKIM-friendly
* A [`textproto`](https://godoc.org/github.com/emersion/go-message/textproto)
* A [`textproto`](https://godoc.org/github.com/STEFANOORLANDI/go-message/textproto)
subpackage that just implements the wire format

## License
Expand Down
2 changes: 1 addition & 1 deletion charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func IsUnknownCharset(err error) bool {
// lower-case. utf-8 and us-ascii charsets are handled by default. One of the
// the CharsetReader's result values must be non-nil.
//
// Importing github.com/emersion/go-message/charset will set CharsetReader to
// Importing github.com/STEFANOORLANDI/go-message/charset will set CharsetReader to
// a function that handles most common charsets. Alternatively, CharsetReader
// can be set to e.g. golang.org/x/net/html/charset.NewReaderLabel.
var CharsetReader func(charset string, input io.Reader) (io.Reader, error)
Expand Down
4 changes: 2 additions & 2 deletions charset/charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"io"
"strings"

"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
"golang.org/x/text/encoding"
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/encoding/ianaindex"
Expand All @@ -35,7 +35,7 @@ var charsets = map[string]encoding.Encoding{

"ansi_x3.110-1983": charmap.ISO8859_1, // see RFC 1345 page 62, mostly superset of ISO 8859-1
"gb2312": simplifiedchinese.GBK, // GBK is a superset of HZGB2312
// disabled due to https://github.com/emersion/go-message/issues/95
// disabled due to https://github.com/STEFANOORLANDI/go-message/issues/95
"hz-gb-2312": nil,
"cp1250": charmap.Windows1250,
"cp1251": charmap.Windows1251,
Expand Down
4 changes: 2 additions & 2 deletions entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"strings"

"github.com/emersion/go-message/textproto"
"github.com/STEFANOORLANDI/go-message/textproto"
)

// An Entity is either a whole message or a one of the parts in the body of a
Expand Down Expand Up @@ -33,7 +33,7 @@ func New(header Header, body io.Reader) (*Entity, error) {
// a Content-Transfer-Encoding other than "7bit", "8bit" or "binary".
// However some messages in the wild are non-conformant and have it set to
// e.g. "quoted-printable". So we just ignore it for multipart.
// See https://github.com/emersion/go-message/issues/48
// See https://github.com/STEFANOORLANDI/go-message/issues/48
if !strings.HasPrefix(mediaType, "multipart/") {
enc := header.Get("Content-Transfer-Encoding")
if decoded, encErr := encodingReader(enc, body); encErr != nil {
Expand Down
4 changes: 2 additions & 2 deletions entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"testing"

"github.com/emersion/go-message/textproto"
"github.com/STEFANOORLANDI/go-message/textproto"
)

func testMakeEntity() *Entity {
Expand Down Expand Up @@ -49,7 +49,7 @@ func testMakeMultipart() *Entity {
return e
}

const testMultipartHeader = "Mime-Version: 1.0\r\n"+
const testMultipartHeader = "Mime-Version: 1.0\r\n" +
"Content-Type: multipart/alternative; boundary=IMTHEBOUNDARY\r\n\r\n"

const testMultipartBody = "--IMTHEBOUNDARY\r\n" +
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
)

func ExampleRead() {
Expand Down
5 changes: 1 addition & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/STEFANOORLANDI/go-message v0.12.2/go.mod h1:1vg9glVIzVx3MDcYh9BeefByWNrRYytqmCvHfaW7XCs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emersion/go-textwrapper v0.0.0-20160606182133-d0e65e56babe h1:40SWqY0zE3qCi6ZrtTf5OUdNm5lDnGnjRSq9GgmeTrg=
github.com/emersion/go-textwrapper v0.0.0-20160606182133-d0e65e56babe/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U=
github.com/martinlindhe/base36 v1.0.0 h1:eYsumTah144C0A8P1T/AVSUk5ZoLnhfYFM3OGQxB52A=
github.com/martinlindhe/base36 v1.0.0/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand Down
2 changes: 1 addition & 1 deletion header.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package message
import (
"mime"

"github.com/emersion/go-message/textproto"
"github.com/STEFANOORLANDI/go-message/textproto"
)

func parseHeaderWithParams(s string) (f string, params map[string]string, err error) {
Expand Down
2 changes: 1 addition & 1 deletion mail/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/mail"
"strings"

"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
)

// Address represents a single mail address.
Expand Down
2 changes: 1 addition & 1 deletion mail/attachment.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mail

import (
"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
)

// An AttachmentHeader represents an attachment's header.
Expand Down
2 changes: 1 addition & 1 deletion mail/attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mail_test
import (
"testing"

"github.com/emersion/go-message/mail"
"github.com/STEFANOORLANDI/go-message/mail"
)

func TestAttachmentHeader_Filename(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion mail/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"
"unicode/utf8"

"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
)

const dateLayout = "Mon, 02 Jan 2006 15:04:05 -0700"
Expand Down
2 changes: 1 addition & 1 deletion mail/header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/emersion/go-message/mail"
"github.com/STEFANOORLANDI/go-message/mail"
)

func TestHeader(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion mail/inline.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mail

import (
"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
)

// A InlineHeader represents a message text header.
Expand Down
2 changes: 1 addition & 1 deletion mail/mail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"regexp"
"testing"

"github.com/emersion/go-message/mail"
"github.com/STEFANOORLANDI/go-message/mail"
)

const mailString = "Subject: Your Name\r\n" +
Expand Down
2 changes: 1 addition & 1 deletion mail/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"strings"

"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
)

// A PartHeader is a mail part header. It contains convenience functions to get
Expand Down
2 changes: 1 addition & 1 deletion mail/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"testing"

"github.com/emersion/go-message/mail"
"github.com/STEFANOORLANDI/go-message/mail"
)

func ExampleReader() {
Expand Down
2 changes: 1 addition & 1 deletion mail/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io"
"strings"

"github.com/emersion/go-message"
"github.com/STEFANOORLANDI/go-message"
)

func initInlineContentTransferEncoding(h *message.Header) {
Expand Down
2 changes: 1 addition & 1 deletion mail/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/emersion/go-message/mail"
"github.com/STEFANOORLANDI/go-message/mail"
)

func ExampleWriter() {
Expand Down
2 changes: 1 addition & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
// by default:
//
// import (
// _ "github.com/emersion/go-message/charset"
// _ "github.com/STEFANOORLANDI/go-message/charset"
// )
package message
2 changes: 1 addition & 1 deletion multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package message
import (
"io"

"github.com/emersion/go-message/textproto"
"github.com/STEFANOORLANDI/go-message/textproto"
)

// MultipartReader is an iterator over parts in a MIME multipart body.
Expand Down
2 changes: 1 addition & 1 deletion textproto/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package textproto_test
import (
"fmt"

"github.com/emersion/go-message/textproto"
"github.com/STEFANOORLANDI/go-message/textproto"
)

func ExampleHeader() {
Expand Down
2 changes: 1 addition & 1 deletion writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"strings"

"github.com/emersion/go-message/textproto"
"github.com/STEFANOORLANDI/go-message/textproto"
)

// Writer writes message entities.
Expand Down

0 comments on commit f57a3d3

Please sign in to comment.