aboutsummaryrefslogtreecommitdiff
path: root/doc/mailfromd.texi
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-05-09 20:18:43 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-05-09 20:19:52 +0300
commit998eaf2cdb444ee77ff67068ce3586de1eea8e4e (patch)
tree5013d3978055eaf155b079076f1028edd0994b0a /doc/mailfromd.texi
parent30775f7ce1215423967c681ab9f3cf0a4704b51e (diff)
downloadmailfromd-998eaf2cdb444ee77ff67068ce3586de1eea8e4e.tar.gz
mailfromd-998eaf2cdb444ee77ff67068ce3586de1eea8e4e.tar.bz2
Implement current header access functions.
* mfd/bi_curhdr.m4: New file: implementation of current header functions. * mfd/Makefile.am (M4_FILES): Add bi_curhdr.m4 * mfd/bi_mbox.m4 (mailbox_open): Work over MU lossage. * mfd/bi_msg.m4 (bi_drop_current_message): Remove. (drop_current_message): New function. * mfd/mailfromd.h (env_reposition): New prototype. * mfd/msg.h (bi_drop_current_message): Remove. * mfd/prog.c (struct eval_environ.reposition): New member. (env_reposition): New function. Work over MU lossage. (env_capture_start): Call env_free_captured to release any module private captured data. Reset env->reposition to 0. (env_capture_write): If env->reposition is set, move stream pointer to the end of stream. (struct builtin_priv.free_capture): New member. (builtin_priv_register): Take 3 arguments. (env_free_captured): New function. * mfd/prog.h (builtin_priv_register): Update proto. * mfd/snarf.m4 (MF_DECLARE_DATA): Get at most 3 arguments. * NEWS, doc/mailutils.texi: Document new functions. * tests/etc/hdr.mts: New file (message transfer session). * tests/etc/hdr2.mts: Likewise. * tests/etc/Makefile.am (EXTRA_DIST): Add new files. * tests/hdr-all.at: New testcase. * tests/hdr-cap.at: New testcase. * tests/hdr-count.at: New testcase. * tests/hdr-gete.at: New testcase. * tests/hdr-getn.at: New testcase. * tests/hdr-itr.at: New testcase. * tests/hdr-mul.at: New testcase. * tests/Makefile.am (TESTSUITE_AT): Add new testcase. * tests/atlocal.in (TESTDIR): New variable. * tests/testsuite.at (MTASIM_DEFS): New define. (AT_MTA_TEST): Rename to AT_MTA_TEST_FILTER. All uses updated. (AT_MTA_TEST_SCRIPT,AT_MTA_TEST_FILTER_SCRIPT): New defines. Include new testcases. * tests/arg.at, tests/curmsg.at, tests/numrcpt.at, tests/reject.at, tests/tempfail.at: Updated.
Diffstat (limited to 'doc/mailfromd.texi')
-rw-r--r--doc/mailfromd.texi62
1 files changed, 62 insertions, 0 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi
index 8390fbea..0d171ab0 100644
--- a/doc/mailfromd.texi
+++ b/doc/mailfromd.texi
@@ -232,6 +232,7 @@ Built-in and Library Functions
* Body Modification Functions::
* Mail header functions::
* Mail body functions::
+* Current Message Functions::
* Mailbox functions::
* Message functions::
* Quarantine functions::
@@ -301,6 +302,17 @@ Command Line Options.
* daemon mode::
* option summary::
+A universal socket-map program for MeTA1.
+
+* smap-conf:: Smap Configuration.
+* smap-invoke:: Smap Command Line Arguments.
+* smap-examples:: Examples of Using Smap
+
+Smap Examples
+
+* smap-userdb:: Configure local_user_map.
+* smap-aliases:: Configure aliases.
+
Pmilter multiplexer program.
* pmult configuration::
@@ -5838,6 +5850,7 @@ in version @value{VERSION}.
* Body Modification Functions::
* Mail header functions::
* Mail body functions::
+* Current Message Functions::
* Mailbox functions::
* Message functions::
* Quarantine functions::
@@ -6589,6 +6602,9 @@ a @code{body} handler to a regular @acronym{MFL} string. For more
information about its use, see @ref{body handler}.
@end deftypefn
+@node Current Message Functions
+@subsubsection Current Message Functions
+
@anchor{current_message}
@deftypefn {Built-in Function} number current_message ()
This function can be used in @code{eom} handlers only. It returns a
@@ -6596,6 +6612,52 @@ message descriptor referring to the current message. @xref{Message
functions}, for a description of functions for accessing messages.
@end deftypefn
+The functions below access the headers from the current message. They
+are available in the following handlers: @code{eoh}, @code{body}, @code{eom}.
+
+@deftypefn {Built-in Function} number current_header_count ([string @var{name}])
+
+Return number of headers in the current message. If @var{name}
+is specified, return number of headers that have this name.
+
+@smallexample
+ current_header_count() @result{} 6
+ current_header_count("Subject") @result{} 6
+@end smallexample
+@end deftypefn
+
+@deftypefn {Built-in Function} string current_header_nth_name (number @var{n})
+
+Return the name of the @var{n}th header. The index @var{n} is 1-based.
+@end deftypefn
+
+@deftypefn {Built-in Function} string current_header_nth_value (number @var{n})
+
+Return the value of the @var{n}th header. The index @var{n} is
+1-based.
+@end deftypefn
+
+@deftypefn {Built-in Function} string current_header (string name @
+ [, number @var{n}])
+Return the value of the named header, e.g.:
+
+@smallexample
+ set s current_header("Subject")
+@end smallexample
+
+Optional second argument specifies the header instance, if there are
+more than 1 header of the same name, e.g.:
+
+@smallexample
+ set s current_header("Received", 2)
+@end smallexample
+
+Header indices are 1-based.
+@end deftypefn
+
+All current_header function raise the @code{e_not_found} exception if the
+requested header is not found.
+
@node Mailbox functions
@subsubsection Mailbox Functions
@cindex mailbox functions

Return to:

Send suggestions and report system problems to the System administrator.