diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-01-03 12:40:52 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-01-03 12:40:52 +0200 |
commit | c70f5d055d37bba1b26beafec8bfee902dc1b758 (patch) | |
tree | 7f7c140369fbab7c9d37765eec814e2fb81cf7fc | |
parent | 33f88906896d016ebd4e387ddc7a29c9f6c0dbc7 (diff) | |
download | mailfromd-c70f5d055d37bba1b26beafec8bfee902dc1b758.tar.gz mailfromd-c70f5d055d37bba1b26beafec8bfee902dc1b758.tar.bz2 |
Version 8.7release_8_7
* NEWS: Update.
* configure.ac: Raise minor version.
* doc/functions.texi: Document new functions
Include the implementation of the NS resolving MFL functions, as
proposed by Jan Rafaj
* lib/dns.c (ns_lookup): New function.
* lib/dns.h (ns_lookup): New proto.
* mflib/dns.mf4 (hasns): New function.
* src/builtin/dns.bi (primitive_hasns, getns): New functions.
-rw-r--r-- | NEWS | 23 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | doc/functions.texi | 100 | ||||
-rw-r--r-- | lib/dns.c | 30 | ||||
-rw-r--r-- | lib/dns.h | 2 | ||||
-rw-r--r-- | mflib/dns.mf4 | 13 | ||||
-rw-r--r-- | src/builtin/dns.bi | 84 |
7 files changed, 216 insertions, 40 deletions
@@ -1,9 +1,9 @@ | |||
1 | Mailfromd NEWS -- history of user-visible changes. 2018-11-12 | 1 | Mailfromd NEWS -- history of user-visible changes. 2019-01-03 |
2 | See the end of file for copying conditions. | 2 | See the end of file for copying conditions. |
3 | 3 | ||
4 | Please send Mailfromd bug reports to <bug-mailfromd@gnu.org.ua> | 4 | Please send Mailfromd bug reports to <bug-mailfromd@gnu.org.ua> |
5 | 5 | ||
6 | Version 8.6.90 (Git) | 6 | Version 8.7, 2019-01-03 |
7 | 7 | ||
8 | * The --callout-socket option | 8 | * The --callout-socket option |
9 | 9 | ||
@@ -15,6 +15,25 @@ overrides. | |||
15 | This option is used by mtasim to avoid clobbering the existing callout | 15 | This option is used by mtasim to avoid clobbering the existing callout |
16 | sockets when starting new mailfromd instance. | 16 | sockets when starting new mailfromd instance. |
17 | 17 | ||
18 | * NS lookup NFL functions | ||
19 | |||
20 | This release implements the following new MFL functions: | ||
21 | |||
22 | number primitive_hasns (string DOM) | ||
23 | Returns 1 if the domain DOM has at least one NS record and 0 | ||
24 | otherwise. Throws an error if DNS lookup fails. | ||
25 | |||
26 | require 'dns' | ||
27 | number hasns (string DOM) | ||
28 | Same as above, but returns 0 on DNS lookup failures. | ||
29 | |||
30 | string getns (string DOM ; number RESOLVE, number SORT) | ||
31 | |||
32 | Returns a whitespace-separated list of all the NS records for | ||
33 | the domain DOM. If optional parameter RESOLVE is 1, the returned list | ||
34 | contains IP addresses. Optional SORT controls whether the entries are | ||
35 | sorted. | ||
36 | |||
18 | * Bugfixes | 37 | * Bugfixes |
19 | ** Callout functions return true on checking the null return address (<>) | 38 | ** Callout functions return true on checking the null return address (<>) |
20 | ** Arguments in transaction between mailfromd and calloutd are quoted | 39 | ** Arguments in transaction between mailfromd and calloutd are quoted |
diff --git a/configure.ac b/configure.ac index 3585d967..54c9ebd8 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -16,8 +16,8 @@ | |||
16 | 16 | ||
17 | AC_PREREQ(2.63) | 17 | AC_PREREQ(2.63) |
18 | m4_define([MF_VERSION_MAJOR], 8) | 18 | m4_define([MF_VERSION_MAJOR], 8) |
19 | m4_define([MF_VERSION_MINOR], 6) | 19 | m4_define([MF_VERSION_MINOR], 7) |
20 | m4_define([MF_VERSION_PATCH], 90) | 20 | dnl m4_define([MF_VERSION_PATCH], 0) |
21 | AC_INIT([mailfromd], | 21 | AC_INIT([mailfromd], |
22 | MF_VERSION_MAJOR.MF_VERSION_MINOR[]m4_ifdef([MF_VERSION_PATCH],.MF_VERSION_PATCH), | 22 | MF_VERSION_MAJOR.MF_VERSION_MINOR[]m4_ifdef([MF_VERSION_PATCH],.MF_VERSION_PATCH), |
23 | [bug-mailfromd@gnu.org.ua], | 23 | [bug-mailfromd@gnu.org.ua], |
diff --git a/doc/functions.texi b/doc/functions.texi index 75eed904..d25911aa 100644 --- a/doc/functions.texi +++ b/doc/functions.texi | |||
@@ -5,7 +5,10 @@ | |||
5 | @c Invariant Sections, with the Front and Back-Cover texts at your option. | 5 | @c Invariant Sections, with the Front and Back-Cover texts at your option. |
6 | 6 | ||
7 | This chapter describes library functions available in Mailfromd | 7 | This chapter describes library functions available in Mailfromd |
8 | version @value{VERSION}. | 8 | version @value{VERSION}. For the simplicity of explanation, we use |
9 | the word @samp{boolean} to indicate variables of numeric type that are | ||
10 | used as boolean values. For such variables, the term @samp{False} | ||
11 | stands for the numeric 0, and @samp{True} for any non-zero value. | ||
9 | 12 | ||
10 | @menu | 13 | @menu |
11 | * Macro access:: | 14 | * Macro access:: |
@@ -65,7 +68,7 @@ macro names programmatically, e.g.: | |||
65 | @end smallexample | 68 | @end smallexample |
66 | @end deftypefn | 69 | @end deftypefn |
67 | 70 | ||
68 | @deftypefn {Built-in Function} number macro_defined (string @var{name}) | 71 | @deftypefn {Built-in Function} boolean macro_defined (string @var{name}) |
69 | Return true if Sendmail macro @var{name} is defined. | 72 | Return true if Sendmail macro @var{name} is defined. |
70 | @end deftypefn | 73 | @end deftypefn |
71 | 74 | ||
@@ -602,7 +605,7 @@ is returned otherwise. In the latter case, the global variable | |||
602 | @code{ctype_mismatch} is set to the index of the first character that | 605 | @code{ctype_mismatch} is set to the index of the first character that |
603 | is outside of the character class (characters are indexed from 0). | 606 | is outside of the character class (characters are indexed from 0). |
604 | 607 | ||
605 | @deftypefn {Built-in Function} number isalnum (string @var{str}) | 608 | @deftypefn {Built-in Function} boolean isalnum (string @var{str}) |
606 | Checks for alphanumeric characters: | 609 | Checks for alphanumeric characters: |
607 | 610 | ||
608 | @smallexample | 611 | @smallexample |
@@ -611,7 +614,7 @@ Checks for alphanumeric characters: | |||
611 | @end smallexample | 614 | @end smallexample |
612 | @end deftypefn | 615 | @end deftypefn |
613 | 616 | ||
614 | @deftypefn {Built-in Function} number isalpha (string @var{str}) | 617 | @deftypefn {Built-in Function} boolean isalpha (string @var{str}) |
615 | Checks for an alphabetic character: | 618 | Checks for an alphabetic character: |
616 | 619 | ||
617 | @smallexample | 620 | @smallexample |
@@ -620,7 +623,7 @@ Checks for an alphabetic character: | |||
620 | @end smallexample | 623 | @end smallexample |
621 | @end deftypefn | 624 | @end deftypefn |
622 | 625 | ||
623 | @deftypefn {Built-in Function} number isascii (string @var{str}) | 626 | @deftypefn {Built-in Function} boolean isascii (string @var{str}) |
624 | Checks whether all characters in @var{str} are 7-bit ones, that fit into | 627 | Checks whether all characters in @var{str} are 7-bit ones, that fit into |
625 | the @acronym{ASCII} character set. | 628 | the @acronym{ASCII} character set. |
626 | 629 | ||
@@ -630,47 +633,47 @@ the @acronym{ASCII} character set. | |||
630 | @end smallexample | 633 | @end smallexample |
631 | @end deftypefn | 634 | @end deftypefn |
632 | 635 | ||
633 | @deftypefn {Built-in Function} number isblank (string @var{str}) | 636 | @deftypefn {Built-in Function} boolean isblank (string @var{str}) |
634 | Checks if @var{str} contains only blank characters; that is, spaces or | 637 | Checks if @var{str} contains only blank characters; that is, spaces or |
635 | tabs. | 638 | tabs. |
636 | @end deftypefn | 639 | @end deftypefn |
637 | 640 | ||
638 | @deftypefn {Built-in Function} number iscntrl (string @var{str}) | 641 | @deftypefn {Built-in Function} boolean iscntrl (string @var{str}) |
639 | Checks for control characters. | 642 | Checks for control characters. |
640 | @end deftypefn | 643 | @end deftypefn |
641 | 644 | ||
642 | @deftypefn {Built-in Function} number isdigit (string @var{str}) | 645 | @deftypefn {Built-in Function} boolean isdigit (string @var{str}) |
643 | Checks for digits (0 through 9). | 646 | Checks for digits (0 through 9). |
644 | @end deftypefn | 647 | @end deftypefn |
645 | 648 | ||
646 | @deftypefn {Built-in Function} number isgraph (string @var{str}) | 649 | @deftypefn {Built-in Function} boolean isgraph (string @var{str}) |
647 | Checks for any printable characters except spaces. | 650 | Checks for any printable characters except spaces. |
648 | @end deftypefn | 651 | @end deftypefn |
649 | 652 | ||
650 | @deftypefn {Built-in Function} number islower (string @var{str}) | 653 | @deftypefn {Built-in Function} boolean islower (string @var{str}) |
651 | Checks for lower-case characters. | 654 | Checks for lower-case characters. |
652 | @end deftypefn | 655 | @end deftypefn |
653 | 656 | ||
654 | @deftypefn {Built-in Function} number isprint (string @var{str}) | 657 | @deftypefn {Built-in Function} boolean isprint (string @var{str}) |
655 | Checks for printable characters including space. | 658 | Checks for printable characters including space. |
656 | @end deftypefn | 659 | @end deftypefn |
657 | 660 | ||
658 | @deftypefn {Built-in Function} number ispunct (string @var{str}) | 661 | @deftypefn {Built-in Function} boolean ispunct (string @var{str}) |
659 | Checks for any printable characters which are not a spaces or | 662 | Checks for any printable characters which are not a spaces or |
660 | alphanumeric characters. | 663 | alphanumeric characters. |
661 | @end deftypefn | 664 | @end deftypefn |
662 | 665 | ||
663 | @deftypefn {Built-in Function} number isspace (string @var{str}) | 666 | @deftypefn {Built-in Function} boolean isspace (string @var{str}) |
664 | Checks for white-space characters, i.e.: space, form-feed (@samp{\f}), | 667 | Checks for white-space characters, i.e.: space, form-feed (@samp{\f}), |
665 | newline (@samp{\n}), carriage return (@samp{\r}), horizontal tab | 668 | newline (@samp{\n}), carriage return (@samp{\r}), horizontal tab |
666 | (@samp{\t}), and vertical tab (@samp{\v}). | 669 | (@samp{\t}), and vertical tab (@samp{\v}). |
667 | @end deftypefn | 670 | @end deftypefn |
668 | 671 | ||
669 | @deftypefn {Built-in Function} number isupper (string @var{str}) | 672 | @deftypefn {Built-in Function} boolean isupper (string @var{str}) |
670 | Checks for uppercase letters. | 673 | Checks for uppercase letters. |
671 | @end deftypefn | 674 | @end deftypefn |
672 | 675 | ||
673 | @deftypefn {Built-in Function} number isxdigit (string @var{str}) | 676 | @deftypefn {Built-in Function} boolean isxdigit (string @var{str}) |
674 | Checks for hexadecimal digits, i.e. one of @samp{0}, @samp{1}, | 677 | Checks for hexadecimal digits, i.e. one of @samp{0}, @samp{1}, |
675 | @samp{2}, @samp{3}, @samp{4}, @samp{5}, @samp{6}, @samp{7}, @samp{8}, | 678 | @samp{2}, @samp{3}, @samp{4}, @samp{5}, @samp{6}, @samp{7}, @samp{8}, |
676 | @samp{9}, @samp{a}, @samp{b}, @samp{c}, @samp{d}, @samp{e}, @samp{f}, | 679 | @samp{9}, @samp{a}, @samp{b}, @samp{c}, @samp{d}, @samp{e}, @samp{f}, |
@@ -717,7 +720,7 @@ email address. | |||
717 | @end deftypefn | 720 | @end deftypefn |
718 | 721 | ||
719 | @deftypefn {Library Function} boolean email_valid (string @var{email}) | 722 | @deftypefn {Library Function} boolean email_valid (string @var{email}) |
720 | Returns @var{True} if @var{email} is a valid email address, | 723 | Returns @samp{True} (1) if @var{email} is a valid email address, |
721 | consisting of local and domain parts only. E.g.: | 724 | consisting of local and domain parts only. E.g.: |
722 | 725 | ||
723 | @smallexample | 726 | @smallexample |
@@ -1704,7 +1707,7 @@ compativbility. | |||
1704 | These functions are defined in the module @file{poll.mf}, which you | 1707 | These functions are defined in the module @file{poll.mf}, which you |
1705 | must require prior to using any of them. | 1708 | must require prior to using any of them. |
1706 | 1709 | ||
1707 | @deftypefn {Library Function} number _pollhost @ | 1710 | @deftypefn {Library Function} boolean _pollhost @ |
1708 | (string @var{ip}, string @var{email}, string @var{domain}, @ | 1711 | (string @var{ip}, string @var{email}, string @var{domain}, @ |