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

Python, parsing links from poplib email message

I'm struggling to extract links from email messages downloaded from my pop3 server I'm trying to parse the body of an email message which matches a passed in subject line. I'm using poplib module to get the emails from the server with the code…
1
vote
2 answers

How to maintain mail conversion (reply / forward / reply to all like gmail) of email using Python pop/imap lib?

I've develop webmail client for any mail server. I want to implement message conversion for it — for example same emails fwd/reply/reply2all should be shown together like gmail does... My question is: what's the key to find those emails which are…
Avadhesh
  • 4,519
  • 5
  • 33
  • 44
1
vote
0 answers

Fwding emails in python while leaving the original sender

I'm trying to write a fairly simple script that logs into an email account, looks at each email, does something only for ones with a certain subject, and fwds the rest to another email address. When doing so, I'd like the sender to remain as the…
Syed H
  • 305
  • 1
  • 2
  • 9
1
vote
1 answer

Python Poplib Error

This is the code import poplib from email import parser pop_conn = poplib.POP3_SSL('pop.gmail.com') pop_conn.user('user@gmail.com') pop_conn.pass_('password') messages = [pop_conn.retr(i) for i in range(1, len(pop_conn.list()[1]) + 1)] messages =…
1
vote
1 answer

Poplib Microsoft Exchange logon error

I have the following code connecting to a Microsoft exchange server (2010 version). This is the snipped I'm having trouble with. (it works with other email servers/local mail server made for test). The user/password are validated and are, for this…
miguels
  • 606
  • 1
  • 7
  • 30
1
vote
3 answers

Incoming poplib refactoring using windows python 2.3

Hi Guys could you please help me refactor this so that it is sensibly pythonic. import sys import poplib import string import StringIO, rfc822 import datetime import logging def _dump_pop_emails(self): self.logger.info("open pop account %s with…
Setori
  • 10,326
  • 11
  • 40
  • 46
1
vote
1 answer

Printing passed bytes from Exception

This seems to be the code for the poplib.error_proto. class error_proto(Exception): pass It just passes the bytes from the POP response in the exception. What I would like to do is catch any exception, take those bytes, use .decode('ascii') on…
Sean
  • 265
  • 2
  • 10
1
vote
0 answers

Is it possible using python poplib to obtain specific messages only from the inbox and only delete those retrieved?

I couldn't find my exact question so here goes: I am using the poplib module and can successfully retrieve emails from my inbox and delete those read. However, I would like to only retrieve those emails with a specific subject line (so I can filter…
TWhite
  • 737
  • 2
  • 11
  • 33
1
vote
1 answer

Python poplib error when trying to parse in a string

I am using poplib to get email from the POP3 server. But this error occurred: *cmd* 'USER xxx@gmail.com' *put* b'USER xxx@gmail.com' *get* b'+OK send PASS\r\n' *resp* b'+OK send PASS' *cmd* 'PASS asdasd\n' *put* b'PASS asdasd\n' *get* b'-ERR bad…
1
vote
1 answer

poplib and email module will not reloop through a message if it has alread read it

I'm currently trying to write a script that gets messages from my gmail account but I'm noticing a problem. If poplib loops through a message in my inbox it will never loop through it again. Here is my code import poplib, string, email user =…
1
vote
3 answers

Does a pop3 connection timeout?

I am using python poplib. Does a POP3 connection timeout after a period of inactivity? Is there a way to set this timeout? Would such a timeout cause emails flagged for deletion to be deleted as if quit() had been called? The only timeout I see…
Intra
  • 2,089
  • 3
  • 19
  • 23
0
votes
1 answer

Python 2.7 POP3_SSL Error connecting to Outlook Mailbox?

Some background: I am working on learning how to convert an app that uses a POP3 connection to use OAuth since Microsoft is dropping support for basic authentication in October. Initially I was using just POP3, but swapped to POP3_SSL after not…
AWKO_LP
  • 1
  • 3
0
votes
0 answers

Poplib issue with LIST/STAT (-ERR Command not understood)

The GMAIL POP3 server does not understand the LIST/STAT command when being sent via poplib. Sending those commands on the same exact mailbox via TELNET works. Initially, I thought this is a GMAIL issue, but after doing the manual TELNET login and…
nexus6
  • 1
0
votes
1 answer

How to use Python smtplib to monitor if there is new email received in the mailbox

I am using smtplib to automate the receiving of emails. Below is what I have achieved so far import smtplib,ssl from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email.mime.text import MIMEText from email.utils…
Jack
  • 1,339
  • 1
  • 12
  • 31
0
votes
0 answers

Connection to the exchange server fails with some invalid error while fetching the password

I have got the POP server and the IMAP server details for my exchange server. And i am able to connect to both using poplib.POP3_SSL(host,port) or imaplib.IMAP4_SSL(host,port). After that in case of imaplib when i use login method it throws an…
Tusharg
  • 1
  • 1