Yahoo IMAP UID+ COPYUID broken? - imap

It seems the COPYUID functionality in Yahoo's IMAP UID+ is not at all working. e.g. our task that moves messages receives the trace:
S: C32 OK [COPYUID 1348693428 122572 122552] COPY completed
We log into the box and verify uidvalidity:
S: * OK [UIDVALIDITY 1348693428] UIDs valid
However the fetch fails:
C: C6 UID FETCH 122552 (BODY.PEEK[] UID)
S: C6 OK UID FETCH completed
I'm wondering if anyone has experienced similar frustrations over Yahoo UID+, if there is a workaround, I have an error in my client etc.
Furthermore I am testing this on my personal account and messages are not modified after being copied.

Fwiw several weeks of development on this later I can confidently say yes, it's just flat-out broken and should not be used.

Related

Problem with login using idhttp, the website doesn't send any username and password with its posts

please note that i had asked this question a while back but i was unable to attend to it because of some personal issue, so it got deleted, meta user suggested i reask the question and so here it is
Recently i encountered a website which doesn't send any dynamic information when you try to login, not even Username and Password !, what i mean is that after i use Fiddler and Http Analyzer i can see that 4 event happens :
All of these happens in the web browser :
1- A simple Get for the login main page
2- A Post which sends some data (These data do not include my Username and Password and they seem static! and even though there is a __USERCONTROLPATH which can be extracted from the step 1 response, it doesn't change, meaning even if i try to login multiple times using different browser at different times everything including the __USERCONTROLPATH is the same)
3- A Post which is of JSON type and the request is empty and the response only contains a single line as you can see at the image below:
4- A Get happens which is the login main page but if you look at HTML you can see that the user is logged in!
I tried doing these steps one by one, but i am unable to successfully log in to the website and i am unable to understand how my Username and Password is sent!
Here you can see some of the code i have written:
//for the sake of cookies and ... i do a Get on the main page
idHttp.get('MainLogPage');
//i send the first post which contains some information which never changes, they seems static and do not include the username and password
idhttp.post('someURL', requestList);
jsonRawRequest := TJSONObject.Create;
jsonRequest := TStringStream.Create(jsonRawRequest.ToString, TEncoding.UTF8);
/here i try to do the post that you saw in the image, no value is sent so i send an empty json request.
idhttp.post('someOtherURL', jsonRequest)
In the end my question is how can i login to such a site ?, what am i missing ?, currently i get error on Step 3, when i post the JSON, here is a picture of the error:
Update 01 :
I meant to update the whole post and explain every step in more detail but as i was messing with fiddler and checking the posts again i noticed something, when the Browser sends the POST "https://www.somewebsite.com//Index.aspx/LoginUser" the type is application/json and in the "HTTP analyzer" i can see that it send and receive a JSON but in the Fiddler the Webforms is empty! so i check the TextView thats where i saw it !, i again went and check HTTP analyzer's Raw stream, and in there i also saw a user and password being sent, i don't know how the post contains this string that you can see below, but in fiddler you can see it in "TextView" and in http analyzer you can see it in raw stream, now that i know this, can you tell me how can i imitate such a post ?, by the way the user and password are encrypted which i presume is a matter of its own, and i probably have to contact the site's admin for the algorithm ?, anyway, first things first, how can i send such a POST ?
In Fiddler :
HTTP Analyzer :
Update 02:
I tried what Remy Lebeau said,
But the JSON in the site was not standard as you can see in:
The input is not a valid Base-64 string Error, My JSON uses double quotation marks instead of single quotations
After that i tried a hard coded solution and i read the JSON from a file as you can see below:
loader := TStringList.Create;
loader.LoadFromFile('jsonWithCustomFormat.txt');
jsonRequest := TStringStream.Create(loader[0], TEncoding.UTF8);
After that i set the refer to the login page:
idHttp.Request.Referer := 'myLoginPageURL';
idHttp.Request.ContentType := 'application/json'
And Finally i send the POST:
idhttp.Post(URL, jsonRequest, ms);
The result of what i did was an alert error as you can in the image below:
I am very confused as to what the problem is, i have to solve this so any hint or help is much appreciated.

Kolab/Imapd authentication error

I'm trying to install Kolab 16 on CentOS 7 but i have troubles to authenticate the user via IMAP. The maillog says:
May 30 14:35:11 mxname IMAPD-CUST/imaps[17908]: inittls: Loading hard-coded DH parameters
May 30 14:35:11 mxname IMAPD-CUST/imaps[17908]: starttls: TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits reused) no authentication
Authentication with roundcubemail works like a charm. The relevant section from imapd.conf is (file permissions should be okay):
tls_server_cert: /etc/ssl/certs/fqdn.crt
tls_server_key: /etc/ssl/certs/fqdn.key
tls_server_ca_file: /etc/ssl/certs/fqdn.pem
tls_ciphers: EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!P
SK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
I have no idea how to further investigate this issue. I found out that there is now an IMAP proxy (guam) in front of imapd (haven't seen that on my old setup), maybe this is the trouble maker? The maillog is not very useful for me atm. Any suggestions which service could make troubles here?

IMAP BAD [CLIENTBUG] Invalid tag

I want send IMAP command so that I can receive IMAP response.
So a short code that easy for undertanding but save space to prevent type all code and faster for the Overflow reader:
SSL_write("a0001 login user pass")
SSL_read = "* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT
a0001 OK mrtallpuducherry#gmail.com authenticated (Success)
OK, now everything ok, but here is where problem that is small start:
SSL_write("a0002 select inbox\r\n\r\n")
SSL_read = * BAD [CLIENTBUG] Invalid tag
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Phishing $NotPhishing)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Phishing $NotPhishing \*)] Flags permitted.
* OK [UIDVALIDITY 1] UIDs valid.
* 7958 EXISTS
* 0 RECENT
* OK [UIDNEXT 22979] Predicted next UID.
* OK [HIGHESTMODSEQ 2553479]
a0002 OK [READ-WRITE] inbox selected. (Success)
Any time after login when I send the IMAP command to get the IMAP response, always the first thing I receive is
* BAD [CLIENTBUG] Invalid tag
After it tell me BAD it then give me proper response and tell me (Success).
Is very confusing to me because I give correct tag. I use OpenSSL on linux platform.
This example with gmail server but happen on all IMAP server tested. Login is perfect and everything else start with "Invalid tag" then give me correct response.
Do you know what I do wrong and how to prevent this? Thanks you very much. My kindest regard.
The problem is here:
SSL_write("a0002 select inbox\r\n\r\n")
Only write one CRLF:
SSL_write("a0002 select inbox\r\n")
You've unintentionally sent two commands. One is the command you wanted, one was the empty command, which has no (an invalid) tag.

