Questions tagged [poplib]

A python class which encapsulates a connection to a POP3/POP3_SSL server and implements protocol as defined in RFC 1725.

This python module defines a class, POP3, which encapsulates a connection to a POP3 server and implements the protocol as defined in RFC 1725. The POP3 class supports both the minimal and optional command sets. Additionally, this module provides a class POP3_SSL, which provides support for connecting to POP3 servers that use SSL as an underlying protocol layer.

62 questions
10
votes
3 answers

Get emails with Python and poplib

I would like to log into my account with Python and get python to print the messages I received in my mailbox. I know how to connect import getpass, poplib user = 'my_user_name' Mailbox = poplib.POP3_SSL('pop.googlemail.com', '995')…
user1119429
  • 675
  • 2
  • 7
  • 11
9
votes
2 answers

python poplib get attachment

I am trying to access POP3 email server. I will be polling messages and downloading attachments for each one of them. I can successfully login and get the messages but cannot figure out how to actually get the attachment, which I would need to parse…
t0x13
  • 351
  • 2
  • 10
  • 24
6
votes
3 answers

Python: Retrieving only POP3 message text, no headers

I'm trying to make a Python program that retrieves only the body text of an email without passing headers or any other parameters. I'm not sure how to go about this. The goal is to be able to send basic commands to a program via message text. What I…
mplewis
  • 464
  • 1
  • 8
  • 18
5
votes
2 answers

Python poplib error_proto: line too long

Recently, without changes to codes/libs, I started getting python error_proto: line too long error when reading email (poplib.retr) from hotmail inbox. I am using Python version 2.7.8. I understand that a long line may be caused this error. But…
green
  • 226
  • 2
  • 12
5
votes
2 answers

Trailing equal signs (=) in emails

I download messages from a Gmail account using POP3 and save them in a SQLite database for futher processing: mailbox = poplib.POP3_SSL('pop.gmail.com', '995') mailbox.user(user) mailbox.pass_(password) msgnum = mailbox.stat()[0] for i in…
John Manak
  • 13,328
  • 29
  • 78
  • 119
4
votes
3 answers

How to get emails received from gmail python?

I want to get the last 10 received gmails with python. Currently I have this code but it only returns a limited number of emails and it manipulates pop3 directly, which makes it unnecessary long. Source of the code:…
Alejandro Garcia
  • 140
  • 2
  • 3
  • 15
4
votes
1 answer

POPLIB poplib.error_proto: b'-ERR [AUTH] Username and password not accepted.'

The following code works with another gmail account of mine, but fails with the account im now using, I've already set up POP3 for both accounts! import email, poplib from email.header import decode_header _MAXLINE = 2048 login =…
Andrej Hatzi
  • 312
  • 4
  • 18
3
votes
1 answer

Get message header (subject) with poplib python

I want get only the subject from a message mail using poplib: import poplib server ='pop3.live.com' port = 995 login="xxx@outlook.com" pw="xxx" print "Connecting..." M = poplib.POP3_SSL(server,port) print "Connected to…
Chahroud
  • 31
  • 1
  • 6
2
votes
4 answers

Certificate Authority for imaplib and poplib python

I'm using imaplib and poplib to perform email collection using IMAPS and POP3S for a secure connection. But from what I've been able to determine, neither library uses a CA to confirm the validity of the certificate received. It this true? If it is,…
user788462
  • 1,085
  • 2
  • 15
  • 24
2
votes
0 answers

Reading emails using poplib throws an error - poplib.error_proto: -ERR EOF

I am trying to read emails using the poplib library but getting an error - poplib.error_proto: -ERR EOF. The initial connection seems to be successful and I am able to get the response for the getwelcome() function but after that, the server seems…
Maitray Shah
  • 59
  • 1
  • 2
  • 6
2
votes
3 answers

Select mails from inbox alone via poplib

I need to download emails from the gmail inbox only using poplib.Unfortunately I do not see any option to select Inbox alone, and poplib gives me emails from sent items too. How do I select emails only from inbox? I dont want to use any gmail…
Mohit Ranka
  • 4,193
  • 12
  • 41
  • 41
2
votes
1 answer

Checking folders different than inbox using poplib in Python

Some time ago I ve written a Python script, using poplib library, which retrieves messages from my pop3 email account. Now I would like to use it to retrieve emails from different mail server which works with IMAP. It works well, but only to…
DanoPlu
  • 279
  • 1
  • 16
2
votes
2 answers

Fetch mails via POP3, but keep them on the server

I'd like to fetch mails from a server, but I also want to control when to delete them. Is there a way to do this? I know this setting is very usual in mail clients, but it seems this option is not well supported by POPv3 specification and/or server…
Diego Queiroz
  • 3,198
  • 1
  • 24
  • 36
2
votes
1 answer

Python 3 - How to extract only email body

I have this code to extract email body, but the output show the message and some encrypted information. I need help to get only the message. Last version i've try the lib imaplib, but i don´t have sucess because all message it´s encrypted, so i…
Ricardo91
  • 79
  • 1
  • 2
  • 4
2
votes
1 answer

Getting UnRead Messages using poplib, Python

I'm trying to write some script to check a mail service which uses pop3. As you can see I use poplib module. However, I don't see the correct way to get the unread messages. I found a method which retrieves all the mails so it takes so much time in…
user2957378
  • 627
  • 2
  • 14
  • 29
1
2 3 4 5