Questions tagged [imap-tools]
42 questions
0
votes
1 answer
Marking Emails Unread after Reading with imap_tools
I am trying to fetch unread emails using imap_tools then want to mark them as read. I have tried using mark_seen but I end up in an indefinite loop rereading the emails that have been marked as unread. Here's my code snippet:
msgs =…

Robsmith
- 339
- 1
- 8
0
votes
1 answer
Python. imap_tools. Cant use search criteria
Why did this script didn't work?
I've tested on gmail.com, IMAP, mail.ru, yandex.ru IMAPs.
from imap_tools import MailBox, AND, A
mb = MailBox('imap.gmail.com').login('email', 'password')
messages = mb.fetch(criteria=A(AND(seen=False),…

SviatoslavS
- 3
- 1
0
votes
1 answer
imap_tools Taking Long Time to Scrape Links from Emails
I am using imap_tools to get links from emails. The emails are very small with very little text, graphics, etc. There are also not many, around 20-40 spread through the day.
When a new email arrives it takes between 10 and 25 seconds to scrape the…

Andy
- 509
- 2
- 7
0
votes
1 answer
Reading New Email Using UIDs with imap_tools
I have been scraping emails from a shared mailbox using imap_tools. The script checks the mailbox as frequently as possible and I use msgs = client.fetch(AND(seen=False)) to check only unread emails.
Even though I check frequently sometimes emails…

Andy
- 509
- 2
- 7
0
votes
1 answer
imap_tools Response status "ok" expected but "no" received Error
I am trying to scrape links from Yahoo emails but keep getting the following error. I have tried adding a sleep condition but it does not seem to have made any difference.
Response status "ok" expected but "no" received. Data: [b'[SERVERBUG] SELECT…

Andy
- 509
- 2
- 7
0
votes
1 answer
How to label a Gmail message with IMAP_mailbox (imap-tools)?
We can fetch a Gmail mailbox using Mailbox/IMAP_mailbox (imap-tools) as follows:
from imap_tools import MailBox as IMAP_mailbox
# Init
mailbox = IMAP_mailbox(HOST)
mailbox.login(username=USERNAME, password=PASSWORD)
# Fetch
messages =…

WJA
- 6,676
- 16
- 85
- 152
0
votes
2 answers
How to convert mails to eml?
Convert mails to EML?
I have a server of which I want to convert mails to EML to backup
How to accomplish this?
Tried the following;
import imaplib
import getpass
import argparse
argparser = argparse.ArgumentParser(description="Dump a IMAP folder…

Max
- 493
- 2
- 9
0
votes
2 answers
How to move ONLY messages that have attachments?
I have the following code moving all emails in a folder to the "Old" folder using Mailbox package:
with MailBox('mail.yu.nl').login('75090058@yu.nl', 'yu', initial_folder='INBOX') as mailbox:
mailbox.move(mailbox.fetch(), 'Inbox.Old')
Now, I…

Max
- 493
- 2
- 9
0
votes
1 answer
imaplib , imap_tools return an error after a few minutes. (imaplib.abort: command: SELECT => IMAP4rev1 Server logging out)
I use this code to get unseen and new messages from my yahoo mail and find the messages with a specific URL.
from imap_tools import MailBox, AND
import re
from config import email, password
from scrap import scrap
yahooSmtpServer =…

M MO
- 323
- 4
- 16
-1
votes
1 answer
How can I get the RESPONSE time of an email with python?
How can I get the RESPONSE time of an email with python?
I tried several ways using the imap_tools documentation. But without success

Paulo Amaral
- 1
- 1
-1
votes
1 answer
KeyError: '"mark_seen" is an invalid parameter.' - imap_tools
I'm trying to find some emails in my Gmail mailbox, using imap_tools and specific criterias.
This is my code:
import time
from imap_tools import MailBox, AND, A
with MailBox('imap.gmail.com').login('email', 'password', 'INBOX') as mailbox:
…

the_guy71639
- 55
- 4