smiley22 / S22.Imap

A free, easy-to-use and well-documented .NET library component for communicating with IMAP servers
http://smiley22.github.com/S22.Imap/Documentation/
MIT License
210 stars 112 forks source link

Getting multiple messages #77

Open johnshahin opened 10 years ago

johnshahin commented 10 years ago

I just wanted to make a suggestion. I was building a Gmail integration using this library and I noticed that the GetMessages methods call GetMessage for each UID. This results in a separate IMAP request being sent to retrieve each message. When downloading larger mailboxes this can slow things down a lot, particularly on less than impressive internet connections. I was able to get much better performance by modifying the GetMessages methods to call new methods which make batch IMAP requests. I just thought that you may want to consider this for future updates to the library.

ghost commented 10 years ago

I migrated to s22.Imap library yesterday from mailSystem.Net. It worked perfectly and fetched the mails much faster. my problem is that suddenly today I discovered that my account at imap.gmail.com is suddenly throttled and I cant retrieve mails anymore. Can it be related to the fact you mentioned that a separate request is sent to retrieve each message? what can be done to fix that ? can you share your code adjustments to GetMessages to makes the batch IMAP requests ? Thanks, Eran.