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
-1
votes
2 answers

Splitting Account Name from email address

I've search thru the net but I saw splitting email addresses which doesn't satisfy my needs. Basically imaplib returns the sender's email as Account Name I need to extract the email address only because that's what the…
CSAPawn
  • 47
  • 6
-1
votes
1 answer

How to search for email where the subject contains numbers

I'm looking for emails where the title has information on how many Bitcoin I received, but as there's a number in the email title, I want a way to find emails where the number is equal to or greater than that number. Example... I have an email title…
Dkns
  • 45
  • 2
  • 10
-1
votes
1 answer

Cannot resolve module 'imaplib2' has no attribute 'IMAP4_SSL'

There are many questions regarding imaplib2 has no attribute IMAP4_SSL but none of the solutions in the other questions worked for me. I have a python script that's been running without issue for years on AWS, but after I upgraded to Ubuntu 20.04.2…
RHPT
  • 2,560
  • 5
  • 31
  • 43
-1
votes
1 answer

Converting string from email

I am trying to write a program that will scan my email inbox and take further action if the first word in the email is "Password". However, my specific condition if message_str[:9].lower() == 'password': always defaults to false, even though the…
Bob Tan
  • 103
  • 6
-1
votes
2 answers

Searching for UTF-8 encoded subjects with imaplib

I have some working code to fetch mail bodies and I want to filter the subject with a non-ascii string. Other forums suggest using the .uid class to do so, but the behavior is not logic to me. Current code: import imaplib import email username =…
Simon W
  • 13
  • 4
-1
votes
1 answer

Python / Email processing: How to get the date an attachment was created?

I have a Python program that will read an Outlook inbox using these Python libraries: 1. IMAPClient 2. email I want to know if it is possible to get the date the email attachment was created. I don't see anything in email headers that stand out. I…
user10664542
  • 1,106
  • 1
  • 23
  • 43
-1
votes
1 answer

Fetch Mail from email account (Password contains Special Characters)

I am trying to fetch mail from a email account, I cannot login when I have password with special characters. import imaplib username = 'test@test.com' password = "test!002" imap_server = 'imap.test.com' mail =…
Gaurav Modi
  • 82
  • 1
  • 10
-1
votes
1 answer

Problem with gmail mailbox

Normally, I use imaplib (python lib.) to display mailbox name (example [Gmail]/Spam ) But recently I found my friend account has a different prefix (example [Google]/Spam). What's the difference between normal account and my friend's account.:)
vernomcrp
  • 3,459
  • 11
  • 34
  • 44
-1
votes
1 answer

Sorting email in descending order

In reference to my previous question (Solved): Only show certain number of emails in imaplib So now I can show certain number of emails in my inbox but the problem I'm having now is that I would like to output it in descending order. It says here:…
hocuspocus31
  • 183
  • 1
  • 10
-1
votes
1 answer

Handling Amazon SES bounce notifications to email using python imaplib

I want to retrieve the invalid emails from mail delivery notification sent to my email endpoint from Amazon SES. I don't know how to give arguments to imap4.search() and imap4.fetch() methods in the imaplib module. Help please
skv625
  • 11
  • 3
-1
votes
2 answers

Imaplib with GMail offsets uids

I'm querying my gmail inbox using pythons ImapLib with a range parameter, but my returned uids are offset from what I request. My request is as follows: M = imaplib.IMAP4_SSL('imap.gmail.com') M.login(USER, PASS) # Choose the inbox for finding…
Simon Thordal
  • 893
  • 10
  • 28
-2
votes
0 answers

python imaplib receives an seen e-mail in unseen mailbox

I received some email flaged seen with mail_status="UNSEEN".Below is my code.I would be very grateful if you could help me. def get_email(self, mail_index=None, mail_status="UNSEEN", mailbox="INBOX"): …
king
  • 1
-2
votes
2 answers

Why does an 'IMAP search by header' fail when the header value is given by a variable, not a string?

I can get the uid of an email that has a certain header value like this: res, tmp = self.mail.uid('search', None, '(HEADER Message-ID "<123.456.789@localhost>")') Then, tmp becomes [b'2993'] But I get that Message-ID value from a file,…
yoon
  • 1,177
  • 2
  • 15
  • 28
-2
votes
1 answer

IMAP library not found in my robot framework script

I have successfully installed IMAP library for robot framework but still showing me error as 'Import file not found'. I am using Pycharm editor for robot framework to create scripts also intellibot plugin is installed. Currently I am trying to run…
Amol
  • 3
  • 4
-2
votes
1 answer

Python, combining if and for loops

Hi so I have this program which basically goes into the inbox and then looks at the latest email. Scans it and if it has a link it gives you a notification, or if it has an attachment it gives a notification. Everything is working fine although I…
idwithin
  • 47
  • 1
  • 2
  • 8
1 2 3
46
47