Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update native-tls version #73

Merged
merged 3 commits into from
Jun 27, 2018
Merged

update native-tls version #73

merged 3 commits into from
Jun 27, 2018

Conversation

greenpdx
Copy link
Contributor

I was going to write a issue but it was easy fix. just upgraded native-tls to version 0.2.0

@jonhoo
Copy link
Collaborator

jonhoo commented Jun 26, 2018

Ah, great! No backwards-incompatible change? Have you had a chance to test it?

@greenpdx
Copy link
Contributor Author

It now compiles and it is connecting to my mail server, and it fetches something but I do not see the body. But I think that is just my code. Quick test works.

@greenpdx greenpdx closed this Jun 26, 2018
@greenpdx
Copy link
Contributor Author

How do I search or get a list of uid of emails in BOX?

@jonhoo
Copy link
Collaborator

jonhoo commented Jun 26, 2018

Did you close the PR by accident?
The easiest way to list messages is to use Client::list. I don't think we expose a way to list by UID, but you can easily do that yourself like I do in buzz. We should probably write up a better interface for doing things like that though :)

@greenpdx
Copy link
Contributor Author

Yes, sorry. And yes, better docs are needed. I think I am going to use your buzz/main.rs as a base for this project.

@greenpdx greenpdx reopened this Jun 26, 2018
@jonhoo
Copy link
Collaborator

jonhoo commented Jun 26, 2018

Sounds good! I've wanted to do that for a while, but partially waiting on #69, and partially on having enough free time ^_^. #62 and #74 are probably the issues you'd want to track.

@greenpdx
Copy link
Contributor Author

Please merge

@jonhoo jonhoo merged commit d1ed629 into mattnenterprise:master Jun 27, 2018
@jonhoo
Copy link
Collaborator

jonhoo commented Jun 27, 2018

Thank you!

@jonhoo
Copy link
Collaborator

jonhoo commented Jun 27, 2018

@mattnenterprise note that a major bump will be required for this as the native-tls API changes.

@greenpdx
Copy link
Contributor Author

This may be a stupid question but when I do a uid_fetch with a "body[]", should I get all headers and body. but right now I just get the Fetch structure. How do I get everything?

@jonhoo
Copy link
Collaborator

jonhoo commented Jun 27, 2018

Not stupid at all! The IMAP standard is a hot mess too. We currently don't extract BODY and ENVELOPE (I don't even know if the underlying IMAP protocol parser supports that), so you should use the RFC822 body instead!

@greenpdx
Copy link
Contributor Author

I turned debug on and got this. It looks like it is getting parsed. Just need to get to a upper layer.

: a108 IDLE
S: + idling
S: * OK Still here
C: DONE
S: a108 OK Idle completed.
C: a109 UID FETCH 1:* (body[])
S: * 1 FETCH (UID 12 BODY[] {1065}
S: Return-Path:
S: X-Original-To: EMAIL
S: Delivered-To: EMAIL
S: To: EMAIL
S: DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=DOMAIN;
S: s=201703; t=1530039519;
S: bh=w0if1YHG28RMxJpw6ZXAGCnWjT9kD1WnH2bs6bsO7EI=;
S: h=To:From:Subject:Date;
S: b=XL8F9Pak/0rKML/GHEl6rrGcDY+wVH0wMmO/2Qt54meFt5gsM1C+JJtmqIsxd5UBV
S: pjKTvW4aybwv1/cb3iYrCAEcx3a0EfpgrxWgkfDwF9SCMuzKpzWmL7TiN8c9WjiP8e
S: 63Y2JGNP2RSQ3ssFcgF1jMP4JGxkApcxUFwuUlQQNQLPB+17E+kskiuOet/CaA1hwM
S: 2jbQQG2KtXo4cqsrh1CcnwlxJChZlaCWPMuibaEHfxfvg+NfquVI4K0T47rAUe/yPo
S: 6vvud5rqZlMZE4VNoJljeRVWTTgRyJbeRXETQVoUg4GE6weAK0S+jd/ObW8SKXYA1F
S: kyu01L3KJsVCQ==
S: From: NAME
S: Subject: t1
S: Message-ID: f71498a7-229a-eeda-6886-02408b493f3e@DOMAIN
S: Date: Tue, 26 Jun 2018 11:58:38 -0700
S: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
S: Thunderbird/52.8.0
S: MIME-Version: 1.0
S: Content-Type: text/plain; charset=utf-8; format=flowed
S: Content-Transfer-Encoding: 7bit
S: Content-Language: en-US
S:
S: t1
S:
S: )
S: * 2 FETCH (UID 13 BODY[] {1063}
S: Return-Path:
S: X-Original-To: EMAIL
S: Delivered-To: EMAIL
S: To: EMAIL
S: DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=DOMAIN;
S: s=201703; t=1530039549;
S: bh=zAnuGua5OGbdINPRs7hXMGaehEqJztxC5kbzd4cQiJg=;
S: h=To:From:Subject:Date;
S: b=v36ScqWdYEsSyK3f34ZXl11+D+VafKg6+hIG+PnuSvqRdQF1dM9+WqzErzIqHZgh1
S: fehIlGAxxUnsmpyIJW8y1FJsm6RP96eehE9UQERI5MseuR7x/3G633x9s/qVn8fCWN
S: zC1yKmXNPIYfPVB3iLk38ipD7vR5xBq9YeZ8TSg3ZlzYkwlzMZN0UYMV1mxPeM/L+4
S: kOWX1Zos/jJhgXicOUTNIAm/btNpBf+vBVNBDCGz6Cjyn2HBocdD8ATc980Je5ZI4p
S: +GS8jMT1yp/P0W/X7slkDrhrM6twPdOt0fOHDcOivDhno7Hfr+9zmtXhZI31rVt4qy
S: JExal3wlRXvYw==
S: From: NAME
S: Subject: t2
S: Message-ID: 62c2d585-fe30-d03e-10fd-0c223446e9ce@DOMAIN
S: Date: Tue, 26 Jun 2018 11:59:08 -0700
S: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
S: Thunderbird/52.8.0
S: MIME-Version: 1.0
S: Content-Type: text/plain; charset=utf-8; format=flowed
S: Content-Transfer-Encoding: 7bit
S: Content-Language: en-US
S

@jonhoo
Copy link
Collaborator

jonhoo commented Jun 28, 2018

Ah, sorry, what I meant was that it doesn't get parsed by imap-proto, nor by this library. it does get parsed by the server and returned correctly. It should work fine if you request RFC822 instead, and then use the method rfc822 on Fetch instead. I agree with you that we should add support for BODY as well though! Maybe you can try your hands on a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants