Skip to main content
https://img.shields.io/pypi/v/pyprocmail.svg https://img.shields.io/pypi/l/pyprocmail.svg

Pyprocmail is a python parser and AST definitions for procmail’s procmailrc files.

The grammar of procmailrc files is build after quickref.html.

Installation

Install with pip:

sudo pip install pyprocmail

or from source code:

sudo make install

Basic usages

In [1]: import pyprocmail

In [2]: prc = pyprocmail.parse("examples/procmailrc1")

In [3]: prc
Out[3]:
[<pyprocmail.procmail.Comment at 0x7fdaf8dc1fd0>,
 <pyprocmail.procmail.Comment at 0x7fdaf8dc8850>,
 <pyprocmail.procmail.Comment at 0x7fdaf8d9d790>,
 <pyprocmail.procmail.Comment at 0x7fdaed0bb4d0>,
 <pyprocmail.procmail.Comment at 0x7fdaed0bbf90>,
 <pyprocmail.procmail.Comment at 0x7fdaed0bbd90>,
 <pyprocmail.procmail.Comment at 0x7fdaed0b10d0>,
 <pyprocmail.procmail.Comment at 0x7fdaed0b1bd0>,
 <pyprocmail.procmail.Assignment at 0x7fdaed0c52d0>,
 ...
 <pyprocmail.procmail.Comment at 0x7fdaed0c8ad0>,
 <pyprocmail.procmail.Recipe at 0x7fdaed0c8bd0>,
 <pyprocmail.procmail.Comment at 0x7fdaed0c8c10>,
 <pyprocmail.procmail.Recipe at 0x7fdaed0c8cd0>]

In [4]: prc[8].render()
Out[4]: u'PATH=/bin:/usr/bin:/usr/local/bin:/opt/local/bin/:$HOME/bin:$HOME:'

In [5]: prc[-1].is_recipe()
Out[5]: True

In [6]: prc[-1].action.is_save()
Out[6]: True

In [7]: prc[-1].action.path
Out[7]: u'/dev/null'

In [8]: prc[-1].action.path = "INBOX"

In [9]: print prc[-1].render()

:0
INBOX

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyprocmail-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

File details

Details for the file pyprocmail-0.1.1.tar.gz.

File metadata

  • Download URL: pyprocmail-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyprocmail-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2792447bf9af2d2072fe1132f816d4c64c93cf0730c21cca13f24e4e0be6695f
MD5 ce5392edb4612166925b611c0caaa3ed
BLAKE2b-256 50a69b8ee16f004d589f82d5e19fc1b57d89a14257152b44ace8ac156092ad17

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page