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

Date incorrect in Hotmail IMAP Append #715

Closed
ashish1405 opened this issue May 10, 2014 · 10 comments
Closed

Date incorrect in Hotmail IMAP Append #715

ashish1405 opened this issue May 10, 2014 · 10 comments

Comments

@ashish1405
Copy link

  In Hotmail (imap-mail.outlook.com), the APPEND command uses OPTIONAL date/time string argument instead of Date: header, for setting message date.

This argument can never be set in the MailCore2 API because the date parameter is passed as NULL in IMAPSession::appendMessageWithCustomFlags

r = mailimap_uidplus_append(mImap, MCUTF8(folder), flag_list, NULL, messageData->bytes(), messageData->length(),
        &uidvalidity, &uidresult);

Because of this what ever date is set in [[builder header] setReceivedDate:date]; [[builder header] setDate:date]; in append command, Hotmail takes the current date/time.

@dinhvh
Copy link
Member

dinhvh commented May 10, 2014

Does hotmail accept an empty date?

@ashish1405
Copy link
Author

As an argument or as Date: header?

@dinhvh
Copy link
Member

dinhvh commented May 10, 2014

Is it an issue for hotmail if the date value is NULL here?

r = mailimap_uidplus_append(mImap, MCUTF8(folder), flag_list, NULL, messageData->bytes(), messageData->length(),
        &uidvalidity, &uidresult);

@ashish1405
Copy link
Author

Yes because that variable is used in libetpan as date argument.

@dinhvh
Copy link
Member

dinhvh commented May 10, 2014

ok. Could you show the connection logger logs when you try to append a message to hotmail?
Thanks.

@ashish1405
Copy link
Author

2014-05-10 11:40:48.419 iOS UI Test[604:330f] event logged:0x9292650 1 withData: 6 APPEND TEST () {622}
2014-05-10 11:40:50.519 iOS UI Test[604:330f] event logged:0x9292650 0 withData: + Ready
2014-05-10 11:40:50.519 iOS UI Test[604:330f] event logged:0x9292650 1 withData: Date: Sun, 27 Oct 2013 09:10:48 +0530
From: test me@me.com
To: exmple@gmail.com
Message-ID: c3ae8888-1d9d-4a90-b51b-bfc7d4e95c6f@Ashishs-MacBook-Pro.local
Subject: SMTP Test
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="536dc2e8_6b8b4567_25c"

--536dc2e8_6b8b4567_25c
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

SMTP Body Test 16807
--536dc2e8_6b8b4567_25c
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

SMTP Body Test 16807
--536dc2e8_6b8b4567_25c--

2014-05-10 11:40:53.047 iOS UI Test[604:330f] event logged:0x9292650 0 withData: * 3 EXISTS
2014-05-10 11:40:53.413 iOS UI Test[604:70b] 2045-10-22 00:26:29 +0000
2014-05-10 11:40:53.985 iOS UI Test[604:330f] event logged:0x9292650 0 withData: 6 OK [APPENDUID 42703751 100003] APPEND completed

@dinhvh
Copy link
Member

dinhvh commented May 10, 2014

So it works. Why would you need to customize the append date of the appended message?

@ashish1405
Copy link
Author

My application is for backing up old messages. So I need to have past dates.
What ever the date we set in [[builder header] setReceivedDate:date]; [[builder header] setDate:date]; that date is not set in hotmail mail. It uses current date. So if we set a past date that is not set. But from command line using openssl if I set the date in APPEND parameter like below it works properly.

$ openssl s_client -crlf -connect imap-mail.outlook.com:993
...
...
tag login user@hotmail.com password
tag APPEND inbox (\Seen) "10-10-2013 10:10 -05:00" {310}
Date: Mon, 7 Feb 2014 21:52:25 -0800 (PST)
...
...

As seen above, the append argument (in same line) has a date, Hotmail uses that date and not the date set in Date: header

@dinhvh
Copy link
Member

dinhvh commented May 20, 2014

Add a date property to MCOIMAPAppendMessageOperation.

@ashish1405
Copy link
Author

Ok, And how will I access this property in MCIMAPSestion::appendMessageWithCustomFlags?

@dinhvh dinhvh closed this as completed in 64f52da Jul 16, 2014
antmd pushed a commit to antmd/mailcore2 that referenced this issue Jun 14, 2017
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

No branches or pull requests

2 participants