Questions tagged [imaplib]

Python module to provide an Internet Message Access Protocol (IMAP) client implementation. This protocol lets you access mail folders stored on a central mail server, as if they were local.

Python module to provide an Internet Message Access Protocol (IMAP) client implementation. This protocol lets you access mail folders stored on a central mail server, as if they were local.

694 questions
0
votes
2 answers

PHP requests processing in serial not parallel

I wrote a page (cron.php) that uses the imap library to connect to a mailbox, parse messages, and store them in a database, then echos the results in json. I have a few dozen mailboxes that I need to run this same process for, and so I put together…
ehed
  • 804
  • 1
  • 8
  • 18
0
votes
0 answers

How to use search imaplib

I need to download only emails from the IMAP server which are older than a certain Linux timestamp. The Linux time stamp has to be to the second. This gets updated as per the server time. Example : datetime.now().strftime('%d-%b-%Y…
Vishal Khialani
  • 2,557
  • 6
  • 38
  • 49
0
votes
1 answer

search for string in msg python

I can print each email. What I want to do though is search each email for a string and return true of false if it has the string. How can I parase msg to do this? conn.select(readonly=1) # Select inbox or default namespace (retcode, messages) =…
David Vasandani
  • 1,840
  • 8
  • 30
  • 53
0
votes
3 answers

Using IMAPClient how do you view the Senders address?

Using IMAPClient how do I view the message body and the senders email address? server = IMAPClient(imap_server, use_uid=True, ssl=ssl) server.login(imap_user, imap_password) print 'login successful' select_info =…
David Vasandani
  • 1,840
  • 8
  • 30
  • 53
0
votes
1 answer

Copying mail from Imap to Gmail and keeping org date

Iam working on a script to move mails from a imap server to gmail via imap. I got it to copy the mails over and create the labels, but it sets the date to be now instead of to original date, when i look in gmail. # fetch header of current mail form…
Tommyka
  • 665
  • 1
  • 5
  • 9
0
votes
1 answer

How to deal with flooded unseen messages

I have written an email parsing mechanism in python. It finds a new email and passes the data correctly. I am 99.999% certain that my code is functioning correctly, so there should be no issue there. The problem is that occasionally, the Gmail…
jml
  • 1,745
  • 6
  • 29
  • 55
0
votes
1 answer

IMAP search on header not working as expected

I am building library for IMAP my search command works file for the Inbox folder it returns me a number which I can use to fetch the mail. However when I try to search on Sent Items it does not work it does not give an error but just returns Search…
Vikas
  • 11
  • 2
0
votes
1 answer

Parse error passing search criteria to imaplib

This may be a newbie question, but I can't figure out why I can't successfully pass parameterized search criteria to imaplib. Setup code is: M = imaplib.IMAP4_SSL("imap.gmail.com", 993) M.login("usrname", "passwd") typ, data = self.M.select() #…
richmill
  • 1
  • 1
  • 2
0
votes
2 answers

fetch only content of email

I'm attempting to return ONLY the message content of a message that I am fetching from an IMAP server. I feel like I got this to work at one point without an issue, but I'm currently getting a bunch of garbage returned. Here is the content I get…
jml
  • 1,745
  • 6
  • 29
  • 55
0
votes
1 answer

PyQt GUI freeze during imap connection (imaplib)

I have written a python program with a PyQt GUI that, using the imaplib, checks if I have new mails, here is part of the code: def getAccountStatus(self, accountIndex): # some not interesting code mail = imaplib.IMAP4_SSL(currentHost) #…
0
votes
1 answer

Imaplib Select Fails while connecting folder(**Labelname) of gmail

I am using imaplib module for connecting to Gmail Imap, and i am getting the below mentioned error. I am using select command to connect Labelname is **LabelName I Get this Error: resp, data = self._imap.select("**LabelName") File…
Anurag
  • 956
  • 2
  • 8
  • 21
0
votes
2 answers

How can I print organized ngrams from my email?

I need to do two things at this point but I need your help: A best practice to clean up data - programmatically deleting superfluous tags & the '>>>>>>>', plus other non meaningful communication flotsam and jetsum Once it's cleaned - how do I pack…
Will J
  • 79
  • 1
  • 10
-1
votes
1 answer

Python code freezes(continuously running not showing any error) at imaplib.starttls() while connecting to outlook imap

I am using below code to connect outlook. import imaplib import msal #Below code try to connect the Azure Cloud and get the access token and authenticate the outlook email conf = { "authority":…
nikhilesh kumar
  • 53
  • 3
  • 13
-1
votes
1 answer

How do I download attachments from gmail?

I was able to locate the JSON file I want to download from attachment using : part.get_content_type() == "application/json" But have no idea on how to actually download and save it to local directory can someone pls help? Here is the whole…
karasu671
  • 1
  • 1
-1
votes
1 answer

Fetch emails through IMAP with proxy of form user:password:host:port

I have code to login to my email account to fetch recent emails: def fetchRecentEmail(emailAddr, emailPassword, timeout=120): host = fetch_imap_server(emailAddr) # e.g. 'outlook.office365.com' with IMAP4_SSL(host) as session: …
P i
  • 29,020
  • 36
  • 159
  • 267