confparser-old
17 years agoUse distutils instead of my own installation script. master
Frédéric Jolliton [Tue, 11 Apr 2006 23:02:04 +0000 (01:02 +0200)]
Use distutils instead of my own installation script.

17 years agoAdded support for list of string or integer. frederic@jolliton.com--2005-private,confparser--main--0.1
Frederic Jolliton [Sun, 23 Oct 2005 21:53:43 +0000 (21:53 +0000)]
Added support for list of string or integer.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-20

18 years agoFixed token best match selection. Added clone method to Parser. Better error reporting.
Frederic Jolliton [Sat, 6 Aug 2005 19:26:30 +0000 (19:26 +0000)]
Fixed token best match selection. Added clone method to Parser. Better error reporting.

* Fixed token selection to really return the longest one.

* Added clone method to Parser class, allowing to save state of the
  parser.

* Better error reporting when using .next() without arguments (when
  any tokens is implictly allowed, and no match is found.)
git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-19

18 years agoCrock-ified documentation.
Frederic Jolliton [Fri, 5 Aug 2005 17:13:19 +0000 (17:13 +0000)]
Crock-ified documentation.

* README converted to a Crock documentation (see Crock project.)

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-18

18 years agoTypo in README. Parser updates.
Frederic Jolliton [Thu, 21 Jul 2005 12:31:39 +0000 (12:31 +0000)]
Typo in README. Parser updates.

Parser in basicparser:

 * Allow list (or tuple) as tokens regex in addition to dictionary.
   This is mainly to ensure that regex are checked in a determinist
   order.

 * Renamed members variable with '__' prefix where appropriate.

Misc:

 * Small typo in README.
git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-17

18 years agoFixed query algorithm. Added '@@@' operator. Added parseExt. Added documentation.
Frederic Jolliton [Thu, 30 Jun 2005 14:41:39 +0000 (14:41 +0000)]
Fixed query algorithm. Added '@@@' operator. Added parseExt. Added documentation.

* Fixed query algorithm, which was returning wrong result for query
  such as '//foo/*'.

* Added a '@@@' operator which return result like '@@' but with node
  name in addition to the values.

* Added parseExt similar to parse but which return a NodeSet object
  hierarchy.

* Added a README file describing some of the feature of the query
  stuff.
git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-16

18 years agoOops. Missing confparser_ext module in install configuration file.
Frederic Jolliton [Thu, 30 Jun 2005 07:44:26 +0000 (07:44 +0000)]
Oops. Missing confparser_ext module in install configuration file.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-15

18 years agoAllowed '-' inside keywords. Added an unit test for confparser module.
Frederic Jolliton [Thu, 30 Jun 2005 07:39:41 +0000 (07:39 +0000)]
Allowed '-' inside keywords. Added an unit test for confparser module.

* Allowed '-' to be part of keywords (to use Lisp-like symbols name)

* Added an unit test for the 'parse' function of confparser module.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-14

18 years agoFixed bug in installModule from the install script.
Frederic Jolliton [Sun, 26 Jun 2005 04:21:43 +0000 (04:21 +0000)]
Fixed bug in installModule from the install script.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-13

18 years agoUpdated install script to store current Arch project version into a log file.
Frederic Jolliton [Sun, 26 Jun 2005 03:44:14 +0000 (03:44 +0000)]
Updated install script to store current Arch project version into a log file.

* The install script now append timestamp and Arch version of the
  project into install.log in installation directory.
git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-12

18 years agoSource code encoding is now utf8. Added experimental XPath style query for configurat...
Frederic Jolliton [Sun, 26 Jun 2005 03:29:12 +0000 (03:29 +0000)]
Source code encoding is now utf8. Added experimental XPath style query for configuration tree.

* Converted all source code to utf8 encoding (instead of iso-8859-1.)

* Added module confparser_ext that include stuff to query (retrieve)
  nodes in a configuration tree from a string describing what to get.
git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-11

18 years agoSuppress verbose output by default. Added keywords to printTree.
Frederic Jolliton [Mon, 14 Mar 2005 14:44:34 +0000 (14:44 +0000)]
Suppress verbose output by default. Added keywords to printTree.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-10

18 years agoIntegers are now handled correctly by printTree.
Frederic Jolliton [Mon, 14 Mar 2005 14:38:23 +0000 (14:38 +0000)]
Integers are now handled correctly by printTree.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-9

18 years agoCache the file only if not yet cached !
Frederic Jolliton [Wed, 9 Mar 2005 14:14:56 +0000 (14:14 +0000)]
Cache the file only if not yet cached !

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-8

18 years agoTypo.
Frederic Jolliton [Wed, 9 Mar 2005 14:06:56 +0000 (14:06 +0000)]
Typo.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-7

