473,432 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,432 software developers and data experts.

IMAP SEARCH Error

I am using the imaplib to fetch mails. There is an error thrown in the
search function, which I am not able to comprehend.

My program is as follows :
====================
import imaplib

M = imaplib.IMAP4("10.1.1.1",1143)
M.login("roopesh", "roopesh12")
type, data = M.select("INBOX", 1)

print type, data
print M.status("INBOX", '(MESSAGES UNSEEN RECENT)')

typ, data = M.search(None, '(ALL)')

print typ, data
for num in data[0].split():
typ, data = M.fetch(num, '(RFC822)')
print 'Message %s\n%s\n' % (num, data[0][1])
M.close()
M.logout()

And the OUTPUT in the console is as follows :
==================================

OK ['24']
('OK', ['INBOX ( MESSAGES 24 UNSEEN 0 RECENT 0)'])
Traceback (most recent call last):
File "imap_test1.py", line 10, in ?
typ, data = M.search(None, '(ALL)')
File "c:\python24\lib\imaplib.py", line 602, in search
typ, dat = self._simple_command(name, *criteria)
File "c:\python24\lib\imaplib.py", line 1028, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "c:\python24\lib\imaplib.py", line 860, in _command_complete
raise self.abort('command: %s =%s' % (name, val))
imaplib.abort: command: SEARCH =unexpected response: '*'

Can anyone tell me why this happens ?

Regards
Roopesh

Jan 17 '07 #1
2 1785
imaplib.abort: command: SEARCH =unexpected response: '*'
>
Can anyone tell me why this happens ?
It looks like a server problem. What kind of server are you using ?
Exchange, Cyrus ?
Did you try with two different Imap servers ?
If it is a unix server, did you have a look in /var/log ? Or in windows
event log ?
Jan 17 '07 #2
Roopesh wrote:
I am using the imaplib to fetch mails. There is an error thrown in the
search function, which I am not able to comprehend.
I had difficulties with the imaplib, too. It is very low level. You need
to know some parts of the IMAP protocol.

I solved my problems by checking with ethereal (wireshark) what
other applications (KMail, getmail) do.

getmail is like fetchmail, but written in Python. I found some hints
by looking at its source.

HTH,
Thomas

--
Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: ni**************@thomas-guettler.de

Jan 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fabian Müller | last post by:
Hello, I would like to access (open) my remote IMAP Mailbox with the imap_open() function in PHP Version 5.0.4. The Mailbox is located at the german provider freenet.de. The imap_open()...
0
by: dekoffie | last post by:
Hello there, I'm trying to create a connection with an IMAP server which is secured through SSL. I can get the connection just fine, and I get a first respone from the server. But then I send...
0
by: Kevin F | last post by:
I'm trying to use the following code to get my remote server's folder size information. Unfortunately, i'm getting the error: Traceback (most recent call last): File...
1
by: Kevin F | last post by:
I'm trying to use the following code to get my remote server's folder size information. Unfortunately, i'm getting the error: Traceback (most recent call last): File...
0
by: Kevin F | last post by:
I've been trying to implement this script, it polls an IMAP inbox for unread messages and displays the sender and subject in a scrollable window using Tkinter. However, when I try to change the...
0
by: Kevin F | last post by:
Sorry to repost... but 4am didn't get much responses. I've been trying to implement this script, it polls an IMAP inbox for unread messages and displays the sender and subject in a scrollable...
5
by: Kun | last post by:
Hey guys, I would like to have a code in python (as simple as possible) to scan a specific folder in my mailbox and if the subject is equal to, say, 'BIKES', I would like to have the code...
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
0
by: contactme | last post by:
Hi, Is it possible to open concurrent connections using Net::IMAP::Simple library ? My IMAP server allows 4 connections per ip, so I am having following problems while using Net::IMAP::Simple and...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.