OAuth 1.0b receiving access token

Until few days ago everything worked fine. But after some changes on FitBit new user can not get OAuth handshake anymore. The problem is when I receive temporary tokens and make call to finish handshake and receive credentials.
So in first step I get:
TOKEN: 1a227cfde686220183763946a98173bc and VERIFIER: p2g5ims7o4ffscev603rbif05g
and in second step I use theme to make call to https://api.fitbit.com/oauth/access_token ...
Signature Base String is:
POST&https%3A%2F%2Fapi.fitbit.com%2Foauth%2Faccess_token&oauth_consumer_key%3D7c5e888aa3dd4d17a26d82a7f541b278%26oauth_token%3D1a227cfde686220183763946a98173bc%26oauth_nonce%3D5hw45lgu%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1391094796%26oauth_verifier%3Dp2g5ims7o4ffscev603rbif05g%26oauth_version%3D1.0
And by that I receive header (with signature calculated using the same function as in first step)
Authorizing with HEADER: OAuth oauth_consumer_key="7c5e888aa3dd4d17a26d82a7f541b278",oauth_token="1a227cfde686220183763946a98173bc",oauth_nonce="5hw45lgu",oauth_signature="X4udgn9A7Q2xI%2FN38QELl%2BIDVqM%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1391094796",oauth_verifier="p2g5ims7o4ffscev603rbif05g",oauth_version="1.0"
That should work but I get 401 error saying:
{"errors":[{"errorType":"oauth","fieldName":"oauth_access_token","message":"Invalid signature or token 'JNGSIMomid/oghtWGrz7crC6KhM=' or token '6c45d0ce39195e848da14cad0a4f9719'"}],"success":false}
I have been working od that for 7 hours now ... and as far as I can see everything is OK ... Error is saying about field name oauth_access_token ... This fields doesn't even exist. I tried anyway and recived error saying that security is not OK ...
Any Idea?
I had the same problem. After doing some research I noticed that the API has changed and the lib I was using was out dated.
To fix that, I updated my lib and did some code changes.
Here is the link of a .Net implementation after the change:
https://github.com/aarondcoleman/Fitbit.NET/wiki/Breaking-Change-on-1-24-2014-as-a-result-of-OAuth-update-in-Fitbit-API
Regards,
Fredy

string reading problem through IMAP

I am working on a IMAP, so just reading the body (body[header.fields (DATE FROM SUBJECT)]) I am passing this command.
But problem is like there some time my string return extra stuff excetp from my original string.
and some times I had getting limited part of the string means half part of the body.
so whenever I am passing second command it will accept as a first command and return result as the
first command pending resul.;
so the my concern is that I am not able to retrive proper data as of the part of the body.
as per my knowladge I think it's happen due to the internet datapacket tresfersize, but apart from this look at outlook or any other mail manager will work properly so what this is the mechanisam for
this data retriving.
or anything else to do fo my coding.....
Thanks..
Posting a sample response from the IMAP server that contains the "extra stuff" would help.
The problem you are most likely facing is with untagged server responses.
Heres what RFC3501 says:
Status responses can be tagged or untagged. Tagged status responses indicate the completion result (OK, NO, or BAD status) of a client command, and have a tag matching the command:
C: a002 NOOP
S: a002 OK NOOP completed
Some status responses, and all server data, are untagged. An
untagged response is indicated by the token "*" instead of a tag.
C: a047 NOOP
S: * 22 EXPUNGE
S: * 23 EXISTS
S: * 3 RECENT
S: * 14 FETCH (FLAGS (\Seen \Deleted))
S: a047 OK NOOP completed
So you need to distinguish between those 2 response types.
Please remember that checking if every received line starts from '*' character is not enough, as your email message may also have lines starting from star character:
C: a004 fetch 12 body[header]
S: * 12 FETCH (RFC822 {342}
S: Date: Wed, 17 Jul 1996 02:23:25 -0700 (PDT)
S: From: Terry Gray <gray#cac.washington.edu>
S: Subject: IMAP4rev1 WG mtg summary and minutes
S: MIME-Version: 1.0
S:
S: * This is email body containing start char
S: )
S: a004 OK FETCH completed
{342} is the exact number of bytes you are supposed to read.
The bottom line is don't reinvent the wheel use existing library.
You can check out mine IMAP component (not free).

Resources