|
Hello Ivar,
I have my own email server and having mail web client ,what i am doing that i logged in from my custom client , while i am fetching mail from custom client i am trying to refresh my web client or refresh my inbox and by doing that my web client gives following alert
"unable to open folder /INBOX because it is locked."
i just want to know that can i run different client on different machine using same email & pass if yes then what this message indicate?
Note: my custom client using your library.
please tell me something about can i do it..?
|
|
|
|
|
Hi,
It's server response, so this message is dependant to server.
If you use POP3, by specification pop3 allows 1 connection at time to mailbox, so problem may be there.
In case of IMAP, don't know why server locks inbox.
|
|
|
|
|
hello
yes i know that is server response and IMAP allow multiple login and can synchronize as well but side by side i have another free library which i was used for same my custom client and i was doing same thing i explain before and i don't get this type of server exception that is why i have to ask you.
And my custom client going to implement like 2 client on different machine and with same login so if your library dont allow me to do that then it may be problematic to me .
Help me if you can cause i want to use your library,it is good one.
|
|
|
|
|
Do you select folder "/INBOX" as in eerror text says "unable to open folder /INBOX because it is locked".
Or just "inbox" ?
Test IMAP client deom application:
http://www.lumisoft.ee/lswww/download/downloads/Examples/
If there is something wrong with imap client, that app must generate same error.
|
|
|
|
|
hello ,
1. That exception is thrown by not custom client(used Lumisoft.net) its thrown by web client and its provided by company from where we buy mailserver.
2.I just pass "INBOX" to method provided by Lumisoft method.
3.I have used and checked that sample.
i just want to know if any method in lumisoft.net lock this account that dont allow multiple account or what like by selecting folder we can examine or select folder.
is there any command in IMAP that locks account while other client fetching ?
i hope you are getting my point as my english is not pretty good to explain ..
|
|
|
|
|
>is there any command in IMAP that locks account while other client fetching ?
There is no lock in IMAP. IMAP standrard allows multiple clients to fetch data at same time.
|
|
|
|
|
ok thanks for help
now another exception i got from fetch method
"Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall."
What is it ?
|
|
|
|
|
Seems there is something wrong with your computer.
You should try your test application on another comuter.
Or at least if some xx virus/firewall soft, try to turn it off.
|
|
|
|
|
thanks but it was just for one time only after i don't get that exception again.
nothing wrong with my computer it seems good with other client as well.
thanks.
|
|
|
|
|
hello ,,
hi Ivar now i have something to show you what i told to you that lumisoft lib lock something with client that is folder ..what i have done is i run two client on same machine or different machine doent matter but when i run it at same time with same account i got exception that is
"NO UID FETCH could not lock folder (error 33)"--it seem that may library lock folder and another couldnt access that folder i think so ,however it comes from Fetch(), please look at this and tell me what i have to modify in library .
please please ..i need help ..
modified on Tuesday, February 1, 2011 2:02 AM
|
|
|
|
|
Hi,
"NO UID FETCH could not lock folder (error 33)"--
Thats IMAP server response, so local apllication not related directly.
As also said IMAP has now way to forece locking folders on server.
The onyl explanation is that your IMAP server locks folders for some reason ... per standard IMAP allows multiple access to any folder.
|
|
|
|
|
hi,
here i got another exception from selectfolder " SELECT folder INBOX is locked by another connection" from selectFolder()
and this is from particular in response object and this object generally contains responses from IMAP server right? so may be my IMAP server locked folder or you can say IMAP configured like that i can not allow multiple connection is it what i understand ? ...
|
|
|
|
|
Yep, seems your IMAP server allows only 1 connection per folder.
|
|
|
|
|
ok.. we may configure also IMAP server to allow only 1 connection at a time ?is it so?
ok thanks i hope this is only problem cause without allowing multiple connection to server my application not worth it because i want implement my application that way that work as load balancing as well...
thanks a lot
modified on Tuesday, February 1, 2011 4:15 AM
|
|
|
|
|
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..
|
|
|
|