18 years agoAdded integer support (in addition to string.)
Frederic Jolliton [Wed, 9 Mar 2005 14:05:44 +0000 (14:05 +0000)]
Added integer support (in addition to string.)

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-6

18 years agoOOPS. Need to use 'validate' instead of old name 'checkConf'.
Frederic Jolliton [Wed, 9 Mar 2005 11:49:37 +0000 (11:49 +0000)]
OOPS. Need to use 'validate' instead of old name 'checkConf'.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-5

18 years agoAdded an install script.
Frederic Jolliton [Wed, 9 Mar 2005 11:23:08 +0000 (11:23 +0000)]
Added an install script.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-4

18 years agoMore cleaning. Added string comments. Removed remaining mailfilter stuff.
Frederic Jolliton [Mon, 7 Mar 2005 09:42:29 +0000 (09:42 +0000)]
More cleaning. Added string comments. Removed remaining mailfilter stuff.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-3

18 years agoCleaning. Added copyright notices.
Frederic Jolliton [Mon, 7 Mar 2005 08:39:34 +0000 (08:39 +0000)]
Cleaning. Added copyright notices.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-2

18 years agoStripping project to just confparser stuff.
Frederic Jolliton [Mon, 7 Mar 2005 08:34:40 +0000 (08:34 +0000)]
Stripping project to just confparser stuff.

git-archimport-id: frederic@jolliton.com--2005-private/confparser--main--0.1--patch-1

18 years agoTypo fixes in README and install.sh frederic@jolliton.com--2005-private,confparser--main--0.1--base-0
Frederic Jolliton [Wed, 5 Jan 2005 20:03:47 +0000 (20:03 +0000)]
Typo fixes in README and install.sh

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.2--patch-7

18 years agoIn broken test, consider header with unknown charset as valid.
Frederic Jolliton [Sun, 21 Nov 2004 12:47:02 +0000 (12:47 +0000)]
In broken test, consider header with unknown charset as valid.

* In isMailBroken, we consider header with unknown charset as valid.
  This is because, Python may don't know some encoding and we don't
  want the script to tag the mail as broken is this case.

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.2--patch-6

18 years agoBetter log message for broken headers.
Frederic Jolliton [Fri, 19 Nov 2004 09:26:57 +0000 (09:26 +0000)]
Better log message for broken headers.

* Output for broken headers changed to log at most
  a predefined quantity of header, and to remove the ''
  around the names.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.2--patch-5

18 years agoBroken test now check if headers are correctly encoded.
Frederic Jolliton [Fri, 19 Nov 2004 09:08:25 +0000 (09:08 +0000)]
Broken test now check if headers are correctly encoded.

* 'broken' test, in addition to testing that the mail was
  correctly parsed by email python module, now also test
  that every header can be decoded correctly (that mean
  that for example, a subject header with 8 bits contents
  will be marked as broken.)
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.2--patch-4

18 years agoFix exception in virus scan.
Frederic Jolliton [Thu, 18 Nov 2004 05:19:28 +0000 (05:19 +0000)]
Fix exception in virus scan.

* IMPORTANT: We catch exception derived from Exception, but antivirusScan was
  throwing a string exception. That caused global try/catch to miss that, and
  let sendmail believe than the mail was correctly delivered.

* confparser.readConfiguration now return None if rule file doesn't exist.

* Removed log for absence of rule (either because the user file doesn't exist,
  or because no rule are defined inside it.)
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.2--patch-3

18 years agoAdded support to test if a particular header is present or not.
Frederic Jolliton [Wed, 17 Nov 2004 14:19:55 +0000 (14:19 +0000)]
Added support to test if a particular header is present or not.

* The 'present' match was added to test if a header is present
  in mail or not.

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.2--patch-2

18 years agoFixed parser for one letter keyword.
Frederic Jolliton [Wed, 17 Nov 2004 14:16:44 +0000 (14:16 +0000)]
Fixed parser for one letter keyword.

* Fixed regex in confparser.py. Otherwise, keyword
  with only one letter were not recognized.

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.2--patch-1

18 years agoSealing. frederic@jolliton.com--2004-private,mail-filter--main--0.1.2--base-0
Frederic Jolliton [Sun, 14 Nov 2004 20:55:41 +0000 (20:55 +0000)]
Sealing.

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.1--version-0

18 years agoUpdated the CREATING-RULES file.
Frederic Jolliton [Thu, 11 Nov 2004 16:42:33 +0000 (16:42 +0000)]
Updated the CREATING-RULES file.

* Added a short explanation about partial match in headers.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.1--patch-6

18 years agoFixed bug in message about custom error code.
Frederic Jolliton [Thu, 11 Nov 2004 15:01:53 +0000 (15:01 +0000)]
Fixed bug in message about custom error code.

* Fixed the bug when generating the log for the case were we
  return a custom error code.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.1--patch-5

