Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > searching imap mail folder but excluding one subfolder

Reply
Thread Tools

searching imap mail folder but excluding one subfolder

 
 
Kevin F
Guest
Posts: n/a
 
      03-23-2006
I have code that searches under the default folder (inbox) but I would
like to modify it to search for everything in that folder with the
exception of one subfolder where I would like it not to search.

my current code is:


from imaplib import *
import getpass

server = IMAP4("webmail.xxxxx.xxxx.edu")

server.login('username', getpass.getpass())

r = server.select("Inbox")

r, data = server.search(None, 'SUBJECT', 'WALLET ENLARGEMENT')
for num in data[0].split():
server.store(num, '+FLAGS', '\\Deleted')
server.expunge()


how do i modify it so that, for example, it searches in inbox but does
not search in a specific subfolder 'opim' under inbox?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
imap and Tmail. Getting whole email with imap Adam Akhtar Ruby 1 12-15-2008 10:55 PM
net/imap - imap.search "TO" can't find email jasonnaylor Ruby 1 04-16-2008 04:05 AM
Writing IMAP->GMail proxy... Where to go for IMAP RFC help? Jon Fi Ruby 4 10-21-2006 09:00 PM
Curier-IMAP and imap.create() Henrik Ormåsen Ruby 0 08-19-2006 06:29 AM
Searching but excluding zip files Steve Freides Computer Support 1 12-30-2003 05:19 AM



Advertisments