Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Ahead warp factor one, Mr. Sulu.


devel / comp.lang.python / Re: imaplib: is this really so unwieldy?

SubjectAuthor
o Re: imaplib: is this really so unwieldy?hw

1
Re: imaplib: is this really so unwieldy?

<mailman.419.1622354602.3087.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13433&group=comp.lang.python#13433

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hw...@adminart.net (hw)
Newsgroups: comp.lang.python
Subject: Re: imaplib: is this really so unwieldy?
Date: Sun, 30 May 2021 08:03:14 +0200
Lines: 48
Message-ID: <mailman.419.1622354602.3087.python-list@python.org>
References: <d8904fa5-3f71-1f21-9d16-6f1105b81551@adminart.net>
<YLApha4SV8v0bMVq@cskk.homeip.net>
<CANDiX9KsaBE8eyAHwXr1UkSotW2pRRyMBndYMMWmoFcEubSOYw@mail.gmail.com>
<9885d982-958c-de62-f82c-552242b6b069@adminart.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de bcqNrfICfYpQCErE5y0AJAh4UND4RAs0mB5p5nvMXS5w==
Return-Path: <hw@adminart.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=adminart.net header.i=@adminart.net header.b=tv3+itiy;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.020
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'string': 0.05;
'hopefully': 0.07; '27,': 0.09; 'apparently': 0.09; 'convert':
0.09; 'happens.': 0.09; 'modules.': 0.09; 'terminal': 0.09;
'values.': 0.09; 'window.': 0.09; 'steps': 0.10; '18:42,': 0.16;
'appendix': 0.16; 'bob': 0.16; 'cameron': 0.16; 'contrary': 0.16;
'instead.': 0.16; 'league': 0.16; 'module,': 0.16; 'parsing':
0.16; 'python".': 0.16; 'received:(client did not present a
certificate)': 0.16; 'simpson': 0.16; 'states:': 0.16; 'stepp':
0.16; 'third-party': 0.16; 'wrote:': 0.16; 'python': 0.16; 'thu,':
0.20; 'python,': 0.21; "i've": 0.22; 'install': 0.22;
'communicate': 0.23; 'to:addr:python-list': 0.23; 'received:de':
0.24; '>>>': 0.26; 'section': 0.26; 'seems': 0.26; 'tried': 0.26;
'module': 0.28; 'header:User-Agent:1': 0.31; 'there': 0.31;
'stuff': 0.31; 'but': 0.31; 'am,': 0.31; 'definitely': 0.31;
'fact': 0.31; "doesn't": 0.32; 'downloads': 0.32; 'here,': 0.32;
'retrieve': 0.32; 'using': 0.33; 'server': 0.33; 'header:In-Reply-
To:1': 0.33; 'book': 0.35; 'url-ip:104.17/16': 0.35; 'two': 0.37;
'author': 0.38; 'hard': 0.38; 'read': 0.38; 'use': 0.38; 'does':
0.38; 'example': 0.40; 'messages': 0.40; 'simple': 0.40; 'comes':
0.40; 'sending': 0.40; 'mentioned': 0.40; 'complete': 0.61;
'online': 0.62; 'email': 0.62; 'subject:this': 0.63; 'your': 0.64;
'url:net': 0.66; 'full': 0.68; 'collect': 0.69; 'url-ip:213/8':
0.69; 'virtually': 0.69; 'shows': 0.70; 'you.': 0.70; 'chapter':
0.71; 'url-ip:208/8': 0.71; 'edition': 0.72; 'tool': 0.72;
'little': 0.75; 'tools': 0.75; 'more.': 0.81; '2021': 0.84;
'locally,': 0.84; 'messages,': 0.84; 'subject:really': 0.84; 'url-
ip:213.186.33/24': 0.84; 'url-ip:213.186/16': 0.84; 'discusses':
0.91; 'edition.': 0.91; 'pop': 0.91
ARC-Seal: i=1; a=rsa-sha256; t=1622354594; cv=none;
d=strato.com; s=strato-dkim-0002;
b=gY7+pxLAgZdxIkUPZI60opsmOgFCfxQql9gpRFunC481/WD1l0AroEhaYi7PABrYjJ
aFGIPPrOo1mgaHF69szwKz6MzSbh59sjMY0bUzCENsjm8xckmGNvXQhz3oW6Mqug4Kp/
8cwlKyCW+N5iZ8akgpeo78hpuAmS58Hh+YKp00nMmMjcZfrRJlGb5CjcYbChuRxlT+fX
SZN2fuO8QUowdFvA0ndOlxA15JXcpD+gQSY9tW4iOJvio2D8Oah9N9TNr7Jzw8SKMix7
ylJEfsYY1x8IqpLCoABx6IR9Xs/lPF58R4K6MkJL/3yBra8Hitnqzlc63D1IhepVK5fh
D5uQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1622354594;
s=strato-dkim-0002; d=strato.com;
h=In-Reply-To:Date:Message-ID:From:References:To:Subject:Cc:Date:From:
Subject:Sender;
bh=jo+g601kOBaeuwTBg/YOI9KOw4jGfXxLqEZz7l1tQZU=;
b=DL9unRT0XHq0OGQcL8l6w6qAGMsb5MGxtIKHnrRrO6wjggvxT5bJ6E18zhs6dj6yub
zUXRogk7C2CvS/oRqJtYEm4FbAjN+D3ZaqrXXmIV3p+HHJ0cMHmff50T5aIJSCpe07DC
2aQNIbsv9rNrX+Sv4R/LxXCrJOR4X5RYhXnnc3eOdfdhv2S3lZIL8FloO8iPC4DWz5rk
oW3ywd9r6UuG9mW1Y6AVetJzAsdf5QVe6OdM70UhA6JHUUOg247+0mP7f37keI5phbS0
fkBzdkGHDo2P1dm0iUruda4heCzMmA8uLccmOj7rPD84/BxaQj35I+BHwa5Dr4HoISVb
7OFA==
ARC-Authentication-Results: i=1; strato.com;
dkim=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1622354594;
s=strato-dkim-0002; d=adminart.net;
h=In-Reply-To:Date:Message-ID:From:References:To:Subject:Cc:Date:From:
Subject:Sender;
bh=jo+g601kOBaeuwTBg/YOI9KOw4jGfXxLqEZz7l1tQZU=;
b=tv3+itiynG0MUQCBwBwGruTNCh/V3nYrm6zNdbC/kq8j3q09e5G6R1GJEXSP1xLVsW
imMhBWumIba2zdz3PYkphM2/B9W+ipRZ54F8sU+bJvGB4lMExKMNTdqj8Kb52QLGvRp8
eR+Yk8JphFtJk89PwOrye7Y/S3PxyRcxSBlCDcy+98kZcJb4zNaaf72iKxA0ZHm/DuO+
SK0Gsxb7MRhdARc4hBrhdLfW5sDgXG6uWI8Tfa9fqlO88zijJAKGj0EDBKSFJyb0Tpk5
rRGqKG6g68T6zJ0Y2eK6Q6lh/AtaaO5q4UGoGPPbbq81lz2k42LHdpMus9GvPEQ8h+yI
DC9Q==
Authentication-Results: strato.com;
dkim=none
X-RZG-AUTH: ":O2kGeEG7b/pS1Ey9Rna9iAZFrfz26y6zbtmqiE/f0+LThi5xYO8s9RmVPkxvrwQpRPenk8HVxDf4aQ=="
X-RZG-CLASS-ID: mo00
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
In-Reply-To: <CANDiX9KsaBE8eyAHwXr1UkSotW2pRRyMBndYMMWmoFcEubSOYw@mail.gmail.com>
Content-Language: de-DE
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <9885d982-958c-de62-f82c-552242b6b069@adminart.net>
X-Mailman-Original-References: <d8904fa5-3f71-1f21-9d16-6f1105b81551@adminart.net>
<YLApha4SV8v0bMVq@cskk.homeip.net>
<CANDiX9KsaBE8eyAHwXr1UkSotW2pRRyMBndYMMWmoFcEubSOYw@mail.gmail.com>
 by: hw - Sun, 30 May 2021 06:03 UTC

