libmail:基于 Python 的邮件格式处理工具库

可用于解析和生成符合 RFC 标准格式的电子邮件。提供 Outlook 线程索引解析、MIME 内容编解码、RFC 5322 完整消息解析树及邮件组合工具,附带 CLI 命令行工具,适合需要底层邮件格式处理的开发者。【此简介由AI生成】

Branch1Tags0

@===============@==========================================@

NOTICE !!! | |

*===============+ | | | | Date: Thu, 18 Jul 2024 15:28:20 +0800 | | From: Ethan Meng ethan@yizz.me | | MIME-Version: 1.0 | | Content-Type: text/plain; charset="US-ASCII" | | Content-Transfer-Encoding: 7bit | | Subject: [NOTICE] New docs!!! | | | | Heyo!!! Just to let you all know that documentations | | are (provisionally) available at | | | | https://docs.rapidcow.org/libmail !!!! | | | | .. "provisional" refers to the hosting server, but | | do expect it to be a permanent URI, or at least | | a redirection to something that is not 404 :] | | | | To be honest I am now quite fond of this project, | | having just learned that https://useplaintext.email | | exists. I am glad that my frustration with "modern" | | e-mails isn't alone in that respect. | | | | I might use www.yizx.net to actually put up updates | | like this, but for now..... eh. whatever 😃 | | | | - Ethan ❤️ | | | v==========================================================v

rdks.mail - e-mail utilities

at the moment it contains two modules, some small utilities, one BIG CLI program, and two packages that parse very specific parts of an e-mail!!!

modules:

  • outlook: deals with the (annoying) Thread-Index header.
  • content: deals with MIME content transfer encodings including... - VERY flexible quoted-printable encoding!!! - VERY strict decoder (probably even a bit too strict)!!!
  • headers: deals with RFC 822/2822/5322 message format including: - FULL PARSE TREE REPRESENTATION!!! - very minimal yet strict parser of Message IDs
  • contrib: my reaction to https://github.com/python/cpython/issues/121515 this includes... - convenient drop-in substitutes (at least i tried to 😕) - has patches i personally see fit - MAY BE BUGGY. MAY BE VERY UNFORGIVING. - not tested enough (tho good enough for me!)

utilities:

  • parse-thread-index: CLI for the outlook module. run with: python -m rdks.mail.utils.parse_thread_index or simply parse-thread-index or navigate to the utils/ directory and run ./parse_thread_index.py

  • mail-tree: cheap thing that replicates Mutt's view-attachment output (i'm surprised there isn't an easy cli that does this =.=) depends on humanize https://pypi.org/project/humanize/ (install with pip install humanize~=4.9 or pip install "[tree]" ) optionally wcswidth https://pypi.org/project/wcwidth/ (install with pip install wcswidth or pip install wcswidth)

program!

installation is a bit harder due to compose.py depending on rdks.list, but this should work:

git clone https://git.rapidcow.org/rdks-mail.git
# depending on where your python/pip3 command lives
# you MAY have to change pip into pip3, python -m pip, etc...
pip install -r requirements.txt
pip install -e ./rdks-mail

(of course you could clone rdks-list too and... but i think you already know how to do that)

remote version:

pip install git+https://git.rapidcow.org/rdks-mail.git@main

Introduction

可用于解析和生成符合 RFC 标准格式的电子邮件。提供 Outlook 线程索引解析、MIME 内容编解码、RFC 5322 完整消息解析树及邮件组合工具,附带 CLI 命令行工具,适合需要底层邮件格式处理的开发者。【此简介由AI生成】

Customize your domain