jprobinson / eazye Goto Github PK
View Code? Open in Web Editor NEWThe gangsta gangsta way to pull email
License: Other
The gangsta gangsta way to pull email
License: Other
FYOQK5 NO [BADCHARSET (US-ASCII)] The specified charset is not supported.
Ref: emersion/go-imap#48
It appears they fixed it in go-imap. I wonder why it's not working here.
Thanks
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.
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.
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.
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.
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.