On 5/28/21 2:36 AM, boB Stepp wrote:
> On Thu, May 27, 2021 at 6:22 PM Cameron Simpson <cs@cskk.id.au> wrote:
>>
>> On 27May2021 18:42, hw <hw@adminart.net> wrote:
>
>>> So it seems that IMAP support through python is virtually non-existent.
>>
>> This still sureprises me, but I've not tried to use IMAP seriously. I
>> read email locally, and collect it with POP instead. With a tool I wrote
>> myself in Python, as it happens.
>
> I am out of my league here, but what I found in one of my books might
> be helpful. Al Sweigart wrote a useful book, "Automate the Boring
> Stuff in Python". In chapter 16 he considers email. In the "IMAP"
> section he states:
>
> <quote>
> Just as SMTP is the protocol for sending email, the Internet Message
> Access Protocol (IMAP) specifies how to communicate with an email
> provider’s server to retrieve emails sent to your email address.
> Python comes with an imaplib module, but in fact the third-party
> imapclient module is easier to use. This chapter provides an
> introduction to using IMAPClient; the full documentation is at
> http://imapclient.readthedocs.org/.
>
> The imapclient module downloads emails from an IMAP server in a rather
> complicated format. Most likely, you’ll want to convert them from this
> format into simple string values. The pyzmail module does the hard job
> of parsing these email messages for you. You can find the complete
> documentation for PyzMail at http://www.magiksys.net/pyzmail/.
>
> Install imapclient and pyzmail from a Terminal window. Appendix A has
> steps on how to install third-party modules.
> </quote>
>
> In the next little section he shows how to retrieve and delete emails
> with IMAP using the two third-party tools mentioned above. And of
> course there is more. Apparently this book is now in its second
> edition. The first edition is available online for free. The link to
> chapter 16 which discusses email is:
> https://automatetheboringstuff.com/chapter16/ Hopefully this will
> prove helpful to the OP.

Thanks for the pointer!

I don't know which imaplib the author uses; the imaplib I found
definitely doesn't give uids of the messages, contrary to the example
he's giving.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor