Add bitwise logical operators to ${eval:
[exim.git] / doc / doc-txt / NewStuff
1 $Cambridge: exim/doc/doc-txt/NewStuff,v 1.121 2006/11/13 11:26:37 ph10 Exp $
2
3 New Features in Exim
4 --------------------
5
6 This file contains descriptions of new features that have been added to Exim.
7 Before a formal release, there may be quite a lot of detail so that people can
8 test from the snapshots or the CVS before the documentation is updated. Once
9 the documentation is updated, this file is reduced to a short list.
10
11
12 Version 4.64
13 ------------
14
15 1. ACL variables can now be given arbitrary names, as long as they start with
16 "acl_c" or "acl_m" (for connection variables and message variables), are at
17 least six characters long, with the sixth character being either a digit or
18 an underscore. The rest of the name can contain alphanumeric characters and
19 underscores. This is a compatible change because the old set of variables
20 such as acl_m12 are a subset of the allowed names. There may now be any
21 number of ACL variables. For example:
22
23 set acl_c13 = value for original ACL variable
24 set acl_c13b = whatever
25 set acl_m_foo = something
26
27 What happens if a syntactically valid but undefined ACL variable is
28 referenced depends on the setting of the strict_acl_vars option. If it is
29 false (the default), an empty string is substituted; if it is true, an
30 error is generated. This affects all ACL variables, including the "old"
31 ones such as acl_c4. (Previously there wasn't the concept of an undefined
32 ACL variable.)
33
34 The implementation has been done in such a way that spool files containing
35 ACL variable settings written by previous releases of Exim are compatible
36 and can be read by the new release. If only the original numeric names are
37 used, spool files written by the new release can be read by earlier
38 releases.
39
40 2. There is a new ACL modifier called log_reject_target. It makes it possible
41 to specify which logs are used for messages about ACL rejections. Its
42 argument is a list of words which can be "main", "reject", or "panic". The
43 default is "main:reject". The list may be empty, in which case a rejection
44 is not logged at all. For example, this ACL fragment writes no logging
45 information when access is denied:
46
47 deny <some conditions>
48 log_reject_target =
49
50 The modifier can be used in SMTP and non-SMTP ACLs. It applies to both
51 permanent and temporary rejections.
52
53 3. There is a new authenticator called "dovecot". This is an interface to the
54 authentication facility of the Dovecot POP/IMAP server, which can support a
55 number of authentication methods. If you are using Dovecot to authenticate
56 POP/IMAP clients, it might be helpful to use the same mechanisms for SMTP
57 authentication. This is a server authenticator only. The only option is
58 server_socket, which must specify the socket which is the interface to
59 Dovecot authentication. The public_name option must specify an
60 authentication mechanism that Dovecot is configured to support. You can
61 have several authenticators for different mechanisms. For example:
62
63 dovecot_plain:
64 driver = dovecot
65 public_name = PLAIN
66 server_name = /var/run/dovecot/auth-client
67 server_setid = $auth1
68
69 dovecot_ntlm:
70 driver = dovecot
71 public_name = NTLM
72 server_name = /var/run/dovecot/auth-client
73 server_setid = $auth1
74
75 If the SMTP connection is encrypted, or if $sender_host_address is equal to
76 $interface_address (that is, the connection is local), the "secured" option
77 is passed in the Dovecot authentication command. If, for a TLS connection,
78 a client certificate has been verified, the "valid-client-cert" option is
79 passed.
80
81 4. The variable $message_headers_raw provides a concatenation of all the
82 messages's headers without any decoding. This is in contrast to
83 $message_headers, which does RFC2047 decoding on the header contents.
84
85 5. In a DNS black list, when the facility for restricting the matching IP
86 values is used, the text from the TXT record that is set in $dnslist_text
87 may not reflect the true reason for rejection. This happens when lists are
88 merged and the IP address in the A record is used to distinguish them;
89 unfortunately there is only one TXT record. One way round this is not to
90 use merged lists, but that can be inefficient because it requires multiple
91 DNS lookups where one would do in the vast majority of cases when the host
92 of interest is not on any of the lists.
93
94 A less inefficient way of solving this problem has now been implemented. If
95 two domain names, comma-separated, are given, the second is used first to
96 do an initial check, making use of any IP value restrictions that are set.
97 If there is a match, the first domain is used, without any IP value
98 restrictions, to get the TXT record. As a byproduct of this, there is also
99 a check that the IP being tested is indeed on the first list. The first
100 domain is the one that is put in $dnslist_domain. For example:
101
102 reject message = rejected because $sender_ip_address is blacklisted \
103 at $dnslist_domain\n$dnslist_text
104 dnslists = sbl.spamhaus.org,sbl-xbl.spamhaus.org=127.0.0.2 : \
105 dul.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.10
106
107 For the first blacklist item, this starts by doing a lookup in
108 sbl-xbl.spamhaus.org and testing for a 127.0.0.2 return. If there is a
109 match, it then looks in sbl.spamhaus.org, without checking the return
110 value, and as long as something is found, it looks for the corresponding
111 TXT record. If there is no match in sbl-xbl.spamhaus.org, nothing more is
112 done. The second blacklist item is processed similarly.
113
114 If you are interested in more than one merged list, the same list must be
115 given several times, but because the results of the DNS lookups are cached,
116 the DNS calls themselves are not repeated. For example:
117
118 reject dnslists = http.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.2 : \
119 socks.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.3 : \
120 misc.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.4 : \
121 dul.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.10
122
123 In this case there is a lookup in dnsbl.sorbs.net, and if none of the IP
124 values matches (or if no record is found), this is the only lookup that is
125 done. Only if there is a match is one of the more specific lists consulted.
126
127 6. All authenticators now have a server_condition option. Previously, only
128 plaintext had this, and this has not changed: it must be set to the
129 authenticator as a server. For the others, if server_condition is set, it
130 is expanded if authentication is successful, and treated exactly as it is
131 in plaintext. This can serve as a means of adding authorization to an
132 authenticator.
133
134 7. There is a new command-line option called -Mset. It is useful only in
135 conjunction with -be (that is, when testing string expansions). It must be
136 followed by a message id; Exim loads the given message from its spool
137 before doing the expansions, thus setting message-specific variables such
138 as $message_size and the header variables. The $recipients variable is
139 available. This feature is provided to make it easier to test expansions
140 that make use of these variables. However, Exim must be called by an admin
141 user when -Mset is used.
142
143 8. Another similar new command-line option is called -bem. It operates like
144 -be except that it must be followed by the name of a file. For example:
145
146 exim -bem /tmp/testmessage
147
148 The file is read as a message (as if receiving a locally-submitted non-SMTP
149 message) before any of the test expansions are done. Thus, message-specific
150 variables such as $message_size and $h_from: are available. However, no
151 Received: header is added to the message. If the -t option is set,
152 recipients are read from the headers in the normal way, and are shown in
153 the $recipients variable. Note that recipients cannot be given on the
154 command line, because further arguments are taken as strings to expand
155 (just like -be).
156
157 9. When an address is delayed because of a 4xx response to a RCPT command, it
158 is now the combination of sender and recipient that is delayed in
159 subsequent queue runs until its retry time is reached. You can revert to
160 the previous behavious, that is, delay the recipient independent of the
161 sender, by setting address_retry_include_sender=false in the smtp
162 transport. However, this can lead to problems with servers that regularly
163 issue 4xx responses to RCPT commands.
164
165 10. Unary negation and the bitwise logical operators and, or, xor, not, and
166 shift, have been added to the eval: and eval10: expansion items. These
167 items may now contain arithmetic operators (plus, minus, times, divide,
168 remainder, negate), bitwise operators (and, or, xor, not, shift), and
169 parentheses. All operations are carried out using signed integer
170 arithmetic. Operator priorities are as in C, namely:
171
172 (highest) not, negate
173 times, divide, remainder
174 plus, minus
175 shift-left, shift-right
176 and
177 xor
178 (lowest) or
179
180 Binary operators with the same priority are evaluated from left to right.
181 For example:
182
183 ${eval:1+1} yields 2
184 ${eval:1+2*3} yields 7
185 ${eval:(1+2)*3} yields 9
186 ${eval:2+42%5} yields 4
187 ${eval:0xc&5} yields 4
188 ${eval:0xc|5} yields 13
189 ${eval:0xc^5} yields 9
190 ${eval:0xc>>1} yields 6
191 ${eval:0xc<<1} yields 24
192 ${eval:~255&0x1234} yields 4608
193 ${eval:-(~255&0x1234)} yields -4608
194
195
196 Version 4.63
197 ------------
198
199 1. There is a new Boolean option called filter_prepend_home for the redirect
200 router.
201
202 2. There is a new acl, set by acl_not_smtp_start, which is run right at the
203 start of receiving a non-SMTP message, before any of the message has been
204 read.
205
206 3. When an SMTP error message is specified in a "message" modifier in an ACL,
207 or in a :fail: or :defer: message in a redirect router, Exim now checks the
208 start of the message for an SMTP error code.
209
210 4. There is a new parameter for LDAP lookups called "referrals", which takes
211 one of the settings "follow" (the default) or "nofollow".
212
213 5. Version 20070721.2 of exipick now included, offering these new options:
214 --reverse
215 After all other sorting options have bee processed, reverse order
216 before displaying messages (-R is synonym).
217 --random
218 Randomize order of matching messages before displaying.
219 --size
220 Instead of displaying the matching messages, display the sum
221 of their sizes.
222 --sort <variable>[,<variable>...]
223 Before displaying matching messages, sort the messages according to
224 each messages value for each variable.
225 --not
226 Negate the value for every test (returns inverse output from the
227 same criteria without --not).
228
229
230 Version 4.62
231 ------------
232
233 1. The ${readsocket expansion item now supports Internet domain sockets as well
234 as Unix domain sockets. If the first argument begins "inet:", it must be of
235 the form "inet:host:port". The port is mandatory; it may be a number or the
236 name of a TCP port in /etc/services. The host may be a name, or it may be an
237 IP address. An ip address may optionally be enclosed in square brackets.
238 This is best for IPv6 addresses. For example:
239
240 ${readsocket{inet:[::1]:1234}{<request data>}...
241
242 Only a single host name may be given, but if looking it up yield more than
243 one IP address, they are each tried in turn until a connection is made. Once
244 a connection has been made, the behaviour is as for ${readsocket with a Unix
245 domain socket.
246
247 2. If a redirect router sets up file or pipe deliveries for more than one
248 incoming address, and the relevant transport has batch_max set greater than
249 one, a batch delivery now occurs.
250
251 3. The appendfile transport has a new option called maildirfolder_create_regex.
252 Its value is a regular expression. For a maildir delivery, this is matched
253 against the maildir directory; if it matches, Exim ensures that a
254 maildirfolder file is created alongside the new, cur, and tmp directories.
255
256
257 Version 4.61
258 ------------
259
260 The documentation is up-to-date for the 4.61 release. Major new features since
261 the 4.60 release are:
262
263 . An option called disable_ipv6, to disable the use of IPv6 completely.
264
265 . An increase in the number of ACL variables to 20 of each type.
266
267 . A change to use $auth1, $auth2, and $auth3 in authenticators instead of $1,
268 $2, $3, (though those are still set) because the numeric variables get used
269 for other things in complicated expansions.
270
271 . The default for rfc1413_query_timeout has been changed from 30s to 5s.
272
273 . It is possible to use setclassresources() on some BSD OS to control the
274 resources used in pipe deliveries.
275
276 . A new ACL modifier called add_header, which can be used with any verb.
277
278 . More errors are detectable in retry rules.
279
280 There are a number of other additions too.
281
282
283 Version 4.60
284 ------------
285
286 The documentation is up-to-date for the 4.60 release. Major new features since
287 the 4.50 release are:
288
289 . Support for SQLite.
290
291 . Support for IGNOREQUOTA in LMTP.
292
293 . Extensions to the "submission mode" features.
294
295 . Support for Client SMTP Authorization (CSA).
296
297 . Support for ratelimiting hosts and users.
298
299 . New expansion items to help with the BATV "prvs" scheme.
300
301 . A "match_ip" condition, that matches an IP address against a list.
302
303 There are many more minor changes.
304
305 ****