Bug 6943 - Introducing CONF_TYPE_DURATION data type
Summary: Introducing CONF_TYPE_DURATION data type
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P2 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
Depends on:
Reported: 2013-06-03 16:28 UTC by Mark Martinec
Modified: 2013-06-03 16:31 UTC (History)
0 users

Attachment Type Modified Status Actions Submitter/CLA Status
implements data type CONF_TYPE_DURATION patch None Mark Martinec [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Martinec 2013-06-03 16:28:04 UTC
Seems awkward having to say in a config file:

  bayes_token_ttl  3024000

when one means 5 weeks. Adding optional time units to
configured time duration intervals seems more user-friendly:

  bayes_token_ttl  5w

The attached change introduces a data type $CONF_TYPE_DURATION,
which is similar to $CONF_TYPE_NUMERIC, but allows optionally
suffixing a numeric value by time units/multipliers: s, m, h, d, w,
and disallows negative values. A default time unit is a second.
Comment 1 Mark Martinec 2013-06-03 16:29:26 UTC
Created attachment 5147 [details]
implements data type CONF_TYPE_DURATION
Comment 2 Mark Martinec 2013-06-03 16:31:39 UTC
Bug 6943: Introducing CONF_TYPE_DURATION data type
  Sending lib/Mail/SpamAssassin/Conf/Parser.pm
  Sending lib/Mail/SpamAssassin/Conf.pm
  Sending lib/Mail/SpamAssassin/Plugin/AWL.pm
  Sending lib/Mail/SpamAssassin/Plugin/DCC.pm
  Sending lib/Mail/SpamAssassin/Plugin/DKIM.pm
  Sending lib/Mail/SpamAssassin/Plugin/Pyzor.pm
  Sending lib/Mail/SpamAssassin/Plugin/Razor2.pm
  Sending lib/Mail/SpamAssassin/Plugin/SPF.pm
  Sending t/cross_user_config_leak.t
Committed revision 1489055.