-
Notifications
You must be signed in to change notification settings - Fork 111
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
message DATE problem #146
Comments
@haider001, the GetMessage() method does not support setting the date/time of the message. This would probably be a great feature request. Even better, you might code up the change and issue a pull request, especially after you see the solution. ;-) Until someone implements the feature you need, you will need to use the existing client methods to generate your own IMAP APPEND command. Luckiliy, it's pretty simple. The format of the command is defined in RFC 3501. Here's a link to the page: https://tools.ietf.org/html/rfc3501#page-46 You can look at the implementation of Notice that smiley22 calls client.SendCommandMessage() at line 1303 with the following string:
It may be a little hard to see, but this string maps to the parts of the APPEND command documented in RFC 3501. All you need to do is insert a valid date/time string in between the "flag parenthesized list" and the curly bracketed MIME length:
Then, all you need to do is generate a valid Now that you've got your new fangled, custom |
I am using s22.imap library from NuGet to move messages from source IMAP server to target IMAP server. Everything is working fine except the library sets new/current DATETIME on the destination server instead of the date at the source IMAP.
e.g. message date is 18-Jun-2018 and when I move message on 20th of June then it will set the date as 20-Jun-2018 instead of 18-Jun-2018.
Here is the code.
MailMessage message = sourceIMAP.GetMessage(uid, FetchOptions.Normal, false, folderName);
var isSeen = seenUids.Contains(uid);
targetIMAP.StoreMessage(message, isSeen, folderName);
The text was updated successfully, but these errors were encountered: