Giter Site home page Giter Site logo

go-gmime's People

Contributors

anfanycw avatar avnik avatar charlottestjohn avatar davidblum avatar dharmik-patel avatar eddiezane avatar elan-sg avatar ericychoi avatar qngn avatar rhansen2 avatar vaskoz avatar xdsxc avatar yuf3n9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-gmime's Issues

Return error instead of panic

We should return an error, instead of panic'ing.
Since this is a library, we should let the caller deal with the error.

For example, when calling parse.Recipients() on a message with an empty To list:

(process:24446): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
panic: ZERO pointer

goroutine 25 [running]:
panic(0x42edfa0, 0xc8201b8d10)
        /usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/sendgrid/go-gmime/gmime.ref(0x0)
        /Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/gmime.go:48 +0x75
github.com/sendgrid/go-gmime/gmime.AssignJanitor(0x5e00158, 0xc8201b46a8)
        /Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/janitor.go:22 +0x39
github.com/sendgrid/go-gmime/gmime.CastPointer(0x0, 0x41c719f)
        /Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/janitor.go:34 +0x81
github.com/sendgrid/go-gmime/gmime.CastInternetAddressList(0x0, 0x44bc748)
        /Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/internet_address.go:189 +0x21
github.com/sendgrid/go-gmime/gmime.(*aMessage).AllRecipients(0xc8201b45e8, 0x0)
        /Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/message.go:152 +0xc2
github.com/sendgrid/go-gmime/gmime.(*aParse).Recipients(0xc8201b8cd0, 0x0, 0x0)
        /Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/parse.go:64 +0x45

Headers() needs to use textproto.Mimeheader.Set() instead of modifying the map directly

https://github.com/sendgrid/go-gmime/blame/5544c54b141c13fa6ac0b4ddc162a65dab1dc8bb/gmime/envelope.go#L64

When Canonical form of the key is different from the actual key, headers().Values() would not return the right value, since the internal map doesn't have the canonical form as the key. Users can get the values by treating Mimeheader as a map as a workaround- but this is confusing and can cause unexpected consequences.

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.