Giter VIP home page Giter VIP logo

eazye's People

Contributors

glennzw avatar itisnathaniel avatar jprobinson avatar philippedesjacques avatar senkinalex 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  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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eazye's Issues

Can you help me

My code:

func main() {
	info:=eazye.MailboxInfo{}
	info.Host= "serveraddr:26"
	info.TLS=false
	info.User= "[email protected]"
	info.Pwd= "pass"
	info.Folder= "Inbox"
	ch,err:=eazye.GenerateAll(info,false,false)
	if err!=nil{
		log.Println(err)
	}
	log.Println(<-ch)
}

I get in out:

2020/07/06 15:29:34 uid search failed: imap: bad response tag ("220 serveraddr ESMTP Company")
2020/07/06 15:29:34 {{<nil> <nil> [] 0001-01-01 00:00:00 +0000 UTC   [] [] false 0} <nil>}

If use ValidateMailboxInfo it's panic with out:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x11da077]

goroutine 1 [running]:
github.com/mxk/go-imap/imap.newCommand(...)
	/Users/anatolijgracev/go/src/github.com/mxk/go-imap/imap/command.go:61
github.com/mxk/go-imap/imap.(*Client).Send(0x0, 0x1273086, 0x5, 0x0, 0x0, 0x0, 0xc000010018, 0xc000076a20, 0x0)
	/Users/anatolijgracev/go/src/github.com/mxk/go-imap/imap/client.go:163 +0x37
github.com/mxk/go-imap/imap.(*Client).Close(0x0, 0x1, 0x1299298, 0xc000042e18, 0xc0000e3dd0)
	/Users/anatolijgracev/go/src/github.com/mxk/go-imap/imap/imap.go:328 +0x66
github.com/jprobinson/eazye.ValidateMailboxInfo.func1(0x0)
	/Users/anatolijgracev/go/src/github.com/jprobinson/eazye/eazye.go:170 +0x30
github.com/jprobinson/eazye.ValidateMailboxInfo(0x127aaae, 0x14, 0x0, 0x127d7bd, 0x1e, 0x1275e1e, 0x8, 0x0, 0x0, 0x1, ...)
	/Users/anatolijgracev/go/src/github.com/jprobinson/eazye/eazye.go:173 +0xc8
main.main()
	/Users/anatolijgracev/go/src/readmail/readmail.go:17 +0xc9
exit status 2

What's wrong I do?

I am confused about the meaning of different fields

In the struct definition:

type MailboxInfo struct {
Host string
TLS bool
User string
Pwd string
Folder string
}

There is NO explanation at all. Would you please explain in detail? I got the following error message:
"uid search failed: EOF" and I don't know how to fix it.

parsing attachments

what do you suggest to do to get the attachments data?
I've found the mime types in the Message.Body do you have any helper function to extract the attachments data or you know any additional library we may use?

Base64 Encoding in email.Text

While using this package in go 1.7, when grabbing emails that have "Content-Type-Encoding: base64", the email.Text is still encoded, it is not readable. (it isn't the text from the email, but the result of encoding)

I messed around with trying to grab the headers (email.Message.Header["Content-Type-Encoding"]) and oddly it doesn't seem to be consistently present. Sometimes it displays the value, other times it doesn't. If you print out the raw Message you see that the field is there every time.

Anyway I worked around this by simply decoding every email.Text and doing a simple check on the result to determine whether or not I should just use email.Text or the decoded value.

Failing with "BADCHARSET (US-ASCII)"

When trying to retrieve unread emails from Microsoft Exchange servers the following error is encountered:

uid search failed: imap: unexpected completion status ("RXUGA5 NO [BADCHARSET (US-ASCII)] The specified charset is not supported.")

Failure occurs here: https://github.com/jprobinson/eazye/blob/master/eazye.go#L337

Doing some Googling it seems like it's a Microsoft Exchange issue. The BADCHARSET response-code provides a list of supported charsets, not the charset that is invalid. The charset that is invalid is the charset used in the UIDSearch() command (which I assume is UTF-8).

Given that the github.com/mxk/go-imap/imap project hasn't been updated in over 5 years I'm guessing something 'modern' might be breaking things. Digging into this project I find the following code:

// UIDSearch is identical to Search, but the numbers returned in the response
// are unique identifiers instead of message sequence numbers.
func (c *Client) UIDSearch(spec ...Field) (cmd *Command, err error) {
	return c.Send("UID SEARCH", append([]Field{"CHARSET", "UTF-8"}, spec...)...)
}

https://github.com/mxk/go-imap/blob/master/imap/imap.go#L377

The CHARSET here being specified as UTF-8. I changed this is "US-ASCII" and I am able to login to Outlook servers.


EDIT: I see this was raised some years ago https://github.com//issues/3

markAsRead = false changes all messages to unread

First of all I wanted to say that I really love this repository :)

I find it odd that setting markAsRead to false marks messages as unread, even if they were previously mark as read.

Not sure if it's a bug or a feature. Just an odd behaviour for me.

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.