Commits

Cameron Simpson committed 22d9ded Merge

Automated merge with file:///Users/cameron/hg/css

Comments (0)

Files changed (3)

lib/python/cs/app/mailfiler.py

   argv = list(argv)
   cmd = os.path.basename(argv.pop(0))
   setup_logging(cmd)
-  usage = 'Usage: %s monitor [-1] [-d delay] [-n] [-N] [-R rules] maildirs...' % (cmd,)
+  usage = ( '''Usage: %s monitor [-1] [-d delay] [-n] [-N] [-R rules_pattern] maildirs...
+  -1  File at most 1 message per Maildir.
+  -d delay
+      Delay between runs in seconds.
+      Default is to make only one run over the Maildirs.
+  -n  No remove. Keep filed messages in the origin Maildir.
+  -R rules_pattern
+      Specify the rules file pattern used to specify rules files from Maildir names.
+      Default: %s'''
+            % (cmd, DEFAULT_MAILDIR_RULES)
+          )
   badopts = False
 
   if not argv:

man/mailfiler.1.pod

+
+=head1 NAME
+
+mailfiler - a Maildir monitor for filing email messages
+
+=head1 SYNOPSIS
+
+mailfiler monitor [-1] [-d delay] [-n] [-N] [-R rules_pattern] maildirs...
+
+=head1 DESCRIPTION
+
+The mailfiler(1cs) command files email messages in Maildirs according
+to simple text rules as described in mailfiler(5cs).
+
+=head1 MODES
+
+=head2 monitor
+
+In the "monitor" mode I<mailfiler> watched the specified I<maildirs> for email messages
+and files each according to a sequence of rules in the matching rules file
+(see mailfiler(5cs)).
+
+The matching rule file is named:
+
+  $HOME/.mailfiler/{maildir.basename}
+
+where "{maildir.basename}" is the basename of the named Maildir.
+
+Each Maildir is consulted in turn, so filings which delivery messages
+into Maildirs named later on the command line will cause the filed
+message to be processed in this run when that later Maildir is
+reached.
+
+The following options are available in monitor mode:
+
+=over 4
+
+=item B<-1>
+
+File at most 1 message per Maildir.
+
+=item B<-d> I<delay>
+
+Delay I<delay> seconds between runs.
+Default is to make only one run over the Maildirs.
+
+=item B<-n>
+
+No remove. File messages but do not remove successfully filed messages from the source Maildir.
+
+=item B<-N>
+
+No save. UNIMPLEMENTED.
+
+=item B<-R> I<rules_pattern>
+
+Specify the rules file pattern used to specify rules files from Maildir names.
+Default: $HOME/.mailfiler/{maildir.basename}
+
+=back
+
+=head1 SEE ALSO
+
+mailfiler(5cs), procmail(1)
+
+=head1 AUTHOR
+
+Cameron Simpson E<lt>cs@zip.com.auE<gt>
+

man/mailfiler.5.pod

+
+=head1 NAME
+
+mailfiler - rules file format
+
+=head1 DESCRIPTION
+
+The mailfiler(1cs) command's monitor watches Maildirs for newly
+arrived messages and files them according to a sequence of rules.
+
+Blank lines and lines commencing with an octothorpe ('#') are ignored.
+
+A line commencing with a less-than symbol ('<') is an "include" directive.
+The following word is the name of a file whose contents are read as though they
+appeared at this point in the rules file.
+If the filename is relative, it is resolved with respect to the
+directory part of the filename of the current rules file.
+
+A line commencing with an identifier and an equals symbol ('=') is
+an environment variable assignment.
+
+Other lines are mail filing rules, of the general form:
+
+  [!][=]targets tag condition
+
+A line commencing with whitespace is considered to be an additional
+condition to be ANDed with the preceeding line's rule conditions:
+
+  [!][=]targets tag condition1
+                    condition2
+                    condition3
+
+Rules may commences with either or both of the following mode indicators:
+
+  ! An exclaimation symbol ('!') indicates that an alert should be
+    emitted at the end of filing if this rule was matched.
+
+  = An equals symbol ('=') indicates that rule processing should
+    cease at this rule if it matches. Normally all matching rules are
+    applied.
+
+The "targets" is a comma separated list of mail destinations; a
+target takes the form of a sequence of nonwhitespace non-comma
+characters, or a string value in double quotes.
+
+A target commencing with a pipe symbol ('|') is considered a command
+to run with the message text on its standard input.
+If the command exits with a zero exit status is it considered to have run successfully.
+
+Otherwise, a target containing an "at" symbol ('@') is considered
+an email address to which to send a copy of the message.
+It the mail system accepts the message it is considered to have been dispatched successfully.
+
+Otherwise, a target is considered to indicate a Maildir into which the message should be placed.
+
+The message must be successfully delivered to all targets of all matching
+rules for the filter run to be considered successfully filtered.
+If the message matched no rules, delivery is attempted to the targets
+specified by the $DEFAULT environment variable.
+
+If all delivery attempt succeeded, the original message is remove from the Maildir.
+Otherwise the message remains in the Maildir and is ignored on subsequent polls.
+
+=head1 SEE ALSO
+
+mailfiler(1cs)
+
+=head1 AUTHOR
+
+Cameron Simpson E<lt>cs@zip.com.auE<gt>
+