#!/usr/bin/env python
from setuptools import setup
setup(
  name = 'cs.app.mailfiler',
  description = 'email message filing system which monitors multiple inbound Maildir folders',
  author = 'Cameron Simpson',
  author_email = 'cs@cskk.id.au',
  version = '20190512',
  url = 'https://bitbucket.org/cameron_simpson/css/commits/all',
  classifiers = ['Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Communications :: Email :: Filters', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)'],
  entry_points = {'console_scripts': ['mailfiler = cs.app.mailfiler:main']},
  include_package_data = True,
  install_requires = ['cs.app.maildb', 'cs.configutils', 'cs.deco', 'cs.env', 'cs.excutils', 'cs.filestate', 'cs.fileutils', 'cs.lex', 'cs.logutils', 'cs.mailutils', 'cs.obj', 'cs.pfx', 'cs.py.func', 'cs.py.modules', 'cs.py3', 'cs.rfc2047', 'cs.seq', 'cs.threads'],
  keywords = ['python2', 'python3'],
  license = 'GNU General Public License v3 (GPLv3)',
  long_description = 'Mailfiler is my email message filing system.\n\nIt monitors multiple Maildir folders for new messages\nand files them according to various easy to write rules.\nIts use is described fully in the mailfiler(1cs) manual entry.\n\nThe rules files are broadly quite simple and described fully\nin the mailfiler(5cs) manual entry.\nThe rules are normally single line rules of the form:\n\n    target,... label condition\n\nIf the rule should always fire\nthen the condition may be omitted.\n\nThe targets may be\nmail folders (file the message in the named folder),\nassignment statements (set an environment variable),\nemail addresses (send the message to the specified address)\nor some other special purpose actions.\n\nThe conditions are usually tests of the header email addresses\nincluding whether an address is a member of some group/alias\nbut may also test various other things about the message headers.\n\n## Class `Condition_AddressMatch`\n\nMRO: `_Condition`, `cs.obj.O`  \nA condition testing for the presence of an address.\n\n## Class `Condition_HeaderFunction`\n\nMRO: `_Condition`, `cs.obj.O`  \nA condition testing the contents of a header.\n\n## Class `Condition_InGroups`\n\nMRO: `_Condition`, `cs.obj.O`  \nA condition testing messages addresses against address groups.\n\n## Class `Condition_Regexp`\n\nMRO: `_Condition`, `cs.obj.O`  \nA condition testing headers against a regular expression.\n\n## Function `current_value(envvar, cfg, cfg_key, default, environ)`\n\nCompute a configurable path value on the fly.\n\n## Function `FilterReport(rule, matched, saved_to, ok_actions, failed_actions)`\n\nCreate a FilterReport object.\n\nParameters:\n* `rule`: the `Rule` on which to report\n* `matched`: whether the rule was matched\n* `saved_to`: where messages were filed\n* `ok_actions`: actions which succeeded\n* `failed_actions`: actions which failed\n\n## Function `get_target(s, offset, quoted=False)`\n\nParse a single target specification from a string; return Target and new offset.\n\nParameters:\n* `s`: the string to parse\n* `offset`: the starting offset of the parse\n* `quoted`: if true then the parser is already inside quotes:\n  do not expect comma or whitespace to end the target specification.\n  Default: `False`\n\n## Function `get_targets(s, offset)`\n\nParse list of targets from the string `s` starting at `offset`.\nReturn the list of Targets strings and the new offset.\n\n## Function `maildir_from_name(mdirname, maildir_root, maildir_cache)`\n\nReturn the Maildir derived from mdirpath.\n\n## Class `MailFiler`\n\nMRO: `cs.obj.O`  \nA mail filer.\n\n## Function `main(argv=None, stdin=None)`\n\nMailfiler main programme.\n\n## Class `MessageFiler`\n\nMRO: `cs.obj.O`  \nA message filing object, filtering state information used during rule evaluation.\n\nAttributes:\n* `.maildb`: Current MailDB.\n* `.environ`: Storage for variable settings.\n* `.addresses(header)`: Caching list of addresses from specified header.\n\n## Function `parserules(fp)`\n\nRead rules from `fp`, yield Rules.\n\n## Function `resolve_mail_path(mdirpath, maildir_root)`\n\nReturn the full path to the requested mail folder.\n\n## Class `Rule`\n\nMRO: `cs.obj.O`  \nA filing rule.\n\n## Class `Rules`\n\nMRO: `builtins.list`  \nSimple subclass of list storing rules, with methods to load\nrules and filter a message using the rules.\n\n## Function `save_to_folderpath(folderpath, M, message_path, flags)`\n\nSave the Message `M` to the resolved `folderpath`.\n\nParameters:\n* `folderpath`: the path to the target mail folder.\n* `M`: the message to save.\n* `message_path`: pathname of existing message file, allowing\n  hardlinking to new maildir if not `None`.\n* `flags`: save flags as from MessageFiler.flags\n\n## Function `scrub_header(value)`\n\n"Scrub" a header value.\nPresently this means to undo RFC2047 encoding where possible.\n\n## Class `Target_Assign`\n\nMRO: `cs.obj.O`  \nA filing target to set a filing state environment variable.\n\n## Class `Target_EnvSub`\n\nMRO: `cs.obj.O`  \nA filing target to delivery to a string\nwhich is subject to environment subject to environment variable expansion\nwhere the environment variables are derived from the filing state.\n\n## Class `Target_Function`\n\nMRO: `cs.obj.O`  \nA filing target to run a Python function against a message.\n\n## Class `Target_MailAddress`\n\nMRO: `cs.obj.O`  \nA filing target for an email address.\n\n## Class `Target_MailFolder`\n\nMRO: `cs.obj.O`  \nA filing target for a mail folder.\n\n## Class `Target_PipeLine`\n\nMRO: `cs.obj.O`  \nA filing target to pipe the message contents to a shell command.\n\n## Class `Target_SetFlag`\n\nMRO: `cs.obj.O`  \nA filing target to apply a flag to a message.\n\n## Class `Target_Substitution`\n\nMRO: `cs.obj.O`  \nA filing target to apply a regular expression string substitution\nto message headers.\n\n## Class `WatchedMaildir`\n\nMRO: `cs.obj.O`  \nA class to monitor a Maildir and filter messages.',
  long_description_content_type = 'text/markdown',
  package_dir = {'': 'lib/python'},
  py_modules = ['cs.app.mailfiler'],
)
