|
By so far ... i hear first time that IMAP server locks folder.
POP3 locks INBOX, and also not in all servers.
Lock easy to test with telnet.
telnet yourserver 143
-----
a1 login user password
a2 select inbox
open 2 telnets at same time
|
|
|
|
|
hello Ivar ..
i think my server allow to same login ang select folder as well i have tested..
so what you say ?now?
|
|
|
|
|
This error may come from fetch after select.
you should try to add line in telnet
a1 fetch 1 body[]
Also this error may happen if in under load both try same operation at same time, then you can't reproduce it in telnet.
|
|
|
|
|
I have open 2 telnet and try same login and same folder that is inbox and try to fetch
for eg
a1 LOGIN MyUsername MyPassword
a2 SELECT INBOX
a3 fetch 660555001 body[]-- this response me -a3 OK Fetch completed
what is happening i dnt know but is it matter ? because my issue is multiple connection that is in this case my server allow me . ..
i am too confused what is going on . i am just beginner in this type of application .
NOTE : i not trying to fetch same email beside i use same login and same folder but not same email
|
|
|
|
|
Only thing what i can suggest ...
for(int i=0;i
|
|
|
|
|
hello,
i think i m doing lik this except use of sleep..so what will effect of it ?
here is demo structure of my fetching mails look at this
int[] saArray = null;
saArray = GetUnreadMessages();
//IMAP_Client imp = new IMAP_Client();
IMAP_SequenceSet seqSet = new IMAP_SequenceSet();
for (int i = 0; i < saArray.Length; i++)
{
try
{
SetStatus("Fetching Mails...");
BMailBody mailBody = GetMailMessage(saArray[i].ToString());
}
catch
{logout();}
}
and GetMailMessage()
{
try
{
IMAP_Client_FetchHandler fetchHandler = new IMAP_Client_FetchHandler();
fetchHandler.Rfc822 += new EventHandler<IMAP_Client_Fetch_Rfc822_EArgs>(delegate(object s, IMAP_Client_Fetch_Rfc822_EArgs e)
{
m_pTabPageMail_MessageAttachments.Items.Clear();
MemoryStream storeStream = new MemoryStream();
e.Stream = storeStream;
e.StoringCompleted += new EventHandler(delegate(object s1, EventArgs e1)
{
storeStream.Position = 0;
Mail_Message mime = Mail_Message.ParseFromStream(storeStream);
//m_pTabPageMail_MessagesToolbar.Items["save"].Enabled = true;
//m_pTabPageMail_MessagesToolbar.Items["delete"].Enabled = true;
m_pTabPageMail_MessageAttachments.Tag = mime;
foreach (MIME_Entity entity in mime.Attachments)
{
ListViewItem item = new ListViewItem();
if (entity.ContentDisposition != null && entity.ContentDisposition.Param_FileName != null)
{
item.Text = entity.ContentDisposition.Param_FileName;
}
else
{
item.Text = "untitled";
}
item.ImageIndex = 0;
item.Tag = entity;
m_pTabPageMail_MessageAttachments.Items.Add(item);
}
if (mime.BodyText != null)
{
strTxtBody = mime.BodyText;
strEmailBody = mime.BodyHtmlText;
date = mime.Date;
mm = mime.From;
addlist = mime.To;
//sender = mm[0].Address.ToString();
//to = addlist.Mailboxes[0].Address.ToString();
//subject = mime.Subject;
//convert Emailbody to pdf
mailBody.subject = mime.Subject;
mailBody.subject = toPdfConvert.RemoveSpecialCharacters(mime.Subject);
//string paramSourceBookPath = toPdfConvert.HTMLFileCreater(strEmailBody, subject);
if (strEmailBody != null)
{
paramExportFilePath = toPdfConvert.Word2PDF(toPdfConvert.HTMLFileCreater(strEmailBody, mailBody.subject));
}
else
{
paramExportFilePath = toPdfConvert.Word2PDF(toPdfConvert.HTMLFileCreater(strTxtBody, mailBody.subject));
}
mailBody.BodyPDF = toPdfConvert.FileToByteArray(paramExportFilePath);
mailBody.from = mm[0].Address.ToString();
mailBody.ToEmailId = addlist.Mailboxes[0].Address.ToString();
mailBody.recvDate = date.ToString("d");
mailBody.recvTime = date.ToString("t");
mailBody.parseDate = DateTime.Now.ToShortDateString();
mailBody.parseTime = DateTime.Now.ToShortDateString();
}
});
});
IMAP_SequenceSet seqSet = new IMAP_SequenceSet();
seqSet.Parse(uid.ToString());
imap.Fetch(true,seqSet,new IMAP_Fetch_DataItem[]{ new IMAP_Fetch_DataItem_Rfc822()},fetchHandler);
}
catch()
{
logout();
}
}
|
|
|
|
|
Before you retry, it's wise to wait some time to allow other process to complete.(in case you lock removed)
|
|
|
|
|
ya even right now i can open 2 clients with same login and if i am trying login at same i got exception as you know but if i logout from one then second can login and if second is logout then first can login.
i want to run it parallel.
|
|
|
|
|
Hey i found some comments in selectfolder method
" Only one mailbox can be selected at a time in a connection;simultaneous access to multiple mailboxes requires multiple connections. " and i got exception from this method
" SELECT folder INBOX is locked by another connection"
is it what trying to say only one application can select folder ?
|
|
|
|
|
thmeans you need to create multiple IMAP client instances to access same accoutn at same time.
|
|
|
|
|
yes that is what i am doing ..right ?
but still what is happening with server or application i am damn confused what i need to do
now i am tired may be you also ha ha .. sorry and thanks for such a instant help..
|
|
|
|
|
to be honest, i don't know what are you doing.
|
|
|
|
|
oh..so you dont get what i am trying to say till now ?
it may be because of lake of communication ..
|
|
|
|
|
I'm talking about coding side.
Code can be written many ways, some "way" may have dead end.
Just discussing and seeing some code fragments, i can't say what you do wrong or how to handle some situations right.
As earlier said, you should try catch error and retry operation after failure, but sleep between to allow server lock to be released.
|
|
|
|
|
yes i did it what u said let see it helps me or not .
and about code i have just copy and paste methods in your sample application where i needed and dont modified even core methods.the only difference is i have handle it automatically rather i dont have to click anywhere ..
|
|
|
|
|
Hello Ivar ,
I am waiting for my last question, and now i have new question .
i am doing following process and i get "Re-Authentication error ".
public void Connect(string host, int port, bool ssl); from TCP_Client
public void Login(string user, string password); from IMAP_Client
then ----imap.Disconnect();
again imap.Connect() with check imap.IsConnected property
then imap.Login() ---here where i got exception "Re-Authentication"
my question is that when i am using imap.Disconnect(); then it should automatically disconnect and also remove authenticity as well but i got exception ..
so what should i do to complete disconnect from server ..after i disconnected from server i want to process whole thing again i am doing first time login ..or any way to prevent this..
please help me as soon as possible.
|
|
|
|
|
Hi,
Yes you are right thats bug. Funny noone reused IMAP_Client before, seems everyone created new instance, so error never rised.
SVN version is fixed now.
|
|
|
|
|
Hello
So what i need to do ? from where i can download latest version as i have no download link now.
|
|
|
|
|
You must install some SVN client(like http://ankhsvn.open.collab.net/downloads), then you can open project from source code server.
SVN:
https://svn.lumisoft.ee:8443/svn/LumiSoft_Net/
User: readonly
Password: readonly
|
|
|
|
|
hello ,
I have downloaded LUMISOFT.net dll from your site as i am developing some tool which fetch unread mail continuously without any client interaction for business process so how can i get number of unread mail by folder name("INBOX").
and one more thing i have just starting using this library so please i hope i will get full future guidance to use of this library .
hope will get reply soon.
|
|
|
|
|
Hi,
You must use search command.
Something like that:
imapClient.Search(true,null,"(\unseen)")
this gives you UID's of unseen messages, after it you can fetch them.
|
|
|
|
|
hello ,
i have tried with this --->imap.Search(true, null, "(\\unseen)");
but it give exception following.
"NO UID SEARCH unrecognised arguments".
i want to debug this library but i couldn't.
what should i do ?
Regards ,
Jay panchali
modified on Friday, January 7, 2011 4:34 AM
|
|
|
|
|
You may try imap.Search(false
May be that server won't support UID extention.
Also you may try "\\unseen" without parentheses, but server shuld accpet both syntax.
|
|
|
|
|
hello ,
thanks i have done with search mail which is unread now i got this exception ,so what should i have to do to increase seconds to fetch mail because i don't want to drop or skip any mail. tell me how many changes i have to implement.?
"Failed to parse message within 30 seconds."
note :mail is also not so high volume it has just 1mb attachment only.
modified on Tuesday, January 11, 2011 12:50 AM
|
|
|
|
|
hello
can i do something like move 1 email which is in unread folder on my server and i want to move particular mails to other folder lik unread to inbox folder..pls help me about this as it is my current R&D topic
|
|
|
|