I know it’s been a while since i’ve posted about InterIMAP and i want to let everyone know that i am planning to continue work on it, fixing bugs and adding features.
Based on the issues and discussions that have been posted on the codeplex site, it seems that some people are still using the old code base in the Synchronous folder tree. This branch will be marked as deprecated going forward as i will not be maintaining it anymore. The asynchronous branch contains far better code, and even supports performing operations in a synchronous manner (blocking the calling thread until the operation completes) so there is no reason to use the old code.
Through some basic testing i did on the code to see what state it is in, i noticed that the new message flag detection code was not working properly, marking messages as new that weren’t necessarily so. This will be the first area I will work on correcting as i recall the message flags that the server returns can vary from server to server (as most things with IMAP tend to be). Once i can correctly determine if a message is new or not i will work on implementing a quick and easy way of checking for new messages either in all folders, or in a specific folder only.
I encourage everyone who uses the library to submit any requests or bugs they find either on this blog or on the codeplex site so that they can be incorporated into the code.

Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 
I’m trying to use your library on a custom IMAP client I’m writing here at work, and I’m not sure I’m using the ASynch client correctly. Here’s what I’ve got going now, which is giving me a strange error:
There is no source code available for the current location.
I’m having a hard time getting the async library to work as expected, probably due to my lack of understanding of the request system.
I’m getting this stack trace:
System.ArgumentNullException was unhandled
Message=”Value cannot be null.\r\nParameter name: name”
Source=”mscorlib”
ParamName=”name”
StackTrace:
at System.Globalization.EncodingTable.GetCodePageFromName(String name)
at System.Text.Encoding.GetEncoding(String name)
at InterIMAP.Common.Processors.MessagePartProcessor.ProcessResult() in C:\Projects\S-Dev\imap-archival\1.0.0.2\InterIMAP-Async\InterIMAP\Common\Processors\MessagePartProcessor.cs:line 105
at InterIMAP.Common.Requests.BaseRequest.RunProcessor() in C:\Projects\S-Dev\imap-archival\1.0.0.2\InterIMAP-Async\InterIMAP\Common\Requests\BaseRequest.cs:line 157
at InterIMAP.Asynchronous.Client.IMAPConnectionWorker.DoRequest(IRequest req) in C:\Projects\S-Dev\imap-archival\1.0.0.2\InterIMAP-Async\InterIMAP\Asynchronous\Client\IMAPConnectionWorker.cs:line 234
at InterIMAP.Asynchronous.Client.IMAPConnectionWorker.DoWork() in C:\Projects\S-Dev\imap-archival\1.0.0.2\InterIMAP-Async\InterIMAP\Asynchronous\Client\IMAPConnectionWorker.cs:line 177
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I’m able to loop through the folders and get the uid list, then pass that to a fullmessagerequest, but Its throwing that above error.
private void FolderTreeCallback(IRequest req)
{
Console.WriteLine();
FolderListProcessor flp = req.GetProcessorAsType();
foreach (IFolder f in client.MailboxManager.Folders)
{
// folderListBox.Invoke(new UpdateFolderListCallback(UpdateFolderList), new object[] { f.FullPath });
//Console.WriteLine("Archiving: " + f.FullPath);
folder = f;
try
{
IRequest reqm = new MessageListRequest(f, getMessagesCallBack);
client.RequestManager.SubmitAndWait(reqm, false);
Console.WriteLine("Downloading..." + f.Name);
while (client.RequestManager.RequestPending)
{
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
private void getMessagesCallBack(IRequest req)
{
try
{
MessageListProcessor mlp = req.GetProcessorAsType();
Console.WriteLine("----- ");
//client.RequestManager.SubmitRequest(new FullMessageRequest(client, client.MailboxManager.GetMessageByUID(m, folder.ID)), false);
foreach (int m in mlp.UIDs)
{
IMessage msg = client.MailboxManager.GetMessageByUID(m, folder.ID);
Console.Write(m + ":");
FullMessageRequest fmr = new FullMessageRequest(client, msg);
fmr.MessageComplete += new FullMessageCompleteCallback(fmr_MessageComplete);
fmr.Start();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
Seems to be related to this line:
Line: 107 MessagePartProcessor.cs
content.TextData = Decode(preEncoded, Encoding.GetEncoding(content.Charset));
System.ArgumentNullException was unhandled
Message=”Value cannot be null.\r\nParameter name: name”
Source=”mscorlib”
ParamName=”name”
StackTrace:
at System.Globalization.EncodingTable.GetCodePageFromName(String name)
at System.Text.Encoding.GetEncoding(String name)
at InterIMAP.Common.Processors.MessagePartProcessor.ProcessResult() in C:\Projects\S-Dev\imap-archival\lib\InterIMAP-Async\InterIMAP\Common\Processors\MessagePartProcessor.cs:line 105
at InterIMAP.Common.Requests.BaseRequest.RunProcessor() in C:\Projects\S-Dev\imap-archival\lib\InterIMAP-Async\InterIMAP\Common\Requests\BaseRequest.cs:line 157
at InterIMAP.Asynchronous.Client.IMAPConnectionWorker.DoRequest(IRequest req) in C:\Projects\S-Dev\imap-archival\lib\InterIMAP-Async\InterIMAP\Asynchronous\Client\IMAPConnectionWorker.cs:line 234
at InterIMAP.Asynchronous.Client.IMAPConnectionWorker.DoWork() in C:\Projects\S-Dev\imap-archival\lib\InterIMAP-Async\InterIMAP\Asynchronous\Client\IMAPConnectionWorker.cs:line 177
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
@Chris, i just got that same error when i was testing the code the other day. you can fix it by changing that line to this: