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
0 answers

I want to get a better understanding of imaplib

I cannot find an appropriate guide for "How to use imaplib". For example, when I want to move a message to the trash, I find the statement: [Gmail]/Trash Why not just "Trash"? What is the '[Gmail]' extension and how to use it? Another example. For…
0
votes
0 answers

SSLError "UKNOWN_PROTOCOL" imaplib Python

I am trying to connect to an email server with my own credentials in Python. The script works great until the exception "SSLError" shows up. Sometimes it occurs as soon as starting up the script or after running the script for a few hours. I created…
E_R
  • 33
  • 6
0
votes
1 answer

Mark as unseen on Gmail (imaplib)

I'm trying to mark email as unseen on Gmail server. I'm using this command: res, data = mailbox.uid('STORE', uid, '-FLAGS', '(\Seen)') Everything goes OK but when I check it using web browser it's still marked as seen. When I check flags here's…
sstevan
  • 477
  • 2
  • 9
  • 25
0
votes
1 answer

Data responses in IMAP using Python

Dear users of Stack Overflow, My question is about how to use the returned data of an imap command in python (in this case printing the amount of messages in your inbox). What I was able to find on the internet is limited to the following two…
0
votes
1 answer

Py3.4 IMAPLib Login... 'str' does not support the buffer interface

Using imaplib, I'm trying to connect to a mailserver. When I include the password as just a normal string: 'password' It connects fine. But I'm trying to slightly obfuscate my password, so I previously had run it through b64encode, and then used…
wolf2600
  • 5
  • 2
0
votes
2 answers

Python imaplib deleting multiple emails gmail

my code look like this... import imaplib import email obj = imaplib.IMAP4_SSL('imap.gmail.com','993') obj.login('user','pass') obj.select('inbox') delete = [] for i in range(1, 10): typ, msg_data = obj.fetch(str(i), '(RFC822)') print i x = i …
killer
  • 372
  • 1
  • 5
  • 15
0
votes
1 answer

I can not connect to the mail with php script hostgator

I've tried many ways but can not connect to imap in hostgator hosting, how do Here is my code $mbox = imap_open("{mail.liveslink.com:143/notls/norsh/novalidate-cert}", "adriano@liveslink.com","clecio")or die(imap_last_error())or die("can't…
0
votes
1 answer

Only show certain number of emails in imaplib

The code I have below is working great but I am testing this on a test email and it only have around 5 emails. On my actual email account I have atleast 4k emails on my inbox. Is there a way for me to show for a certain number of emails. For…
hocuspocus31
  • 183
  • 1
  • 10
0
votes
0 answers

format imaplib output to a table view instead of list

I'm trying to retrieve my emails from our imap server and found that using imaplib is the way to do that. So I found this link https://gist.github.com/robulouski/7441883 that shows the basics on how to use imaplib. I followed the code and changed…
hocuspocus31
  • 183
  • 1
  • 10
0
votes
1 answer

Store email locally (imaplib, libpst)

I'm using imaplib to fetch emails for several accounts (Gmail, Yahoo..). What is the best way to store emails locally (including attachments). Is there any way to pickle and store emails as file? Is it possible to store emails as bytes and retrieve…
sstevan
  • 477
  • 2
  • 9
  • 25
0
votes
0 answers

sending mail via IMAP through action-mailer in rails

i am already implemented send mail through smtp protocol now i trying to implement via IMAP..protocol....what should i have to change in config/devlopment .rb config.action_mailer.default_url_options = { host: 'localhost', port: 9292} …
Debasish
  • 173
  • 2
  • 3
  • 14
0
votes
1 answer

Move to Gmail Archive - Python Imaplib

I'm trying to write a script which moves a particular email to Archive after getting its text, however I've looked all over the place and tried plenty of solutions. My understanding is that when a message is archived, all of its labels are removed…
Jerp Dertin
  • 71
  • 1
  • 9
0
votes
1 answer

PHP Imap: which unique identifier should i use?

Im in the meddle of creating a web app that downloads all the emails using imap library in php but im troubled on which id should i used, This is a sample email header retrieve from a gmail account. Array ( [0] => stdClass Object ( …
0
votes
0 answers

Python, How to move mail from junk to inbox in Outlook/Hotmail

I need to know how to move mail from the junk to inbox folder in Outlook using Python. I know that there is the imaplib and am wondering how to utilize imaplib to do this task.
sunny tran
  • 21
  • 1
0
votes
1 answer

How can i download a gmail attachment based on subject? ERROR : "No route to host" when connecting to imap.gmail.com

This is my first python code, so please excuse me. This is what i wrote. import imaplib import email import os import getpass email = 'br******@******.com' password = getpass.getpass('Enter your password: ') mail = 'imap.gmail.com' flag =…