18 years agoAdded '.user' partial match.
Frederic Jolliton [Thu, 11 Nov 2004 14:46:59 +0000 (14:46 +0000)]
Added '.user' partial match.

* Added '.user' partial match, to match against
  the part before the @ in email address.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.1--patch-4

18 years ago'all' match added. Better header parsing. Behavior of test mode change.
Frederic Jolliton [Thu, 11 Nov 2004 14:33:01 +0000 (14:33 +0000)]
'all' match added. Better header parsing. Behavior of test mode change.

* Added 'all' match. It's always matching any mail.
  It allow catchall rule.
* Better header parsing. Headers were not normalized for blank
  when using a partial match (.domain/.address/.name). Part
  name '.raw' added ('from.raw' is equivalent to 'from'.)
* Test mode behavior changed. Now, it list summary of matching
  rules.
* Fixed a bug on the output when checking a configuration (with -c).
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.1--patch-3

18 years agoAdded --version option. Added install.sh.
Frederic Jolliton [Thu, 11 Nov 2004 12:26:54 +0000 (12:26 +0000)]
Added --version option. Added install.sh.

* Added --version option.
* Added install.sh to install mail.filter.
* Makefile now just call install.sh for rule 'install'
  (and copying mailfilter.py was missing from the previous Makefile.)
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.1--patch-2

18 years agoEnhanced matches for headers. Better header parsing.
Frederic Jolliton [Thu, 11 Nov 2004 11:33:20 +0000 (11:33 +0000)]
Enhanced matches for headers. Better header parsing.

* Enhanced matches for headers by adding the following
  support for the suffixes .name, .address and .domain
  to header name (e.g 'From.domain' to match domain part.)
* Better header parsing, by using email.Header.decode_header
  and building a unicode string from the value returned.
  (i.e to support for example '=?iso-8859-1?q?...'.)
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1.1--patch-1

18 years agoSealing. frederic@jolliton.com--2004-private,mail-filter--main--0.1.1--base-0
Frederic Jolliton [Mon, 1 Nov 2004 02:29:07 +0000 (02:29 +0000)]
Sealing.

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--version-0

18 years agoImportant bug preventing the use of rules.
Frederic Jolliton [Mon, 1 Nov 2004 01:45:59 +0000 (01:45 +0000)]
Important bug preventing the use of rules.

* 'return conf' was missing from readConfiguration !
* Path to Cyrus deliver binary changed to reflect
  the location on this command on Gentoo system with
  Cyrus 2.2.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-8

18 years agoAdded --disable-backup option.
Frederic Jolliton [Mon, 1 Nov 2004 01:19:06 +0000 (01:19 +0000)]
Added --disable-backup option.

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-7

18 years agoBugfix related to exception in process()
Frederic Jolliton [Mon, 1 Nov 2004 00:56:43 +0000 (00:56 +0000)]
Bugfix related to exception in process()

* The try/except was catching SystemExit exception, which what
  wrong.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-6

18 years agoAdded a Makefile with clean/install
Frederic Jolliton [Sun, 31 Oct 2004 04:38:57 +0000 (04:38 +0000)]
Added a Makefile with clean/install

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-5

18 years agoAdded a README and CREATING-RULES file
Frederic Jolliton [Sun, 31 Oct 2004 04:26:47 +0000 (04:26 +0000)]
Added a README and CREATING-RULES file

* Added a README file with installation instruction
* Added a CREATING-RULES file with instruction to
  create rules configuration file.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-4

18 years agoChanges related to logs and error handling.
Frederic Jolliton [Sat, 30 Oct 2004 22:53:29 +0000 (22:53 +0000)]
Changes related to logs and error handling.

git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-3

18 years agoMajor changes for reading/parsing/validating configuration files.
Frederic Jolliton [Sat, 30 Oct 2004 22:25:21 +0000 (22:25 +0000)]
Major changes for reading/parsing/validating configuration files.

* Split validator into 2 parts:
  - basicvalidator, for the core part,
  - confparser, mail.filter specific part.
* Split parser into 2 parts:
  - basicparser, for the core part,
  - confparser, mail.filter specific part.
* confparser now cache parser result for faster processing.
* And some minor changes and bugfixes.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-2

18 years agoLot of untested changes.
Frederic Jolliton [Fri, 29 Oct 2004 21:39:33 +0000 (21:39 +0000)]
Lot of untested changes.

* Many changes.
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--patch-1

18 years agoInitital import of mail-filter frederic@jolliton.com--2004-private,mail-filter--main--0.1--base-0
Frederic Jolliton [Thu, 28 Oct 2004 06:55:48 +0000 (06:55 +0000)]
Initital import of mail-filter

This is the inital import of mail-filter project. At this
point the filter should not be used in production !
git-archimport-id: frederic@jolliton.com--2004-private/mail-filter--main--0.1--base-0