snipsco / Postal

A Swift framework for working with emails
MIT License
652 stars 81 forks source link

Emails return bad data #77

Open zoecarver opened 6 years ago

zoecarver commented 6 years ago

I am reading my emails like this:

func fetch ( forNumber: Int )
{
    pConnector?.fetchLast ( "INBOX", last: UInt(forNumber), flags: [ .headers ], onMessage:
    { email in
        print("Got Message: \(email)");
    }, onComplete:
    { error in
        if let error = error
        {
            print("Error! \(error) ")
        }
    } )
}

However, I get this as a response:

FetchResult(uid: 15430, header: nil, flags: MessageFlag., body: nil, rfc822Size: 0, internalDate: nil, gmailThreadId: nil, gmailMessageId: nil, gmailLabels: nil)

I am new to swift, and am just learning about how this library works so I am probably doing something wrong; Just not quite sure what. I would love to know why this is happening - Thanks

Edit


As you can see, after enabling the logger it does spit out some data. This leads me to believe that there is something wrong with the api/lib.

* 569 FETCH (UID 15430 ENVELOPE ("Mon, 22 Jan 2018 16:33:45 +0000 (GMT)" "The status for your app, Quick Things (1330243459), is now Ready for Sale." (("iTunes Store" NIL "no_reply" "email.apple.com")) (("iTunes Store" NIL "no_reply" "email.apple.com")) (("iTunes Store" NIL "no_reply" "email.apple.com")) ((NIL NIL "z.zoelec2" "gmail.com")) NIL NIL NIL "<1993027620.57138323.1516638825329.JavaMail.email@email.apple.com>") BODY[HEADER.FIELDS (References)] {2}