X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/375ee7660331d1654b4e8c8bf3f2c358dbb919d3..be36e5721725253b7529899884d7fe8ecd5120b9:/doc/doc-docbook/spec.xfpt diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 2425cac60..69009e92d 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -6875,12 +6875,6 @@ ${lookup dnsdb{ptr=192.168.4.5}{$value}fail} If the data for a PTR record is not a syntactically valid IP address, it is not altered and nothing is added. -.cindex "MX record" "in &(dnsdb)& lookup" -.cindex "SRV record" "in &(dnsdb)& lookup" -For an MX lookup, both the preference value and the host name are returned for -each record, separated by a space. For an SRV lookup, the priority, weight, -port, and host name are returned for each record, separated by spaces. - For any record type, if multiple records are found (or, for A6 lookups, if a single record leads to multiple addresses), the data is returned as a concatenation, with newline as the default separator. The order, of course, @@ -6893,6 +6887,16 @@ ${lookup dnsdb{>: a=host1.example}} It is permitted to specify a space as the separator character. Further white space is ignored. +.cindex "MX record" "in &(dnsdb)& lookup" +.cindex "SRV record" "in &(dnsdb)& lookup" +For an MX lookup, both the preference value and the host name are returned for +each record, separated by a space. For an SRV lookup, the priority, weight, +port, and host name are returned for each record, separated by spaces. +.new +An alternate field separator can be specified using a comma after the main +separator character, followed immediately by the field separator. +.wen + .cindex "TXT record" "in &(dnsdb)& lookup" .cindex "SPF record" "in &(dnsdb)& lookup" For TXT records with multiple items of data, only the first item is returned, @@ -7338,30 +7342,44 @@ If you specify multiple attributes, the result contains space-separated, quoted strings, each preceded by the attribute name and an equals sign. Within the quotes, the quote character, backslash, and newline are escaped with backslashes, and commas are used to separate multiple values for the attribute. +.new +Any commas in attribute values are doubled +(permitting treatment of the values as a comma-separated list). +.wen Apart from the escaping, the string within quotes takes the same form as the output when a single attribute is requested. Specifying no attributes is the same as specifying all of an entry's attributes. +.new Here are some examples of the output format. The first line of each pair is an LDAP query, and the second is the data that is returned. The attribute called -&%attr1%& has two values, whereas &%attr2%& has only one value: +&%attr1%& has two values, one of them with an embedded comma, whereas +&%attr2%& has only one value: .code ldap:///o=base?attr1?sub?(uid=fred) -value1.1, value1.2 +value1.1,value1,,2 ldap:///o=base?attr2?sub?(uid=fred) value two ldap:///o=base?attr1,attr2?sub?(uid=fred) -attr1="value1.1, value1.2" attr2="value two" +attr1="value1.1,value1,,2" attr2="value two" ldap:///o=base??sub?(uid=fred) -objectClass="top" attr1="value1.1, value1.2" attr2="value two" +objectClass="top" attr1="value1.1,value1,,2" attr2="value two" .endd -The &%extract%& operator in string expansions can be used to pick out -individual fields from data that consists of &'key'&=&'value'& pairs. You can +.wen +You can make use of Exim's &%-be%& option to run expansion tests and thereby check the results of LDAP lookups. +The &%extract%& operator in string expansions can be used to pick out +individual fields from data that consists of &'key'&=&'value'& pairs. +.new +The &%listextract%& operator should be used to pick out individual values +of attributes, even when only a single value is expected. +The doubling of embedded commas allows you to use the returned data as a +comma separated list (using the "<," syntax for changing the input list separator). +.wen @@ -11413,6 +11431,11 @@ the result, the name is not accepted, and &$host_lookup_deferred$& is set to .vindex "&$host_lookup_failed$&" See &$host_lookup_deferred$&. +.vitem &$host_port$& +.vindex "&$host_port$&" +This variable is set to the remote host's TCP port whenever &$host$& is set +for an outbound connection. + .vitem &$inode$& .vindex "&$inode$&" @@ -11659,7 +11682,7 @@ This variable is like &$message_headers$& except that no processing of the contents of header lines is done. .vitem &$message_id$& -This is an old name for &$message_exim_id$&, which is now deprecated. +This is an old name for &$message_exim_id$&. It is now deprecated. .vitem &$message_linecount$& .vindex "&$message_linecount$&" @@ -12355,7 +12378,9 @@ If TLS has not been negotiated, the value will be 0. This variable refers to the certificate presented to the peer of an inbound connection when the message was received. It is only useful as the argument of a -&%certextract%& expansion item, &%md5%& or &%sha1%& operator, +.new +&%certextract%& expansion item, &%md5%&, &%sha1%& or &%sha256%& operator, +.wen or a &%def%& condition. .vitem &$tls_in_peercert$& @@ -12363,21 +12388,27 @@ or a &%def%& condition. This variable refers to the certificate presented by the peer of an inbound connection when the message was received. It is only useful as the argument of a -&%certextract%& expansion item, &%md5%& or &%sha1%& operator, +.new +&%certextract%& expansion item, &%md5%&, &%sha1%& or &%sha256%& operator, +.wen or a &%def%& condition. .vitem &$tls_out_ourcert$& .vindex "&$tls_out_ourcert$&" This variable refers to the certificate presented to the peer of an outbound connection. It is only useful as the argument of a -&%certextract%& expansion item, &%md5%& or &%sha1%& operator, +.new +&%certextract%& expansion item, &%md5%&, &%sha1%& or &%sha256%& operator, +.wen or a &%def%& condition. .vitem &$tls_out_peercert$& .vindex "&$tls_out_peercert$&" This variable refers to the certificate presented by the peer of an outbound connection. It is only useful as the argument of a -&%certextract%& expansion item, &%md5%& or &%sha1%& operator, +.new +&%certextract%& expansion item, &%md5%&, &%sha1%& or &%sha256%& operator, +.wen or a &%def%& condition. .vitem &$tls_in_certificate_verified$& @@ -16800,6 +16831,48 @@ If the expansion fails (other than forced failure) delivery is deferred. Some of the other precondition options are common special cases that could in fact be specified using &%condition%&. +.new +Historical note: We have &%condition%& on ACLs and on Routers. Routers +are far older, and use one set of semantics. ACLs are newer and when +they were created, the ACL &%condition%& process was given far stricter +parse semantics. The &%bool{}&% expansion condition uses the same rules as +ACLs. The &%bool_lax{}%& expansion condition uses the same rules as +Routers. More pointedly, the &%bool_lax{}%& was written to match the existing +Router rules processing behavior. + +This is best illustrated in an example: +.code +# If used in an ACL condition will fail with a syntax error, but +# in a router condition any extra characters are treated as a string + +$ exim -be '${if eq {${lc:GOOGLE.com}} {google.com}} {yes} {no}}' +true {yes} {no}} + +$ exim -be '${if eq {${lc:WHOIS.com}} {google.com}} {yes} {no}}' + {yes} {no}} +.endd +In each example above, the &%if%& statement actually ends after +&"{google.com}}"&. Since no true or false braces were defined, the +default &%if%& behavior is to return a boolean true or a null answer +(which evaluates to false). The rest of the line is then treated as a +string. So the first example resulted in the boolean answer &"true"& +with the string &" {yes} {no}}"& appended to it. The second example +resulted in the null output (indicating false) with the string +&" {yes} {no}}"& appended to it. + +In fact you can put excess forward braces in too. In the router +&%condition%&, Exim's parser only looks for &"{"& symbols when they +mean something, like after a &"$"& or when required as part of a +conditional. But otherwise &"{"& and &"}"& are treated as ordinary +string characters. + +Thus, in a Router, the above expansion strings will both always evaluate +true, as the result of expansion is a non-empty string which doesn't +match an explicit false value. This can be tricky to debug. By +contrast, in an ACL either of those strings will always result in an +expansion error because the result doesn't look sufficiently boolean. +.wen + .option debug_print routers string&!! unset .cindex "testing" "variables in drivers" @@ -27624,6 +27697,11 @@ anyway. If the message contains newlines, this gives rise to a multi-line SMTP response. .vindex "&$acl_verify_message$&" +.new +For ACLs that are called by an &%acl =%& ACL condition, the message is +stored in &$acl_verify_message$&, from which the calling ACL may use it. +.wen + If &%message%& is used on a statement that verifies an address, the message specified overrides any message that is generated by the verification process. However, the original message is available in the variable