Questions tagged [imap-tools]

42 questions
4
votes
2 answers

imap_tools Not Fetching New Emails

I am trying to use imap_tools to fetch new emails. For some reason it only seems to fetch emails that were already in my inbox when I log in. Can anyone see what I am doing wrong? mailbox.login(email, password, initial_folder='INBOX') print("Logging…
Robsmith
  • 339
  • 1
  • 8
3
votes
1 answer

How to delete messages with imap-tools

I use the following code to delete messages from my IMAP server uids = [] for msg in mailbox.fetch(filter): print(msg.uid, msg.date, msg.from_, msg.subject) uids.append(msg.uid) mailbox.delete([msg.uid]) That doesn't delete the intended…
Robin
  • 33
  • 2
2
votes
1 answer

"EOF error" when fetching emails in bulk using imap_tools python

I've build a very simple script that fetches emails from an Outlook inbox. It looks like this: from imap_tools import MailBox inbox = MailBox("outlook.office365.com").login("email", "password") for email in inbox.fetch(): # bulk=True …
2
votes
1 answer

How to get "starred mails" from Gmail or other mail services using IMAP_tools in django

I am able to get inbox emails and also able to get emails from specific folder but i am unable to get "starred" emails. I tried below code. and i am expecting emails with "starred flag" in response. from imap_tools import MailBox, A # Create your…
Sneha Makwana
  • 53
  • 1
  • 4
2
votes
0 answers

Error in login imap-tools: "Response status "OK" expected, but "NO" received"

I'm having the following error: Response status "OK" expected, but "NO" received. Data: [b'LOGIN failed.'] I'm using the library imap-tools. My code is in Python: from imap_tools import Mailbox, AND with…
2
votes
1 answer

Create new email message without attachments (IMAP)

I would like to go through my emails and save big attachments in a file folder. Once the attachment is saved, I would like to replace the attachment with a note where to find the original attachment. My understanding is that I have to make a…
divingTobi
  • 2,044
  • 10
  • 25
2
votes
1 answer

Using Idle with Imap_tools and Yahoo

I am trying to test the idle functionality of imap_tools on my Yahoo mailbox. I have gone through the steps to allow third party apps, etc but I keep getting an error (included below). I am using the example given on Github. Is this an error in the…
James
  • 390
  • 1
  • 9
2
votes
1 answer

Is it possible to adress a second shared exchange mailbox with imap-tools?

Using imap-tools, it's perfectly possible to access and work with my main exchange mailbox account. But I've got a second mailbox (it's not just a different folder within my main INBOX, but a different shared exchange mailbox, which I have access…
Jonas
  • 1,749
  • 1
  • 10
  • 18
1
vote
0 answers

Print Email body using imap_tools in python

I've been trying to print email body using python(using imap_tools lib)but it's not really working for me. here is the code snippet. from imap_tools import MailBox, A, AND, OR, NOT with MailBox('outlook.office365.com').login('test@test.com', 'test')…
1
vote
2 answers

Imap-tools. Mark as 'seen' only messages with attachments

I am using imap-tools to download attachments from unread emails. I need mark as seen only those messages that contain attachments and have been downloaded. The code below works, but marks all unread messages as seen. import ssl from imap_tools…
xiii
  • 13
  • 2
1
vote
1 answer

Search Email Of Last N Minutes Using IMAP-TOOLS

The following code uses IMAP to log into an Outlook email and checks the contents of the Junk folder. It returns the content of the last unseen email with subject "Title". I would like to add one thing to the source code. Is it possible to get the…
user18265446
1
vote
1 answer

how to use UIDs in imap_tools?

I would like to hold a cache of emails to a group, and verify that the cache is not missing any uids periodically. First thing I tried was this method using imaplib which the search comes back with all UID's of the Mailbox. Then you verify all ids…
Peter Moore
  • 1,632
  • 1
  • 17
  • 31
1
vote
2 answers

How to get unseen emails using python imap-tools

from imap_tools import MailBox, AND import re yahooSmtpServer = "imap.mail.yahoo.com" client = MailBox(yahooSmtpServer).login('myEmail', 'myPassword', 'INBOX') for msg in client.fetch(AND(seen=False)): mail = msg.html print(mail) …
M MO
  • 323
  • 4
  • 16
0
votes
1 answer

How to use a simple IO function asynchronously?

I was looking for an asynchronous library for imap and I found this library called imap_tools and find it very easy to use and really want to stick with it but its not asynchronous. The reason I want it to be asynchronous is because I want to use it…
0
votes
0 answers

How to send and receive gmail without app password using email password

I was wondering if there was a way to be able to use the email password to get emails from imap.gmail.com instead of making app passwords. If not is there a way to automate the process and request the user to accept terms and have the app password…
1
2 3