diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-11-09 17:20:09 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-11-09 17:20:09 +0000 |
commit | 46936e44f4cc14023197034f87d54e6c97e805f4 (patch) | |
tree | b6c2167eecec7978c5f9e002ba9e2044ca115746 /doc | |
parent | a7c89f29d6f47fdb27a91908f96444920e3e21f9 (diff) | |
download | mailfromd-46936e44f4cc14023197034f87d54e6c97e805f4.tar.gz mailfromd-46936e44f4cc14023197034f87d54e6c97e805f4.tar.bz2 |
Add built-in functions for accessing Sendmail macros.
* mfd/mailfromd.h (env_get_macro): New proto.
* mfd/prog.c (env_get_macro): New function.
* mfd/bi_macro.m4: New file.
* mfd/Makefile.am (M4_FILES): Add bi_macro.m4.
* NEWS: Update.
* doc/mailfromd.texi (Macro access): New subsubsection.
git-svn-id: file:///svnroot/mailfromd/trunk@1729 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'doc')
-rw-r--r-- | doc/mailfromd.texi | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 90483eff..84c1266b 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -231,6 +231,7 @@ Functions Built-in and Library Functions +* Macro access:: * String manipulation:: * String formatting:: * Envelope modification functions:: @@ -304,6 +305,11 @@ Command Line Options. * daemon mode:: * option summary:: +Pmilter multiplexor program. + +* pmult invocation:: +* configuration:: + @end detailmenu @end menu @@ -4934,6 +4940,9 @@ is the same for both single-character and multi-character macro names. For consistency with the @command{Sendmail} configuration the @samp{$@{@var{name}@}} notation is also accepted. + Another way to reference Sendmail macros is using function +@code{getmacro} (@pxref{Macro access}). + Sendmail macros evaluate to string values. Notice, that to reference a macro, you must properly export it in @@ -5915,6 +5924,7 @@ functions}. in version @value{VERSION}. @menu +* Macro access:: * String manipulation:: * String formatting:: * Envelope modification functions:: @@ -5940,6 +5950,28 @@ in version @value{VERSION}. * SPF Functions:: @end menu +@node Macro access +@subsubsection Sendmail Macro Access Functions + +@deftypefn {Built-in Function} string getmacro (string @var{macro}) +Returns the value of Sendmail macro @var{macro}. If @var{macro} is +not defined, raises the @code{e_macroundef} exception. + +Calling @code{getmacro(@var{name})} is completely equivalent to +referencing @code{$@{@var{name}@}}, except that it allows to construct +macro names programmatically, e.g.: + +@smallexample + if getmacro("auth_" %var) = "foo" + @dots{} + fi +@end smallexample +@end deftypefn + +@deftypefn {Built-in Function} number macro_defined (string @var{name}) +Return true if Sendmail macro @var{name} is defined. +@end deftypefn + @node String manipulation @subsubsection String Manipulation Functions @deftypefn {Built-in Function} string domainpart (string @var{str}) |