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
1 answer

Why i get the "ERROR: FETCH command error: BAD" at this Python-Code?

I'm working on a code in python, which should search all the email-addresses in a csv-file (they're saved with their passwords) for a specifig subject. Everything works fine, but if i put a specifig subject to the search, i get a big problem. This…
0
votes
0 answers

python2.7 imaplib hangs. please me

I am using python2.7 imaplib. When fetching an email message with the fetch command, my program becomes a wait state. Occurs only on a specific server. I finded Waiting section in code I guess this problem is like crlf or EOL in tcp socket…
0
votes
1 answer

How to set one instance of imaplib mailbox for few threads?

How can i set one mailbox parser for user in few different threads ? Each user have 2 or more companies which mails he should parse. In my expample i'm always had errors. class User(): services = {'company1': 'STOPED', …
Acamori
  • 327
  • 1
  • 5
  • 15
0
votes
1 answer

TypeError sequence item 0: expected str instance, bytes found

for some reason i keep getting the TypeError at this TypeError Traceback (most recent call last) < ipython-input-19-3490eb36442d> in 2 result, numbers = mail.uid('search', None, "ALL") 3 uids =…
SuperLmnt
  • 1
  • 1
  • 1
0
votes
1 answer

Using python and imaplib4, how to download an email attachment and move into folder on desktop?

I'm using python and the imaplib4 module to find an email, download its attachment to an output directory. I keep getting the following error (I attached a picture of the error below): imaplib.IMAP4.error: command FETCH illegal in state NONAUTH,…
BrianBeing
  • 431
  • 2
  • 4
  • 12
0
votes
0 answers

smtplib repeating send unnecessarily

I'm running a script that will both fetch emails (imaplib) and will send alerts back to my personal email using smtplib. I am running it on my raspberry pi 24/7 and so when I am not at home I want to check that the program is still running…
GSatterwhite
  • 301
  • 1
  • 3
  • 12
0
votes
0 answers

imap EOF error when fetching emails from inbox

im trying to fetch the body of emails from a gmail account using imaplib. Here's the code i've come up with: import imaplib import email user = '********@gmail.com' password = '*********' imap_url = 'imap.gmail.com' def get_body(msg): if…
GSatterwhite
  • 301
  • 1
  • 3
  • 12
0
votes
1 answer

Python imaplib recover emails with \\Deleted flag and move to trash

I've been getting a lot of spam emails from various colleges. I wrote a simple Python program to go through my emails, and find all the ones whose sender ends in .edu. Then, to delete it, I though I was supposed to add the \\Deleted flag to those…
Caleb H.
  • 1,657
  • 1
  • 10
  • 31
0
votes
0 answers

Forwarding an outlook/exchange email using python

I'm trying to read an email, get the headers (from, to, cc, subject) and body of an email and forward the email (forwarding email will vary based on the from). I've referenced the post to write my code. I was able to forward few emails, but few…
Prudhvi
  • 1
  • 1
0
votes
0 answers

Imaplib interpretes the email timestamp without daylight adjustments

I have a script which processes data relating to the previous provided by an e-mail which arrives everyday at 00:30. So the data for the 30th March 2019 would be sent at 00:30 on 31st March. I extract the e-mails using the following code in Python…
Pascal
  • 1
  • 1
0
votes
1 answer

Python IMAP: CSV Database Issues

I'm making a pseudo-database using a .csv file. Essentially what I'm trying to do is when I launch my code, I open the .csv file and read in all values to an array tempDB, before entering my infinite loop to routinely check if a new email with a…
JCoder96
  • 178
  • 13
0
votes
1 answer

find a hyperlink in Gmail body python 3

I am making a program to automatically read emails and click automatically a hyperlink in that email body. A taxi company provides contractions from email. immediately need to click on link in email. I am using imaplib , selenium , re to code…
0
votes
1 answer

imaplib mailbox with "&" won't open

I adapted script from http://tech.franzone.blog/2012/11/24/listing-imap-mailboxes-with-python/ to identify each and every mailbox on my IMAP4 email sever. The following script is designed to backup email messages on the server. The script below…
0
votes
1 answer

Python: Imaplib error

import serial import imaplib from time import sleep IMAP_SERVER='imap.gmail.com' IMAP_PORT=993 ser= serial.Serial ('/dev/ttyACM0',9600) while True: M = imaplib.IMAP4_SSL(IMAP_SERVER, IMAP_PORT) rc, resp = M.login('user@gmail.com',…
W. Gonzalez
  • 105
  • 1
  • 2
  • 5
0
votes
1 answer

Search for an email and then fetch its content(s) with Python 3+ imaplib module

I'm trying to make something that finds an email by its title and then searches its content for something. import email, imaplib, re, quopri username = "" password = "" mail = imaplib.IMAP4_SSL("imap.mail.yahoo.com", port=993) mail.login(username,…
Vaporwave30
  • 59
  • 1
  • 3