473,626 Members | 3,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

poplib.POP3.lis t() returns extra value?

For the poplib.POP3 object, docs say:

list([which])
Request message list, result is in the form (response, ['mesg_num octets',
...]). If which is set, it is the message to list.
But (I've folded the long line):

Python 2.3.5 (#2, May 4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
import poplib
p = poplib.POP3("an nie")
p.user("poptest ") '+OK' p.pass_("poptes t") '+OK' p.list() ('+OK', ['1 2680', '2 2720', '3 9996', '4 23368', '5 2267', '6 2661', '7
4925', '8 2548', '9 10114', '10 1850', '11 14239', '12 6678', '13 6592',
'14 10011', '15 3554', '16 5764', '17 5080', '18 9998', '19 2056', '20
6354', '21 3031', '22 2868', '23 6325', '24 2566', '25 4827', '26 2995',
'27 2963', '28 2548', '29 9138', '30 2408', '31 2245', '32 2547', '33
2439', '34 9816', '35 2584', '36 10259', '37 1997', '38 4930', '39
1859', '40 9105', '41 6649', '42 6776', '43 2338', '44 17808', '45
4960', '46 1785', '47 2123', '48 2011', '49 9124', '50 1910', '51 1307',
'52 18869', '53 2507', '54 19099', '55 2328', '56 2069', '57 1654', '58
2346', '59 2891', '60 1865', '61 9334'], 548)


Note the trailing ", 548". By symmetry with the POP3.retr() function,
I'll guess that it's the number of octets in the response; it gets
bigger with more messages. I've tried this against three different
servers (popa3d, some version of Exchange, whatever's on RedHat 7.2),
and two versions of python (2.3.5 on Debian sarge, 2.2 on AIX 5.1) and
it's the same on all of them.

It could be that I'm insane, but I'd prefer to believe this is a doc
error that no one ever noticed because everybody uses POP3.list()[1].
You be the judge!

Steve

--
Steve Greenland
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the
world. -- seen on the net
Jul 28 '05 #1
2 2687
With a judicious bit of UTSL, that count seems to be the total number of
octets in the reply. This information comes from any user of
_getlongresp(), which actually returns a tuple (resp, list, octets).
These methods would be:
list
retr
top
uidl

I'd consider it a doc bug too. If you feel comfortable doing it, dive
in and improve the documentation of poplib. Submitting a patch to the
patch tracker on sf.net/projects/python is probably the best way to do
this, if you have the necessary knowledge of cvs to produce a patch.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFC6WZrJd0 1MZaTXX0RAjaTAJ 4wSSuByr3osTMRa lD8Pl+YVcQDdQCf RSdf
LQ3n7kB6yZS2urI siL0pw1A=
=s+8Y
-----END PGP SIGNATURE-----

Jul 28 '05 #2
According to Jeff Epler <je****@unpytho nic.net>:
I'd consider it a doc bug too. If you feel comfortable doing it, dive
in and improve the documentation of poplib. Submitting a patch to the
patch tracker on sf.net/projects/python is probably the best way to do
this, if you have the necessary knowledge of cvs to produce a patch.


Knowledge: yes; Time: maybe. If someone else gets there first, I won't
be offended :-)

Thanks for confirming...

Steve

--
Steve Greenland
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the
world. -- seen on the net
Jul 29 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1974
by: WebRod | last post by:
Hi everybody, I just would like to download the new mails I received on my POP3 server (and keep a copy on the server) I use PHP 4.3 and IMAP functions (they are compatible with both POP3 and IMAP servers). When I use OUTLOOK, no problem, in less than 5 seconds, it answers me: " you have XX new messages"
7
2985
by: Simon Burton | last post by:
This was so easy :) Simon Burton. #!/usr/bin/env python import sys from time import sleep from poplib import *
1
3018
by: Rybread | last post by:
Real quick, I have account X and I want a python script that goes in and looks for emails sent from Y and then to save them. i'm trying to go off the swen killer I have listed below (which i took from someone on this NG): import poplib import time print 'Start at', time.asctime()
2
6709
by: brettk | last post by:
Hello All, Here's what I'm trying to do: I need to connect to a pop3 server, download all messages, and copy all of the attachments into a specific directory. The actual email message is unimportant. Now, I've found plenty of examples that strip the attachments from an email message, but most (if not all) of them take a file parameter. My question is this:
1
1606
by: Alessandro Bottoni | last post by:
Is there any module or interface that allow the programmer to access a imap4/pop3 server in a more pythonic (or Object Oriented) way than the usual imaplib and popolib? I mean: is there any module that would allow me to query the server for specific messages (and fetch them) in a way similar to a OODB? TIA -----------------------------------
3
6087
by: EuGeNe Van den Bulke | last post by:
Hi there, I am trying to use the poplib library to get emails using the retr method. The small program bellow works but the message aren't flagged as read which puzzles me. I believe the pop server is qmail 1.0.6 / vpopmail 5.2.1 and I am running the following script on Windows using Pyhton 2.5. import poplib import email
4
4756
by: Jean-Claude Neveu | last post by:
Hello, I am writing a Python program to check email using POP3. I've tried the sample code from python.org, and it works great. In other words, the code below successfully prints out my emails. import getpass, poplib, email M = poplib.POP3('mail.blah.com') M.user('username') M.pass_('password')
2
2642
by: Roopesh | last post by:
Hi, I am using poplib's retr() to fetch mails from my gmail account. It works fine, in some cases it gets stuck inside the retr() method and does not come out. From the logs I could find that when retr() is called, it stops executing further statements, nor does it throw an exceptions but simply stops. My code is roughly like the foll:
2
3020
by: SteveC | last post by:
Hello, I am trying to use POP3_SSL class of the poplib module to read email from my gmail account. I can connect just fine using the example here http://www.python.org/doc/lib/pop3-example.html import getpass, poplib M = poplib.POP3('localhost') M.user(getpass.getuser())
0
8711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7203
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5576
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2630
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1515
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.