/ [mailfromd] / trunk / ChangeLog
To checkout: svn checkout http://svn.gnu.org.ua/sources/mailfromd/trunk/ChangeLog
Puszcza

Contents of /trunk/ChangeLog

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1779 - (show annotations)
Thu Mar 12 21:55:08 2009 UTC (12 years, 6 months ago) by gray
File size: 203839 byte(s)
Fix the current_message function and subprocess handling in mtasim.

* mtasim/mtasim.c (stop_mailfromd): Wait for the mailfromd child
to terminate and analyze its return status.

* mfd/bi_msg.m4 (bi_drop_current_message): New function.
* mfd/prog.c (env_capture_start): Call bi_drop_current_message if
the capture stream already exists (i.e. when starting processing
2nd or later message in a session).
* mfd/msg.h (bi_drop_current_message): New prototype.
* gacopyz/server.c (srv_connect): Retry attempts to connect
if they fail with ECONNREFUSED. Implement 5-second timeout.

* tests/testsuite.at (MAILFROMD_OPTIONS): New define.
(AT_MTA_TEST): Pass MAILFROMD_OPTIONS to mtasim invocation.
(AT_WITH_MAILFROMD_OPTIONS): New macro.
Include curmsg.at.
* tests/curmsg.at: New file
* tests/etc/Makefile.am (RCFILES): Add size.rc
* tests/etc/size.rc: New file

1 2009-03-12 Sergey Poznyakoff <gray@gnu.org.ua>
2
3 Fix the current_message function and subprocess handling in mtasim.
4
5 * mtasim/mtasim.c (stop_mailfromd): Wait for the mailfromd child
6 to terminate and analyze its return status.
7
8 * mfd/bi_msg.m4 (bi_drop_current_message): New function.
9 * mfd/prog.c (env_capture_start): Call bi_drop_current_message if
10 the capture stream already exists (i.e. when starting processing
11 2nd or later message in a session).
12 * mfd/msg.h (bi_drop_current_message): New prototype.
13 * gacopyz/server.c (srv_connect): Retry attempts to connect
14 if they fail with ECONNREFUSED. Implement 5-second timeout.
15
16 * tests/testsuite.at (MAILFROMD_OPTIONS): New define.
17 (AT_MTA_TEST): Pass MAILFROMD_OPTIONS to mtasim invocation.
18 (AT_WITH_MAILFROMD_OPTIONS): New macro.
19 Include curmsg.at.
20 * tests/curmsg.at: New file
21 * tests/etc/Makefile.am (RCFILES): Add size.rc
22 * tests/etc/size.rc: New file
23
24 2009-03-10 Sergey Poznyakoff <gray@gnu.org.ua>
25
26 * mfd/prog.c (env_capture_start): Do not create the stream if it
27 already exists. Bug reported by Con Tassios.
28 * mfd/bi_sieve.m4 (sieve): Don't free unexistend Sieve machines.
29 * THANKS: Update
30 * NEWS: Update
31
32 2009-02-20 Sergey Poznyakoff <gray@mirddin.farlep.net>
33
34 * mfd/bi_io.m4 (write): Fix spurious runtime exceptions, raised if
35 the third argument was not given.
36
37 2009-02-20 Sergey Poznyakoff <gray@gnu.org.ua>
38
39 * mfd/engine.c (concat_args): Do not print debugging info, it is
40 done by the caller.
41 (mlfi_envfrom, mlfi_envrcpt): Include argv[0] in the debugging
42 info. This complements the yesterday's change.
43
44 2009-02-19 Sergey Poznyakoff <gray@gnu.org.ua>
45
46 * mfd/engine.c (mlfi_envfrom, mlfi_envrcpt): Fix second argument,
47 so that it does not include $1.
48 * THANKS: Update.
49 * mflib/sa.mf (sa_format_report_header): Improve formatting.
50
51 2009-02-18 Sergey Poznyakoff <gray@mirddin.farlep.net>
52
53 * mfd/gram.y (state_parms): Fix number of arguments to
54 envfrom and envrcpt. Bug reported by Patrick Dalais
55 <patrick AT depari.co.za>.
56
57 * tests/fromargs.at, tests/rcptargs.at: New tests.
58 * tests/testsuite.at, tests/Makefile.am: Add new tests.
59 * tests/etc/ack.rc: Increase stack allocation.
60
61 2008-12-26 Sergey Poznyakoff <gray@gnu.org.ua>
62
63 Version 5.0
64
65 * configure.ac, NEWS: Version 5.0.
66 * doc/mailfromd.texi, doc/pies.texi, doc/pmult.texi: Update.
67 * doc/Makefile.am (check-builtins): Account for
68 MF_DEFUN_VARARGS_NO_PROM.
69
70 2008-12-16 Sergey Poznyakoff <gray@gnu.org.ua>
71
72 Fix sprintf, accidentally broken on 2008-07-14.
73
74 * mfd/symtab.c (va_builtin_install): Initialize flags to 0.
75 (va_builtin_install_ex): Remove capture and varargs, replace them
76 with flags.
77 * mfd/snarf.m4 (__mf_defun,MF_DEFUN_VARARGS): Reflect changes to
78 va_builtin_install_ex.
79 (MF_DEFUN_VARARGS_NO_PROM): New defun.
80 * mfd/gram.y (cast_arg_list): Add 4th argument, controlling
81 argument type promotion.
82 * mfd/drivers.c (code_type_builtin): Use builtin.flags.
83 * mfd/mailfromd.h (MFD_BUILTIN_*): New defines.
84 (struct builtin): Remove capture and varargs, replace them
85 with flags.
86 * mfd/bi_sprintf.m4: Define sprintf as MF_DEFUN_VARARGS_NO_PROM.
87
88 2008-12-01 Sergey Poznyakoff <gray@gnu.org.ua>
89
90 Documentation and minor fixes.
91
92 * pies/pies.c, pies/progman.c, pies/meta1gram.y, pies/pies.h,
93 pies/meta1lex.l: Normalize output redirection terminology, fix the
94 debug levels.
95 * pmult/pmult.c: Fix error message
96 * doc/pies.texi: Document the configuration.
97
98 2008-11-28 Sergey Poznyakoff <gray@gnu.org.ua>
99
100 * mfd/engine.c, mfd/gram.y, mfd/mailfromd.h, mfd/prog.c,
101 mfd/prog.h, gacopyz/gacopyz.h, gacopyz/context.c,
102 gacopyz/gacopyz.c: Add const qualifiers to gacopyz_getsymval,
103 gacopyz_replace_body and derived functions.
104
105 Emulate Sendmail behavior for SMFIR_REPLBODY.
106
107 * pmult/pmult.c (struct pmult_priv_data): New members hdrbuf and
108 body_itr. Remove body_off.
109 (pmult_append_body_chunk): Set bucket size to PMILTER_CHUNK_SIZE.
110 (pmult_clear): Free new pmult_priv_data members.
111 (pmult_free): Call pmult_clear first.
112 (pmult_eom): Initialize pmult_priv_data members for eventual body
113 replacement.
114 (pmult_msg_rplc): First send headers, then body.
115
116 2008-11-25 Sergey Poznyakoff <gray@gnu.org.ua>
117
118 Initial implementation of body replacement.
119
120 * mfd/engine.c (run_msgmod): Handle body_repl
121 * mfd/gram.y (msgmod_opcode_str): Likewise.
122 * mfd/mailfromd.h (enum msgmod_opcode): New constant body_repl.
123 * mfd/bi_body.m4 (replbody): New function (proof-of-concept).
124
125 * pmult/pmult.c (struct pmult_priv_data): New fields body_off,
126 body_chunks.
127 (pmult_append_body_chunk): New function.
128 (cb_reply): Handle SMFIR_REPLBODY
129 (pmult_std_reply): Likewise.
130 (pmult_clear): Destroy body_chunks
131 (pmult_eom): Request body replacement if body_chunks is not NULL.
132 (pmult_msg_rplc,pmult_msg_rplc_stat): New functions.
133 (pmilter): Register pmult_msg_rplc and pmult_msg_rplc_stat.
134
135 2008-11-21 Sergey Poznyakoff <gray@gnu.org.ua>
136
137 * pies/pies.c (component_cfg_param): New statement settle-timeout.
138 * pies/progman.c (recompute_alarm): New static;
139 (prog_start): Start the component only if all of its prerequisites
140 are running.
141 (progman_recompute_alarm): New function.
142 (progman_start): Reset recompute_alarm to 0.
143 (check_stopping): New function.
144 (progman_wake_sleeping): Handle also status_stopping and
145 status_enabled. Recompute alarm before leaving.
146 (prog_start_prerequisites): Return 0 or 1 depending on whether all
147 prerequisites have been started.
148 (prog_stop): Raise recompute_alarm for stopping components.
149 (progman_cleanup): Force status_enabled before attepmting to
150 start a component.
151 (progman_cleanup): Add a \n after debugging message.
152 Run progman_wake_sleeping unlsess expect_term is set.
153 * pies/meta1gram.y (translate_node_list): Force settle-timeout =
154 1.
155 * pies/pies.h (struct component.settle_timeout): New member.
156
157 * pies/pies.c (main): New options --force, --dump-prereq and
158 --dump-depmap.
159 Refuse to start if another instance is already running.
160 (pies_check_status): New function.
161 (pies_status): Rewrite using pies_check_status.
162 * pies/progman.c (component_fixup_depend): Bugfix: move
163 mu_list_append off the conditional.
164 (progman_dump_prereq, progman_dump_depmap): New functions.
165 * pies/meta1gram.y (yyerror): Return 0.
166 * pies/pies.h (progman_dump_prereq, progman_dump_depmap): New
167 protos.
168 (meta1_parser_set_debug, meta1lex, meta1error)
169 (meta1parse): Likewise.
170
171 * pies/progman.c (print_dep): New function.
172 (progman_build_depmap): Call print_dep to facilitate fixing cyclic
173 dependencies.
174 (prog_start_prerequisites): Fix debugging output.
175 Remove spurious second loop (was it a typo or copy-paste
176 leftover?)
177 (prog_stop_dependents): Fix debugging output.
178 (progman_dump_stats): Avoid race conditions between running and
179 querying instances.
180
181 2008-11-17 Sergey Poznyakoff <gray@gnu.org.ua>
182
183 Document and improve pmult.
184
185 * pmult/pmult.c (debug_level): Remove.
186 (struct pmult_priv_data): Remove debug. Use pmult_debug instead.
187 (macro_trans): Define Sendmail compatibility macros cn_issuer and
188 cn_subject.
189 (builtin_macros): Fix typo in "multiplexer".
190 (define_macros): Rewrite. The "define-macros" statement takes
191 exactly two arguments, each of which can be either a string or a
192 list of strings.
193 * doc/values.texi, doc/mailfromd.texi, doc/pmult.texi: Update.
194
195 * doc/Makefile.am (check-fixmes): Scan all texinfo documents.
196
197 Fix handling of retranslators.
198
199 * pies/pies.c (main): Call progman_build_depmap and
200 progman_create_sockets before starting up components.
201 * pies/progman.c (struct prog): New member `retr'.
202 (destroy_prog): New function.
203 (retr_tag): Change signature. Fix erroneous condition for
204 xalloc_die.
205 (register_retr): Return prog. Make static. Initialize idx
206 with -1.
207 (update_retr): Register retranslator, if necessary.
208 (progman_register_retranslators): Remove.
209 (register_prog0): 2nd argument: index.
210 (register_prog): Do not create socket at once.
211 (prog_start): Remove debugging fprintf.
212 (progman_accept): Update call to register_prog0.
213 (progman_create_sockets): New function.
214 (progman_start): Remove calls to progman_register_retranslators
215 and progman_build_depmap. They must be done only once.
216 (prog_stop_retranslators): New function.
217 (prog_stop_dependents): Call prog_stop_retranslators.
218 (progman_cleanup): Remove dangling retranslators.
219 * pies/pies.h (progman_create_sockets): New prototype.
220
221 2008-11-16 Sergey Poznyakoff <gray@gnu.org.ua>
222
223 Improve pies.
224
225 * pies/pies.h (create_socket): Change proto to 3 arguments.
226 * pies/socket.c (create_socket): Take two additional arguments.
227 Allow to configure ownership and mode of created UNIX sockets.
228 * pies/progman.c (register_prog, prog_start): Update calls to
229 create_socket.
230
231 Implement ctype functions.
232
233 * mfd/bi_ctype.m4: New function.
234 * mfd/Makefile.am (inc_DATA): Add bi_ctype.m4.
235 * doc/Makefile.am (check-builtins): Update source sed expression.
236 * doc/mailfromd.texi, NEWS: Document ctype functions.
237
238 2008-11-15 Sergey Poznyakoff <gray@gnu.org.ua>
239
240 Improve handling of program privileges.
241
242 * lib/libmf.h (struct mf_privs): New data type.
243 (get_user_groups, mf_priv_setup, mf_epriv_setup): New prototypes.
244 * lib/userprivs.c (get_user_groups, mf_priv_setup)
245 (mf_epriv_setup): New functions.
246
247 * smap/smap.c: If user is specified, switch to effective uid/gid,
248 in order for msrv to create files with right privileges, on one
249 hand, and to be able to create pidfile in root-owned directories
250 (e.g. /var/run), on the other hand. This requires todays snapshot
251 of Mailutils.
252
253 * pies/pies.h (struct pies_privs_data): Remove
254 (struct component): Change type of `privs' to struct mf_privs.
255 (priv_setup): Remove.
256 * pies/pies.c: Use mf_priv* stuff to manipulate privileges.
257 * pies/progman.c: Likewise.
258 * pies/meta1gram.y (list): allow for trailing comma.
259
260 2008-11-13 Sergey Poznyakoff <gray@gnu.org.ua>
261
262 Bugfix.
263
264 * mfd/bi_string.m4 (index) (rindex): Third argument (start index)
265 can equal string length.
266 * pies/Makefile.am (LDADD): Add MF_PROCTITLE_LIBS
267 * lib/proctitle.c (mf_proctitle_format):
268 * pies/progman.c (progman_register_retranslators): Register
269 retranslators only for retr_syslog.
270 (open_retranslator): Do not prepend program name to the proctitle.
271 It is done automatically by the library.
272 * lib/proctitle.c: Declare environ.
273 Define __progname if not defined in libc.
274 (mf_proctitle_init): Set __progname.
275 (mf_proctitle_format): Prepend program name to the proctitle.
276
277 Implement file output redirection.
278
279 * pies/pies.h (enum retr_type): New constants.
280 (struct retranslator): New type.
281 (struct component): Change type of retr to struct retranslator.
282 All uses updated.
283 * pies/pies.c (_cb_retr): Takes two arguments:
284 redirection type and file name or syslog priority.
285 (make_full_name): New function.
286 (component_verify): Check retr file names.
287 * pies/progman.c (redirect_to_file): New function.
288 (open_retranslator): Handle file redirects.
289 (prog_start): Open /dev/null in wronly mode.
290 * pies/meta1gram.y (create_retr_node): New function.
291 (translate_node_list): Create default "stderr" statement.
292
293 * lib/libmf.h (mf_proctitle_init): New prototype.
294 * lib/proctitle.c: Include stdio.h
295 * bootstrap: Fix invocation of aclocal.
296
297 Implement setproctitle functionality for pies.
298
299 * am: New directory.
300 * am/aggr.m4, am/debug.m4: New files (from acinclude.m4)
301 * am/proctitle.m4: New file.
302 * acinclude.m4: Removed.
303 * configure.ac: Call MF_PROCTITLE.
304 * lib/libmf.h (mf_proctitle_format): New prototype.
305 * lib/proctitle.c: New file.
306 * lib/Makefile.am (libmf_a_SOURCES): Add proctitle.c.
307 * Makefile.am (ACLOCAL_AMFLAGS): Add -I am
308
309 * pies/pies.c (main): Call mf_proctitle_init.
310 * pies/progman.c (retr_tag): Rewrite in a safer way.
311 (open_retranslator): Set program title in child.
312
313 Allow to complement existing components (useful for MeTA1
314 includes).
315
316 * pies/pies.c (component_verify): New function.
317 (component_section_parser): Call component_verify.
318 (_cm_include_meta1): Reduce the tree at once.
319 (parse_meta1_conf): Not needed any more.
320 * pies/progman.c (progman_register_retranslators): New function.
321 (pies/progman.c): Do not register retranslators: wait until the
322 entire config is parsed and do that in progman_start.
323 (progman_start): Call progman_register_retranslators.
324
325 2008-11-12 Sergey Poznyakoff <gray@gnu.org.ua>
326
327 Implement dependencies/prerequisites in MeTA1.
328
329 * pies/pies.c (component_cfg_param): Rename "depend" to
330 "prerequisites". Add new keyword "dependents".
331 (pies_cfg_param): New keyword "limits".
332 * pies/progman.c (struct prog): Rename "depend" to "prereq".
333 (prog_start_dependencies): Rename to prog_start_prerequisites
334 (register_prog0): Do not fill prereq. This will be done later,
335 when all dependencies are resolved.
336 (prog_rebuild_prerequisites): New function.
337 (prog_start): Per-component limitis override system-wide ones.
338 (component_fixup_depend, fixup_prerequisites)
339 (rebuild_prerequisites): New functions.
340 (progman_build_depmap): Call fixup_prerequisites and
341 rebuild_prerequisites.
342 (prog_stop_dependent): Rename to prog_stop_dependents.
343 * pies/meta1gram.y: Implement restart_dependencies.
344 * pies/pies.h (struct component): Rename "depend" to "prereq". Add
345 new member "depend".
346 (pies_limits): New extern.
347
348 Implement MeTA1 configuration file parser.
349
350 * configure.ac: Require Mailutils 1.9.93
351 * doc/mailfromd.texi, NEWS: Update.
352 * pies/pies.c (_cb_depend): Accept list argument.
353 (component_cfg_param): New statement: program.
354 (pies_cfg_param): New statements: include-meta1 and
355 meta1-queue-dir.
356 (parse_meta1_conf, pies_cfg_verifier): New functions.
357 (main): Set mu_app_cfg_verifier. Call parse_meta1_conf.
358 * pies/progman.c (progman_lookup_component): New function.
359 (prog_start): Pass program name (eventually differing from
360 argv[0]).
361 * pies/pies.h (struct component): New member `program'.
362 (progman_lookup_component): New prototype.
363 * pies/meta1gram.y, pies/meta1lex.h, pies/meta1lex.l: New files.
364 * pies/Makefile.am (pies_SOURCES): Add meta1gram.y and
365 pies/meta1lex.h.
366 (noinst_HEADERS, AM_YFLAGS, AM_LFLAGS): New variables.
367
368 2008-11-11 Sergey Poznyakoff <gray@gnu.org.ua>
369
370 * pies/pies.c (component_cfg_param, pies_cfg_param): New keyword:
371 allgroups.
372 (pies_add_allgroups): New function.
373 * pies/limits.c: Fix debug statements.
374 * pies/progman.c (build_depmap): Rename to
375 progman_build_depmap. Make extern, for future use. All callers
376 updated.
377 * pies/pies.h (progman_build_depmap): New proto.
378
379 * pies/pies.c: Fix ACTION_COMPRELOAD
380 * pies/progman.c (open_retranslator): (child) close all open
381 sockets, except p[0] (pipe input).
382 (prog_start): Bugfix: mark sleeping components with
383 status_sleeping.
384 (prog_start): stdout retranslation works for pies_comp_pass_fd.
385 Mark started processes with status_enabled.
386 (progman_start): Start enabled processes if pid is 0.
387 (progman_stop_component): Correctly handle various status types.
388 (progman_dump_stats): Mark processes being stopped.
389
390 * pies/pies.c (component_cfg_param): Bugfix.
391 (component_section_parser): Initialize comp->pass_fd_socket
392 * pies/progman.c (prog_start): Listen on the socket, if in pass_fd
393 mode. Avoid closing it.
394 (prog_stop_all): Kill programs being stopped.
395
396 * pies/socket.c (pass_fd): Check return from open_unix_socket.
397
398 2008-11-10 Sergey Poznyakoff <gray@gnu.org.ua>
399
400 Rewrite pies to incorporate into it the functionality of inetd and
401 mcp.
402
403 * pies/pies.c (pmult_debug): Rename to pies_debug.
404 (pies_acl): New global.
405 (component_cfg_param): New statements: mode, socket,
406 pass-fd-socket, acl, limits.
407 (component_section_parser): Allocate comp. Check its consistency
408 on mu_cfg_section_end.
409 (pies_cfg_param): New statement: acl.
410 (main): Call mu_acl_cfg_init. Use pies_pause instead of pause.
411 * pies/limits.c: New file.
412 * pies/progman.c (enum prog_status): New status: status_listener.
413 (struct prog): Keep a pointer to the original struct component,
414 instead of copying its fields (except for depend, which is copied
415 anyway). All uses updated.
416 (prog_lookup_by_socket, unlink_prog, register_prog0): New
417 functions.
418 (prog_start, progman_cleanup, progman_stop_component): Rewrite to
419 take into account various component modes.
420 (pies_check_acl): New function.
421 (progman_accept): New function.
422 * pies/pies.h (limits_record_t): New typedef.
423 (enum pies_comp_mode): New constants.
424 (struct component): New members: mode, limits, socket_url,
425 pass_fd_socket, acl.
426 (progman_accept): New proto.
427 (pies_pause, register_listener, pass_fd, open_socket)
428 (parse_limits, set_limits): New protos.
429 * pies/Makefile.am (pies_SOURCES): Add limits.c and socket.c
430 * pies/socket.c: New file.
431
432 * configure.ac: Check for msg_control and msg_accrights in struct
433 msghdr.
434 * acinclude.m4 (IU_CHECK_MEMBER, IU_CHECK_MEMBERS): New macros
435 (from inetutils).
436
437 * pies/progman.c (prog_start): Bugfix.
438 * pmult/pmult.c (pmult_cfg_param): New configuration statement
439 pmilter-debug.
440 (main): Call sm_pmfi_setdbg.
441
442 2008-11-09 Sergey Poznyakoff <gray@gnu.org.ua>
443
444 Add built-in functions for accessing Sendmail macros.
445
446 * mfd/mailfromd.h (env_get_macro): New proto.
447 * mfd/prog.c (env_get_macro): New function.
448 * mfd/bi_macro.m4: New file.
449 * mfd/Makefile.am (M4_FILES): Add bi_macro.m4.
450 * NEWS: Update.
451 * doc/mailfromd.texi (Macro access): New subsubsection.
452
453 2008-11-07 Sergey Poznyakoff <gray@gnu.org.ua>
454
455 * mfd/bi_mbox.m4 (mailbox_open): Take 2nd optional argument,
456 specifying the permissions of the mailbox, if it is to be created.
457 * doc/mailfromd.texi, NEWS: Update.
458
459 2008-11-06 Sergey Poznyakoff <gray@gnu.org.ua>
460
461 * pmult/pmult.c (collect_headers): Rewrite state machine to ensure
462 each state either advances off or switches to the new state.
463 (builtin_macros): New variable.
464 (translate_macros0): Add builtin macros.
465 (pmult_connect): Do not free priv_data even if some milters
466 returned rejects.
467
468 2008-11-05 Sergey Poznyakoff <gray@gnu.org.ua>
469
470 * mfd/lex.l: Fix default condition for ML state, introduced on
471 2008-11-02.
472
473 2008-11-03 Sergey Poznyakoff <gray@gnu.org.ua>
474
475 * mflib/verp.mf (verp_extract_user): Pass email as the first
476 argument.
477 * doc/mailfromd.texi: Update.
478 * doc/Makefile.am: Add pmult.texi
479 * doc/pmult.texi: New file.
480 * mfd/lex.l: %% and $$ in quoted strings are replaced by single %
481 and $, correspondingly.
482 * NEWS: Update.
483
484 Improve docs.
485
486 * doc/mailfromd.texi, NEWS: Document `getopt' and run (script)
487 mode.
488 * mfd/lex.l: Octal characters can contain 1 to 3 octal characters.
489 * mfd/bi_getopt.m4: Allow to specify long options (without short
490 option equivalents) that take arguments.
491 * mfd/main.c (options): Document optional argument to the `--run'
492 option.
493
494 2008-11-02 Sergey Poznyakoff <gray@gnu.org.ua>
495
496 Minor improvement in the lexer.
497
498 * mfd/lex.l (start_locus): New variable.
499 (BEGIN_X): New macro.
500 Add a rule to ignore any characters at EOF in ML state.
501 (yywrap): Report an error if the file is left not in the INITIAL
502 state, i.e. EOFs in comments or strings.
503
504 Improve the docs.
505
506 * doc/mailfromd.texi, NEWS: Update.
507
508 Minor fix.
509
510 * mfd/drivers.c (mark_type_asgn): Mark variable as referenced if
511 it is assigned a value.
512
513 Get rid of ml_header. Gacopyz takes care about the header
514 formatting.
515
516 * gacopyz/gacopyz.h (gacopyz_safe_header_value): New proto.
517 * gacopyz/gacopyz.c (gacopyz_safe_header_value): New function.
518 (gacopyz_header_command): Use gacopyz_safe_header_value to format
519 header value.
520 * mfd/bi_sa.m4 (sa): Remove unused variable.
521 * mfd/bi_string.m4: Remove ml_header.
522 * doc/mailfromd.texi: Remove ml_header.
523
524 New functions: replstr, ml_header, sa_format_score,
525 sa_format_report_header.
526
527 * mflib/sa.mf: New file.
528 * mflib/Makefile.am (inc_DATA): Add sa.mf
529 * mfd/bi_string.m4 (replstr): New function.
530
531 * doc/mailfromd.texi: Document new functions.
532 * NEWS: Update.
533
534 2008-11-01 Sergey Poznyakoff <gray@gnu.org.ua>
535
536 * mfd/bi_string.m4 (rindex): Fix bug introduced on 2008-10-29.
537
538 Implement spamd REPORT in sa.
539
540 * mfd/snarf.m4 (MF_OBSTACK_FINISH): New macro.
541 * mfd/bi_string.m4 (ml_header): New function.
542 * mfd/bi_sa.m4 (spamd_read_line0): New function.
543 (spamd_read_line): Remove last argument. Use spamd_read_line0.
544 (sa): Take a 3rd optional argument, specirying whether to
545 return spam report in sa_keywords.
546
547 Bugfix.
548
549 * mfd/gram.y (ADD,REPLACE): Cast 2nd argument to string.
550 * mfd/bi_system.m4 (strftime): Add missing MF_OPTVAL.
551
552 2008-10-31 Sergey Poznyakoff <gray@gnu.org.ua>
553
554 * pmult/pmult.c (pmult_eom): Get macros from PM_SMST_DOT list.
555
556 * gnulib.modules: Add inttostr
557 * smap/smap.c, pies/progman.c, pies/pies.h: Use umaxtostr, instead
558 of mu_umaxtostr.
559
560 * pmult/pmult.c (struct pmult_priv_data): New members: argc,
561 argv.
562 (macro_trans, meta_stage_trans, macrotab, macronames): New
563 globals.
564 (translate_macros0, translate_macros): New functions.
565 (define_macros, define_macros_iter): New functions.
566 (_cb_define, request_auth_macros): New functions.
567 (pmult_cfg_param): New keyword `define-macro'.
568 (pmult_free): Free argv.
569 (pmult_negotiate): Use sm_pmfi_setmacs, if available.
570 (pmult_connect, pmult_helo, pmult_mail, pmult_rcpt)
571 (pmult_data, process_headers, pmult_eom): Use translate_macros.
572 (main): Handle want_auth_macros.
573
574 * configure.ac: Check for sm_pmfi_setmacs. This function should
575 appear in meta1-1.0.PreAlpha28.0.
576
577 2008-10-30 Sergey Poznyakoff <gray@gnu.org.ua>
578
579 * pmult/pmult.c (collect_headers): Bugfix, following changes
580 dated 2008-10-14.
581
582 2008-10-29 Sergey Poznyakoff <gray@gnu.org.ua>
583
584 * mfd/bi_string.m4 (index, rindex): Take an optional third
585 argument, indicating where to start searching.
586 * NEWS, doc/mailfromd.texi: Document changes to index and rindex.
587
588 2008-10-27 Sergey Poznyakoff <gray@gnu.org.ua>
589
590 * pmult/pmult.c (pmult_std_reply): Handle SMFIR_ACCEPT.
591 * configure.ac, NEWS: Raise version patchlevel to 96
592 * mfd/drivers.c (mark_type_asgn): Add a comment.
593 * mfd/main.c (main): Do not try to start up if script_dump_xref
594 was given.
595
596 2008-10-24 Sergey Poznyakoff <gray@gnu.org.ua>
597
598 * mflib/verp.mf: New file.
599 * mflib/Makefile.am: Add verp.mf.
600
601 2008-10-22 Sergey Poznyakoff <gray@gnu.org.ua>
602
603 * gacopyz/server.c (gacopyz_srv_abort): Reset state to srv_ready.
604 (gacopyz_srv_helo): If called in srv_msgproc, reset the milter
605 state by calling gacopyz_srv_abort before sending the command.
606 (gacopyz_srv_envfrom): Likewise.
607
608 2008-10-21 Sergey Poznyakoff <gray@gnu.org.ua>
609
610 * pmult/pmult.c: New configuration statement auth-macros.
611 (pmult_negotiate): Request auth macros for PM_SMST_MAIL if
612 auth-macros was requested.
613 (pmult_mail): Translate auth macros if present.
614
615 * gacopyz/server.c (gacopyz_srv_negotiate): Additional
616 diagnostics.
617 (gacopyz_srv_send_macros): Send macros only for those commands
618 that do require them.
619 (gacopyz_srv_send_command): Additional diagnostics.
620 * gacopyz/gacopyz.c (gacopyz_context_loop): Additional diagnostics.
621
622 2008-10-16 Sergey Poznyakoff <gray@gnu.org.ua>
623
624 * pmult/pmult.c (_cb_log_level): Handle > level specifier (all
625 levels from the given one up).
626 * gacopyz/gacopyz.h (SMI_LOG_FROM): Handle n==0.
627
628 2008-10-15 Sergey Poznyakoff <gray@gnu.org.ua>
629
630 * pies/progman.c (env_setup): Port new implementation from Rush.
631
632 * gnulib.modules: Add c-ctype
633 * mtasim/mtasim.c, pies/pies.h, pmult/pmult.c, lib/parsetime.c,
634 mfd/lex.l, mfd/gram.y, mfd/mailfromd.h, mfd/spf.c,
635 mfd/bi_sprintf.m4, mfd/bi_io.m4, mfd/pp.c, mfd/main.c: Use c-ctype,
636 instead of ctype.
637
638 2008-10-14 Sergey Poznyakoff <gray@gnu.org.ua>
639
640 * pmult/pmult.c (enum pmult_msg_state): Add more states.
641 (collect_headers): Correctly handle end-of-message marker,
642 even though it should never appear here.
643 (pmult_msg_handler): Make sure the handler always processes first
644 handlers, then body, even if some of these two is missing.
645
646 2008-10-13 Sergey Poznyakoff <gray@gnu.org.ua>
647
648 * gacopyz/server.c (gacopyz_srv_eom): Reset state to srv_ready.
649
650 * mfd/engine.c (mlfi_eom): Destroy md->hdr.
651 * pmult/pmult.c: Fix comment.
652 * NEWS: Update.
653
654 2008-10-06 Sergey Poznyakoff <gray@gnu.org.ua>
655
656 * mfd/main.c (read_domain_file): Select first word from each
657 line. This allows to use meta1/mt.
658
659 2008-10-04 Sergey Poznyakoff <gray@gnu.org.ua>
660
661 * pies/pies.c (component_cfg_param): New configuration statement
662 `precious'.
663 * pies/progman.c (struct prog): New member `precious'.
664 (register_prog): Set precious.
665 (prog_start_dependencies): Do not mark disabled precious
666 dependencies of a disabled component.
667 * pies/pies.h (pies/pies.h): New member `precious'.
668 * pies/pies.rcin (mcp): Mark as precious.
669
670 * pies/pies.c (return_code_section_parser): Fix to work with tag
671 of any type.
672 * pies/pies.rcin: Minor change.
673
674 * configure.ac, NEWS: Raise version number to 4.9.95.
675
676 * pies/pies.c (main): Do cleanup after main action processing and
677 only if action == ACTION_CONT.
678 * pies/progman.c (struct prog): New member `prev'.
679 (link_prog): Maintain doubly-linked list.
680 (prog_stop_dependent): Avoid printing diagnostics if there are
681 no dependencies to be stopped.
682 (prog_stop): Do nothing if prog->pid is zero.
683 Do not call prog_stop_dependent, it will be done by
684 progman_cleanup.
685 (prog_stop_all): Terminate components from last to first.
686 * pies/pies.rcin: Improve example, by adding mcp component.
687
688 * pies/pies.c (_cb_depend): Handle single string value.
689 (_cb_retr): Fix diagnostic message.
690 (_cb_facility): New function.
691 (component_cfg_param): New statement `facility'.
692 (component_section_parser): Initialize comp.facility to the
693 default value.
694 * pies/progman.c (struct prog): New member `facility'.
695 (register_prog): Initialize facility.
696 (open_retranslator): Use master->facility.
697 * pies/pies.h (struct component): New member `facility'.
698
699 2008-10-03 Sergey Poznyakoff <gray@gnu.org.ua>
700
701 * pies/progman.c (register_prog): Remove stray semicolon.
702 (retr_exit): Use _exit.
703 (prog_stop_dependent): Bugfix: stop retranlators as well as
704 components.
705
706 2008-09-29 Sergey Poznyakoff <gray@gnu.org.ua>
707
708 * configure.ac, NEWS: Set patchlevel 94.
709
710 Fix MU configuration file support.
711
712 * lib/libmf.h (config_array_to_argv)
713 (config_array_to_string, config_cb_timeout): new prototypes.
714 * lib/utils.c: New
715 * lib/Makefile.am (libmf_a_SOURCES): Add utils.c
716 * mfd/gram.y (defer_initialize_variable): Both args are const.
717 * mfd/mailfromd.h (defer_initialize_variable)
718 (add_include_dir): Change signatures.
719 * mfd/pp.c (add_include_dir): Arg is const.
720 * pies/pies.c, pmult/pmult.c, mfd/main.c: Rewrite configuration
721 file support to match changes in Mailutils.
722
723 2008-09-20 Sergey Poznyakoff <gray@gnu.org.ua>
724
725 Improve stack memory management.
726
727 * mfd/gram.y (strtosize, get_stack_max, get_stack_incr)
728 (get_stack_size): New functions.
729 (pragma_stacksize): Rewrite. Take maximum stack size as an
730 optional third argument.
731 * mfd/mailfromd.h (stack_max_size): New declaration.
732 (stack_max_size): New function.
733 (expand_dataseg): Signal exception if new memory size would be
734 greater than the stack size limit.
735 * NEWS, doc/mailfromd.texi: Update.
736
737 2008-09-19 Sergey Poznyakoff <gray@gnu.org.ua>
738
739 * mfd/gram.y (pragma_stacksize): Implement two stack growth
740 policies.
741 * mfd/mailfromd.h (enum stack_expand_policy): New enum.
742 (stack_expand_incr, stack_expand_policy): New global variables.
743 * mfd/prog.c (stack_expand_incr)
744 (stack_expand_policy): New global variables.
745
746 * NEWS: Update.
747 * doc/mailfromd.texi (stacksize): Document changes to pragma
748 stacksize.
749 * doc/values.texi (STACK-INCR): New value.
750
751 2008-09-18 Sergey Poznyakoff <gray@gnu.org.ua>
752
753 * Makefile.am: Implement a dist-hook, preventing distributing
754 an unfinished NEWS file.
755 * doc/mailfromd.texi: Document new mfl-mode customization
756 variables.
757 Add missing index entries.
758 * NEWS: Update.
759 * elisp/mfl-mode.el: Improve auto-indentation support.
760 (mfl-compute-line-indentation): Fix typo.
761
762 2008-09-17 Sergey Poznyakoff <gray@gnu.org.ua>
763
764 * Makefile.am (dist-hook): New rule. Test for leftover FIXMEs in
765 NEWS.
766
767 * mfd/bi_getopt.m4 (opterr, optopt): New globals.
768 (getopt): Handle opterr and optopt.
769 (MF_INIT): Initialize opterr to 1.
770
771 * mfd/bi_getopt.m4 (getopt): Use | as a short/long option
772 separator.
773 Make sure optind/optarg are set before returning EOF.
774 * mfd/gram.y (mailfromd_run): Remove superfluous call to
775 env_leave_frame.
776 * mfd/drivers.c (mark_type_argx, mark_type_vaptr): New functions.
777 * mfd/prog.c (env_vaptr): Cast the result.
778 * mfd/main.c (argpflag): Understand abbreviated forms of the --run
779 option.
780
781 * mfd/bi_db.m4 (dbfirst, dbnext, dbkey, dbvalue): New functions
782 (proof of concept).
783
784 2008-09-16 Sergey Poznyakoff <gray@gnu.org.ua>
785
786 Implement functions with variable number of arguments and 'run' mode.
787
788 * mfd/symtab.c (function_install): Take additional argument.
789 * mfd/lex.l: New tokens `vaptr', `...' and ARGX.
790 * mfd/snarf.m4 (MF_VASTRING): New define.
791 * mfd/gram.y: Handle functions with variable number of arguments,
792 $(expr), and vaptr() expressions. This raises shift/reduce
793 expectation to 29 conflicts.
794 (parmtype_function): Return dtype_string for
795 arguments from vararg list.
796 (FUNC_HIDDEN_ARGS): Return 1 if f->varargs is set.
797 (type_to_string): Handle pointer argument.
798 (function_call): Handle function->varargs.
799 (node_type): Handle node_type_argx, and node_type_vaptr.
800 (cast_arg_list): Handle variable number of arguments.
801 (cast_to): Handle dtype_pointer as dtype_number.
802 * mfd/drivers.c (argx, vaptr): New node types.
803 (code_type_call): Handle variable number of arguments.
804 (code_cast): Handle dtype_pointer as dtype_number.
805 * mfd/mailfromd.h (MAILFROMD_RUN): New define.
806 (struct argx_node): New type.
807 (struct node): Add argx_node.
808 (struct function): New member `varargs'.
809 (function_install): Add varargs.
810 (mailfromd_run): New prototype.
811 * mfd/prog.c (env_vaptr, env_get_reg): New functions.
812 (env_make_frame0): New function.
813 (instr_xmemstk): New instruction handler.
814 * mfd/opcodes (XMEMSTK): New opcode.
815 * mfd/prog.h (env_get_reg, env_vaptr): New protos.
816 * mfd/main.c (options): New option `--run'.
817 (main): Handle `run' mode.
818 * mfd/Makefile.am (M4_FILES): Add bi_getopt.m4.
819 * NEWS: Update.
820
821 2008-09-15 Sergey Poznyakoff <gray@gnu.org.ua>
822
823 * tests/alias.at: New file.
824 * tests/Makefile.am (TESTSUITE_AT): Add alias.at
825 * tests/testsuite.at: Add alias.at
826
827 * elisp/mfl-mode.el (mfl-next-line-indentation)
828 (mfl-find-line-indentation): Fix computations for `alias',
829 `returns' and for comment lines.
830 (mfl-returns-offset, mfl-comment-offset): New customization
831 variables.
832
833 * mflib/sav.mf: New file. Initial implementation of SAV functions
834 entirely in MFL.
835
836 * elisp/mfl-mode.el (mfl-mode): Make compile-command buffer-local.
837
838 * mfd/symtab.c (struct alias): New data type.
839 (union symentry): New member `alias'.
840 (lookup_or_install): Remove erroneous condition, introduced in
841 r1627 (branches/release_4_3_patches), which caused third
842 argument (install) to be ignored if SYM_BITS was set in state.
843 (function_install, function_lookup): Account for aliases.
844 (install_alias): New function.
845 * mfd/lex.l (alias): New keyword.
846 * mfd/gram.y: Allow to define function aliases.
847 * mfd/mailfromd.h (SYM_ALIAS): New define.
848 (install_alias): New proto.
849
850 * doc/mailfromd.texi: Document function aliases.
851 * doc/NEWS: Likewise.
852
853 * elisp/mfl-mode.el (mfl-mfd-command): Change command name.
854 (mfl-keywords): Add alias.
855
856 2008-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
857
858 * configure.ac: Version 4.9.93
859 * NEWS: Likewise.
860 * pies/pies.c: Change description.
861
862 2008-09-08 Sergey Poznyakoff <gray@gnu.org.ua>
863
864 * mfd/prog.c (instr_stkalloc): Expand stack segment if needed.
865
866 2008-08-17 Sergey Poznyakoff <gray@gnu.org.ua>
867
868 * mflib/pp-setup (_, N_): If used without arguments, insert
869 _ and N_ verbatim.
870 * README: Update.
871 * tests/Makefile.am (clean-local): Fix rule.
872 * configure.ac: Fix check for res_query.
873
874 * mfd/engine.c (mailfromd_daemon): Use mailfromd_umask instead of
875 a hardcoded value.
876 * mfd/mailfromd.h (mailfromd_umask): New prototype.
877 * mfd/main.c (mailfromd_umask): New variable.
878 * mfd/bi_system.m4 (umask): New built-in function.
879 * gacopyz/gacopyz.c (do_connect): Ensure umask 0117 when binding
880 the socket.
881
882 * doc/mailfromd.texi: Improve usage of @deffn.
883 (System functions): Document umask.
884
885 2008-07-04 Sergey Poznyakoff <gray@gnu.org.ua>
886
887 Implement mailbox_append_message built-in function.
888
889 * NEWS, doc/mailfromd.texi: Document mailbox_append_message.
890 Document new semantics of `a' and `a+' in mailbox_open.
891 * mfd/bi_msg.m4 (bi_message_from_descr): New function.
892 * mfd/bi_body.m4 (current_message): Fix return value.
893 * mfd/bi_mbox.m4 (mailbox_open): Discern between `a' and `a+'.
894 (mailbox_append_message): New function.
895 * mfd/msg.h (bi_message_from_descr): New prototype.
896
897 2008-06-26 Sergey Poznyakoff <gray@gnu.org.ua>
898
899 * pies/pies.h: Include stdint.h
900 * configure.ac: Fix checking for libresolv.
901
902 2008-06-22 Sergey Poznyakoff <gray@gnu.org.ua>
903
904 Minor fixes.
905
906 * doc/mailfromd.texi: Fix a typo.
907 * mfd/prog.c: Fix comment.
908 * gacopyz/server.c: Fix erroneous range checking condition.
909
910 2008-05-15 Sergey Poznyakoff <gray@gnu.org.ua>
911
912 Fixup C variables that point to dataseg after expanding it.
913 Bug reported by Sergey Afonin.
914
915 * mfd/snarf.m4 (mf_c_argdcl): Produce only C declarations.
916 (mf_c_arginit): New macro.
917 (__mf_c_argdcl_list,__mf_c_arginit_list): New auxiliary macros.
918 (__mf_c_arglist): Rewrite using the above macros.
919 (mf_c_arglist,MF_VA_ARG): Reflect changes to get_.*_arg functions.
920 * mfd/bi_sprintf.m4: Update invocations of MF_VA_ARG.
921 * mfd/prog.c (struct eval_environ): New members auto_ptr and
922 numautos.
923 (env_register_auto, env_unregister_autos, env_fixup_autos): New
924 functions.
925 (expand_dataseg): Call env_fixup_autos.
926 (get_literal, get_string_arg): Change signature. Call
927 env_register_auto. All callers updated.
928 (get_numeric_arg): Change signature for consistency with other
929 get_ functions. All callers updated.
930 (get_pointer_arg): New function.
931 (eval_environment): Call env_unregister_autos after running each
932 instruction.
933 * mfd/prog.h (get_pointer_arg): New function.
934 (get_string_arg, get_numeric_arg): Change prototypes.
935 * mfd/bi_sieve.m4: Minor stylistic fix.
936 * NEWS: Update.
937
938 * mfd/drivers.c (code_cast): Handle dtype_pointer
939
940 2008-04-13 Sergey Poznyakoff <gray@gnu.org.ua>
941
942 * configure.ac: Require Mailutils 1.9.90
943 * doc/mailfromd.texi: Update.
944 * mfd/bi_msg.m4 (message_size, message_body_size)
945 (message_header_size): New functions.
946 * NEWS: Update.
947
948 2008-04-05 Sergey Poznyakoff <gray@gnu.org.ua>
949
950 * mtasim/mtasim.c: New command line options --user and --group.
951 * doc/mailfromd.texi, doc/mtasim.texi, NEWS: Update.
952
953 Introduce MU interface functions.
954
955 * mfd/bi_msg.m4, mfd/bi_mbox.m4, mfd/msg.h: New files.
956 * mfd/Makefile.am: Add new files.
957 * mfd/bi_string.m4 (substring): 3rd argument can be negative.
958 * mfd/bi_body.m4 (current_message): New function.
959 * NEWS: Update.
960 * doc/mailfromd.texi: Update.
961
962 2008-04-02 Sergey Poznyakoff <gray@gnu.org.ua>
963
964 Add new MFL datatype `POINTER' and convert `body' handler to
965 take first argument of that type. Provide a function for
966 converting POINTER to STRING.
967
968 * mfd/Makefile.am (M4_FILES): Add bi_body.m4
969 * mfd/bi_body.m4: New file.
970
971 * mfd/engine.c (mlfi_body): Pass bodyp as a generic pointer.
972 * mfd/snarf.m4 (__mf_argtype, __mf_ctype, __mf_c_getarg)
973 (__mf_printf_type): Handle new data type POINTER.
974 * mfd/gram.y (state_parms): Change type of the first parameter
975 to body to dtype_pointer.
976 (cast_to): Handle dtype_pointer.
977 * mfd/mailfromd.h (data_type_t): New type dtype_pointer.
978 (env_push_pointer): New function.
979 * mfd/prog.c (env_push_pointer): New function.
980 * mfd/prog.h (get_pointer_arg): New macro.
981 * NEWS: Update.
982 * doc/mailfromd.texi: Document changes to prog body.
983
984 Bugfixes:
985
986 * mtasim/mtasim.c (get_input_line): Make sure the return line
987 always terminates with a newline.
988 (smtp): Remove erroneous break.
989 * mfd/symtab.c (variable_replace): Maintain correct value of
990 newvar->owner.
991 * mfd/pp.c (push_source): Prevent coredump on the first call.
992
993 2008-03-12 Sergey Poznyakoff <gray@gnu.org.ua>
994
995 * doc/Makefile.am (check-refs, check-fixmes): Print correct
996 locations for multiple input files. Return a meaningful error
997 code.
998 * TODO: Update.
999
1000 Rewrite the bootstrap suite.
1001
1002 * README-alpha: Rewritten.
1003 * bootstrap.conf: Rewritten.
1004 * bootstrap: Slightly modified version from gnulib.
1005 * gnulib.modules, README-hacking: New files.
1006 * doc/mailfromd.texi: Minor fix.
1007
1008 2008-03-11 Sergey Poznyakoff <gray@gnu.org.ua>
1009
1010 Fix handling of handler/handler name clashes.
1011
1012 * mfd/drivers.c (code_type_progdecl): Warn if a header is
1013 redeclared.
1014 * doc/mailfromd.texi: Document resolving of handler/handler name
1015 clashes.
1016
1017 2008-03-10 Sergey Poznyakoff <gray@gnu.org.ua>
1018
1019 * mflib/strip_domain_part.mf, mflib/heloarg_test.mf,
1020 mflib/gettext.mf, mflib/valid_domain.mf, mflib/spf.mf,
1021 mflib/match_cidr.mf, mflib/is_ip.mf, mflib/safedb.mf4,
1022 mflib/dns.mf4: Indent using mfl-mode.
1023
1024 * mflib/match_dnsbl.mf, mflib/match_rhsbl.mf: Indent using
1025 mfl-mode. Remove m4 conditionals.
1026
1027 Port r1632 of branches/release_4_3_patches.
1028
1029 * configure.ac, NEWS: Version 4.4
1030
1031 * mfd/mailfromd.h (enum mf_status_code): Add a comma and a count
1032 definition, needed for `make check-exceptions' in docs.
1033 * mfd/status.mfi (m4_ifdef): Use OLD_EXCEPTION_CODES instead of
1034 COMPAT_4_3.
1035 * mfd/main.c: New command line options: -D (--define), and -U
1036 (--undefine).
1037 * mflib/match_dnsbl.mf (match_dnsbl): Use LAZY_MATCH_RBL instead of
1038 COMPAT_4_3.
1039 Throw e_invip if address is invalid.
1040 * mflib/match_rhsbl.mf (match_rhsbl): Use LAZY_MATCH_RBL instead
1041 of COMPAT_4_3.
1042 * doc/mailfromd.texi: Document variable shadowing and new
1043 features.
1044 * doc/Makefile.am (check-exceptions): Update the rule.
1045 * NEWS: Update.
1046 Fix the test suite. The file status.mfh now contains m4 statements,
1047 yet the test suite uses --no-preproc files, so we have to use an
1048 already preprocessed version of that file.
1049
1050 * tests/atlocal.in (MFOPTS): Add -I@abs_builddir@
1051 * tests/Makefile.am (status.mfh): New rule.
1052 (check_local): Depend on status.mfh
1053 (clean-local): Remove status.mfh
1054 * NEWS: Raise version number.
1055
1056 Prefix all exception codes with `e_'.
1057
1058 * mfd/mfstat.awk: Look for mf_exception_code/mf_exception_count.
1059 * mfd/lex.l (variable_or_const): Add type cast.
1060 * mfd/mailfromd.h (enum mf_status_code): Retain only first four proper
1061 status codes.
1062 (enum mf_exception_code): New type.
1063 (mf_status_to_exception): New macro
1064 (mf_exception_str,string_to_exception): New functions
1065 (mf_status_str): Rewrite as macro.
1066 (string_to_stat): Remove.
1067 * mfd/mf-status.mfi: Prefix codes with e_
1068 * mfd/status.mfi: Prefix exception codes with e_. Retain
1069 succes, not_found, failure, and temp_failure for backward
1070 compatibility.
1071 Retain old exception names if m4 symbol COMPAT_4_3 is defined.
1072 * mfd/gram.y, mfd/snarf.m4, mfd/bi_poll.m4, mfd/bi_string.m4,
1073 mfd/drivers.c, mfd/bi_dns.m4, mfd/bi_system.m4, mfd/bi_spf.m4,
1074 mfd/prog.c, mfd/bi_ipaddr.m4, mfd/bi_sa.m4, mfd/bi_io.m4,
1075 mfd/bi_sieve.m4, mfd/bi_vars.m4, mfd/bi_other.m4, mfd/bi_mail.m4,
1076 mfd/bi_gettext.m4, mfd/bi_db.m4, : Use new exception names.
1077 * configure.ac (MF_VERSION_PATCH): Set to 90
1078 * doc/mailfromd.texi: Document changes.
1079
1080 Name clashes between constants and variables went unnoticed by the
1081 compiler. Bug reported by Thomas Lynch.
1082 Fix this and rename exception codes to minimize chances of such
1083 clashes.
1084
1085 * mfd/symtab.c (lookup_or_install): Allow to search using state
1086 masks.
1087 (variable_or_constant_lookup): New function.
1088 (constant_lookup): Return const struct constant *.
1089 (constant_lookup_value): New function.
1090 * mfd/lex.l (get_const): Remove.
1091 (variable_or_const): New function.
1092 * mfd/gram.y: Display warnings on a clash of constant and variable
1093 names.
1094 (VARIABLE): Change union type to var. Modify `variable' production
1095 accordingly.
1096 * mfd/mailfromd.h (_SYM_COUNT,SYM_MASK,SYM_BITS): New defines.
1097 (constant_lookup): Return const struct constant *.
1098 (constant_lookup_value): New function.
1099 (variable_or_constant_lookup): New function.
1100 * mfd/status.mfi: Prefix exception codes with `e_' to avoid name
1101 clashes.
1102 Provide backward-compatible constants.
1103 * mflib/match_dnsbl.mf (match_dnsbl): Rename range to iprange to
1104 avoid name clashes with the exception code.
1105 Remove buggy conditions. Provide a correctly working replacement
1106 for them if the m3 symbol `COMPAT_4_3' is defined.
1107 * mflib/match_rhsbl.mf (match_rhsbl): Rename range to iprange to
1108 avoid name clashes with the exception code.
1109 Remove buggy conditions. Provide a correctly working replacement
1110 for them if the m3 symbol `COMPAT_4_3' is defined.
1111 * mflib/match_cidr.mf, mflib/safedb.mf4, tests/etc/catch.rc,
1112 tests/etc/catch01.rc: Use new exception codes.
1113
1114
1115 2008-03-01 Sergey Poznyakoff <gray@gnu.org.ua>
1116
1117 Ported r1619 from branches/release_4_3_patches.
1118
1119 * src/prog.c, src/prog.h (advance_pc): Fix type of the 2nd
1120 argument.
1121 * configure.ac: Use AC_TRY_LINK to check for libresolve.
1122 * THANKS: Update
1123 * NEWS: Update
1124
1125 * mfd/main.c: Minor changes in doc string.
1126
1127 2008-02-26 Sergey Poznyakoff <gray@gnu.org.ua>
1128
1129 * pies/pies.c: New configuration statement "chdir".
1130 * pies/progman.c (struct prog.v.p): New member `dir'.
1131 (register_prog): Initialize newp->v.p.dir;
1132 (prog_start): Change to the working directory, if required by
1133 config.
1134
1135 2008-02-21 Sergey Poznyakoff <gray@gnu.org.ua>
1136
1137 * mfd/main.c (mf_error_on_locus): Mark as printflike.
1138 (cb_milter_timeout): Fix format.
1139 (mf_cfg_param): Fix erroneous description of include-path.
1140
1141 2008-02-10 Sergey Poznyakoff <gray@gnu.org.ua>
1142
1143 Merged HEAD from branches/gmach.
1144
1145 2008-02-09 Sergey Poznyakoff <gray@gnu.org.ua>
1146
1147 * THANKS: Add Tom Lynch. Obfuscate email addresses.
1148 * pmult/pmult.c: Remove kludges that were necessary to include
1149 files from meta1 source tree. Assume PreAlpha24.1 at least.
1150 * pmult/Makefile.am (INCLUDES): Remove @META1_INCLUDES@
1151 * configure.ac (--enable-pmilter option): Assume all the necessary
1152 libraries are installed under ${path}/include/sm, and libraries
1153 under ${path}/lib/meta1.
1154
1155 2008-02-06 Sergey Poznyakoff <gray@gnu.org.ua>
1156
1157 Ported r1606 from trunk.
1158
1159 * src/dnsbase.c: Define MAX, if necessary.
1160 * src/mailfromd.h: Define INADDR_NONE.
1161 * configure.ac: Check for librt.
1162 Add auth to AM_GNU_MAILUTILS.
1163 * gacopyz/server.c (srv_connect): Fix typo.
1164 * gacopyz/gacopyz.c (do_connect): Fix typo.
1165 * bootstrap (MODLIST): Add vasprintf.
1166 * configure.ac: Check for libsocket and libnsl.
1167 * src/dnsbase.c (dns_resolve_hostname,a_lookup): Change
1168 initialization of domainbuf.
1169 * src/syslog_async.c: Include fcntl.h.
1170
1171 2008-02-01 Sergey Poznyakoff <gray@gnu.org.ua>
1172
1173 * pies/pies.c (progman_wake_disabled): Renamed to
1174 progman_wake_sleeping.
1175 * pies/progman.c: Implement proper handling of dependencies.
1176 * pies/pies.h ((progman_wake_disabled): Renamed to
1177 progman_wake_sleeping.
1178 (pies_depmap_t,pies_depmap_pos_t,enum pies_depmap_direction): New
1179 types.
1180 (depmap_alloc,depmap_copy,depmap_set,depmap_isset,depmap_tc)
1181 (depmap_first,depmap_next): New functions.
1182 * pies/depmap.c: New file.
1183 * pies/Makefile.am (pies_SOURCES): Add depmap.c.
1184
1185 * smap/smap.c (version): Fix indentation.
1186 * pies/pies.c (return_code_section_parser): Allow to use symbolic
1187 exit codes.
1188 (priv_setup): Exit with EX_CONFIG if the user does not exist.
1189 (main): Catch early sigchlds as well.
1190 * pies/progman.c (progman_cleanup): Fix notice wording.
1191 * pies/pies.rcin: Add sample return-code section.
1192 (component pmult): Redirect stderr/stdout to syslog.
1193
1194 2008-01-31 Sergey Poznyakoff <gray@gnu.org.ua>
1195
1196 Implement configurable actions depending on the exit code of
1197 a component.
1198
1199 * pies/pies.c: New configuration file section "return-code".
1200 (capa): Add mailer and debug.
1201 (main): Register "return-code" section and all mailer formats.
1202 * pies/progman.c (enum prog_status): New type.
1203 (struct prog): Remove `disabled'. New fields `status' and `act'.
1204 (register_prog): Initialize act.
1205 (prog_start): Exit with EX_SOFTWARE code if the component cannot
1206 be started.
1207 (progman_start): Do not start disabled components.
1208 (progman_wake_disabled): Wake only components marked as
1209 status_stopped.
1210 (notify): New function.
1211 (progman_cleanup): Act in accordance with the `act' field if the
1212 component terminates.
1213 (progman_stop_component,progman_dump_stats): Take into account
1214 prog->v.p.status.
1215 * pies/pies.h (MAX_RETURN_CODE): New define.
1216 (enum return_action): New type.
1217 (struct component.act): New member.
1218 (default_component): New global.
1219
1220 2008-01-28 Sergey Poznyakoff <gray@gnu.org.ua>
1221
1222 * mfd/bi_db.m4 (dbdel): Fix format arguments.
1223
1224 2008-01-27 Sergey Poznyakoff <gray@gnu.org.ua>
1225
1226 * doc/mailfromd.texi: Document header_insert and sleep.
1227 * mfd/bi_header.m4 (header_insert): New function.
1228 * NEWS: Update.
1229
1230 2008-01-26 Sergey Poznyakoff <gray@gnu.org.ua>
1231
1232 * pmult/pmult.c: Handle signals in the main thread by default.
1233 Remove --sigthread option, introduce --no-signal-handler option.
1234 (struct pmult_client): New member hdr
1235 (cb_reply): Fully implement header modification commands in their
1236 Sendmail semantics (as far as bugs of MeTA1 do not impede for it
1237 to work).
1238 (pmult_runlist0): New function.
1239 (pmult_runlist): Rewrite using pmult_runlist0.
1240 (pmult_clear): New function.
1241 (pmult_shutdown,pmult_eom): Call pmult_clear.
1242 (process_headers): Populate p->hdr.
1243 (pmult_msg_handler): New function.
1244 (pmult_msg): Rewrite using pmult_msg_handler.
1245
1246 * mfd/mailfromd.h (enum msgmod_opcode): New value header_insert.
1247 * mfd/bi_header.m4 (header_add): Implement optional index
1248 argument.
1249 * mfd/engine.c (run_msgmod): Handle header_insert.
1250 * mfd/gram.y (msgmod_opcode_str): Likewise.
1251
1252 * doc/mailfromd.texi: Update.
1253 * NEWS, TODO: Update.
1254
1255 * pmult/pmult.c (wait_for_signal): Handle SIGABRT and SIGSEGV.
1256 (pmult_msg): Print body text at debug level trace7.
1257
1258 2008-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
1259
1260 * pmult/pmult.c (pmult_runlist,pmult_shutdown,pmult_connect): Lock
1261 context before proceeding.
1262 * mfd/bi_system.m4: New function `sleep'.
1263
1264 2008-01-24 Sergey Poznyakoff <gray@gnu.org.ua>
1265
1266 * pies/pies.c, pmult/pmult.c: Fix handling of the --log-tag option.
1267
1268 * pies/progman.c (prog_start): Remove unconditional debugging
1269 output.
1270 * gacopyz/gacopyz.h (SMI_LOG_PROTO): New debugging level.
1271 (gacopyz_io_logdump): Remove useless level argument.
1272 * gacopyz/log.c, gacopyz/io.c, gacopyz/gacopyz.c: Dump protocol
1273 traces only if SMI_LOG_PROTO is set.
1274
1275 * pmult/pdbg.hm4, pmult/debugdef.m4: New files. Provide serialized
1276 versions of MU_DEBUG macros.
1277
1278 * pmult/pmult.c: Use debugging macros from pdbg.h
1279 Do not protect accesses to p->srvlist by mutexes, they should not
1280 be concurrent anyway.
1281 (pmult_abort): Do not shutdown priv_data.
1282
1283 2008-01-22 Sergey Poznyakoff <gray@gnu.org.ua>
1284
1285 * mtasim/mtasim.c: Do not use gacopyz_srv_define_macro0.
1286 * pmult/pmult.c: (log_setup): Always set mu_debug_default_printer
1287 to override bug in libmailutils.
1288 (client_block_end): Bugfix.
1289 (pmult_connect): Do not use gacopyz_srv_define_macro0.
1290 * mfd/main.c (log_setup): Always set mu_debug_default_printer to
1291 override bug in libmailutils.
1292
1293 * gacopyz/gacopyz.h (gacopyz_srv_define_macro0): Remove.
1294 * gacopyz/log.c (gacopyz_io_logdump): Bugfix.
1295 * gacopyz/server.c (gacopyz_srv_define_macro0): Remove.
1296 (gacopyz_srv_define_macro): Do not use gacopyz_srv_define_macro0.
1297
1298 * pies/pies.c (log_setup): Always set mu_debug_default_printer to
1299 override bug in libmailutils.
1300 (component_cfg_param): New keyword `env'.
1301 (main): Bugfix: It is -R that allows arguments, not -r.
1302 * pies/progman.c (struct prog): New member env.
1303 (register_prog): Avoid unnecessary allocations. Copy env.
1304 (env_setup): New function.
1305 (prog_start): Set up environment.
1306 * pies/pies.h (struct component): New member env.
1307
1308 2008-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
1309
1310 * doc/mailfromd.texi, NEWS: Update.
1311 * doc/Makefile.am: Rename /src/ to /mfd/.
1312
1313 * mfd/symtab.c (rehash): Bugfix: Update variable owner.
1314 * mfd/mailfromd.h (SP): New macro.
1315 (struct locus.line): Change type to unsigned long.
1316 (enum header_opcode): Replace with enum msgmod_opcode.
1317 (struct old_header_node): Replace with struct msgmod_closure.
1318 (header_command_str): Replace with msgmod_opcode_str.
1319 (parse_error,parse_warning,parse_warning_locus): Mark as
1320 printflike.
1321 (env_throw,env_throw_bi): Likewise.
1322 (logmsg,trace): Likewise.
1323 (create_environment): Change proto.
1324 (env_msgmod): New function.
1325
1326 * mfd/bi_rcpt.m4: New file. Envelope modification functions.
1327 * mfd/bi_qrnt.m4: New file. Quarantine functions.
1328 * mfd/bi_header.m4: New file. Header modification functions.
1329 * mfd/Makefile.am (M4_FILES): Add bi_rcpt.m4, bi_header.m4 and
1330 bi_qrnt.m4.
1331 * mfd/engine.c, mfd/gram.y, mfd/drivers.c, mfd/prog.c
1332
1333 * gacopyz/server.c: Minor changes in debug diagnostics.
1334
1335 2008-01-19 Sergey Poznyakoff <gray@gnu.org.ua>
1336
1337 * pmult/pmult.c: Use callback to handle header modification
1338 commands.
1339 * gacopyz/gacopyz.h (gacopyz_srv_set_callback)
1340 (gacopyz_srv_set_callback_data): New function.
1341 * gacopyz/server.c (struct gacopyz_srv.cb_reply,cb_data): New
1342 members.
1343 (gacopyz_srv_set_callback)
1344 (gacopyz_srv_set_callback_data): New functions.
1345 (gacopyz_srv_send_command): Read all header, recipient and body
1346 modification replies.
1347 * doc/mailfromd.texi: Update.
1348
1349 * tests/testsuite.at: Skip MTA tests if running with root privileges.
1350 * tests/Makefile.am: Add missing depedency.
1351
1352 * */*: Roll back the latest rename. Changing a well-known program
1353 name doesn't pay.
1354
1355 2008-01-16 Sergey Poznyakoff <gray@gnu.org.ua>
1356
1357 IV. Emulate more milter macros:
1358
1359 * pmult/pmult.c: Emulate more milter macros.
1360
1361 III. Bugfix
1362
1363 * gacopyz/server.c (gacopyz_srv_con): Pass port number.
1364
1365 II. Move mtasim into a separate directory.
1366
1367 * mtasim: New directory.
1368 * mtasim/openat-die.c, mtasim/mtasim.c: Move from src/
1369 * mtasim/Makefile.am: New file.
1370 * configure.ac, Makefile.am: Add mtasim.
1371 * tests/atlocal.in: Add mtasim to PATH.
1372 * po/POTFILES.in: Add missing files.
1373
1374 I. Rename mailfromd to mfd.
1375
1376 * src, src/mfstat.awk, src/symtab.c, src/lex.l, src/mu_dbm.c,
1377 src/engine.c, src/stack.c, src/snarf.m4, src/dnscache.c,
1378 src/mu_dbm.h, src/opcode.awk, src/gram.y, src/debug.cin,
1379 src/drivers.c, src/bi_poll.m4, src/bi_string.m4, src/mailfromd.h,
1380 src/dnsbase.c, src/debug.hin, src/dns.c, src/openat-die.c,
1381 src/db.c, src/spf.c, src/dns.h, src/drv.awk, src/bi_system.m4,
1382 src/bi_dns.m4, src/spf.h, src/bi_sprintf.m4, src/bi_spf.m4,
1383 src/init.m4, src/debugdef.m4, src/cache.c, src/optab.opc,
1384 src/prog.c, src/optab.oph, src/bi_ipaddr.m4, src/bi_sa.m4,
1385 src/opcodes, src/mf-status.mfi, src/prog.h, src/status.mfi,
1386 src/bi_io.m4, src/pp.c, src/builtin.def, src/bi_sieve.m4,
1387 src/bi_vars.m4, src/main.c, src/Makefile.am, src/bi_other.m4,
1388 src/bi_mail.m4, src/mtasim.c, src/rate.c, src/bi_gettext.m4,
1389 src/bi_db.m4: Move to mfd.
1390 * configure.ac, Makefile.am, mfd/mtasim.c, mfd/Makefile.am: Use
1391 mfd instead of src.
1392 * mfd: New directory.
1393
1394 * mfd/engine.c (milter_conn_accept): Take a third argument,
1395 specifying the actual length of the sa structure.
1396 Return 0 if mailfromd_acl is not given.
1397 * gacopyz/gacopyz.h, gacopyz/gacopyz.c: xxfi_accept takes third
1398 argument, specifying the actual lengthof the sa structure.
1399
1400 * tests/farg.at, tests/ismx.at, tests/atlocal.in, tests/catch.at,
1401 tests/catch01.at, tests/cond02.at, tests/shadow.at,
1402 tests/version.at, tests/ashadow.at, tests/cond04.at,
1403 tests/relayed02.at, tests/cond06.at, tests/testsuite.at,
1404 tests/ack.at, tests/invcidr.at, tests/switchn1.at,
1405 tests/bctx00.at, tests/switchn3.at, tests/greylist.at,
1406 tests/cidr2.at, tests/fctx00.at, tests/switchs1.at,
1407 tests/switchs3.at, tests/invip2.at, tests/poll02.at,
1408 tests/poll04.at, tests/hostname.at, tests/resolve.at,
1409 tests/invcidr2.at, tests/hasmx.at, tests/declvar.at,
1410 tests/cond01.at, tests/macros.at, tests/invip.at, tests/cond03.at,
1411 tests/relayed01.at, tests/cond05.at, tests/prec.at,
1412 tests/strings.at, tests/rescname.at, tests/bctx01.at,
1413 tests/switchn2.at, tests/cidr1.at, tests/switchn4.at,
1414 tests/cidr3.at, tests/fctx01.at, tests/poll.at, tests/switchs2.at,
1415 tests/poll01.at, tests/ml.at, tests/switchs4.at,
1416 tests/poll03.at: Rename mailfromd to mfd.
1417
1418 2008-01-14 Sergey Poznyakoff <gray@gnu.org.ua>
1419
1420 * src/engine.c, src/mailfromd.h, src/main.c: Implement ACLs.
1421 * NEWS: Update.
1422
1423 * src/main.c, smap/smap.c, pies/pies.c, pies/progman.c,
1424 pies/pies.h, pmult/pmult.c: Sync with MU CVS: Use mu_log_facility
1425 and mu_log_tag.
1426 * gacopyz/gacopyz.h (struct gacopyz_milter_descr): New member
1427 xxfi_accept.
1428 * gacopyz/gacopyz.c (gacopyz_handle_connection): Close connection
1429 immediately if conn->desc.xxfi_accept returns 1.
1430
1431 * src/mailfromd.h, src/engine.c, src/smap.c: Use uniform startup
1432 and shutdown messages.
1433
1434 2008-01-13 Sergey Poznyakoff <gray@gnu.org.ua>
1435
1436 * pies/pies.c (_cb_group): Bugfix: store group number in the list,
1437 not its name.
1438 (component_section_parser): Initialize retr to default values.
1439 * pmult/pmult.c: New option --sigthread: handle SIGHUP and SIGTERM
1440 in the main thread. Necessary (at least) for Linux 2.4.*
1441
1442 * src/lex.l, src/mailfromd.h (parse_warning, parse_warning_locus)
1443 (parse_error,parse_error_locus): fmt is const.
1444 * src/gram.y (dbg_dict_getsym): Auxiliary function.
1445 * src/prog.c, src/prog.h (pushs): 2nd argument is const.
1446 * src/bi_gettext.m4 (bindtextdomain): Minor fix.
1447 * pies/Makefile.am, smap/Makefile.am,
1448 pmult/Makefile.am (LDADD): Place libgnu.a after
1449 MAILUTILS_LIBS.
1450 * pmult/pmult.c: Fix indentation.
1451 * lib/libmf.h: Include stdio.h
1452 * lib/userprivs.c: Include libmf.h.
1453 * lib/parsetime.c: Includestring.h and time.h
1454
1455 * pies: New directory.
1456 * pies/Makefile.am: New file.
1457 * pies/pies.c, pies/progman.c, pies/pies.h, pies/pies.rcin: New
1458 files.
1459 * smap/smap.c (switch_to_privs): Remove. Use library version instead.
1460 * pmult/pmult.c: New configuration file statement `pidfile'.
1461 (pmult_connect): Ignore gsrv if its remote milter is not
1462 listening.
1463 * configure.ac, Makefile.am: Add pies.
1464 * lib/libmf.h (getmaxfd): New define.
1465 * NEWS: Update.
1466
1467 2008-01-12 Sergey Poznyakoff <gray@gnu.org.ua>
1468
1469 * lib/libmf.h: Add switch_to_privs.
1470 * lib/userprivs.c: New file.
1471 * lib/Makefile.am: Add userprivs.c.
1472 * src/gram.y (time_multiplier): Remove forward dcl.
1473 * src/main.c: Move switch_to_privs to lib.
1474
1475 * src/prog.c (instr_header): Improve trace output.
1476 * pmult/pmult.c: Implement recipient and header modifications.
1477 * configure.ac: Link libmta/libcstrr.a (for pmult).
1478 * TODO: Update.
1479
1480 * gacopyz/server.c (gacopyz_srv_send_command): Do not bail out on
1481 message modification responses.
1482 * gacopyz/gacopyz.c (gacopyz_header_command): Improve trace output.
1483
1484 * src/gram.y (DELETE string): Initialize hdr.value.
1485 * src/drivers.c (code_type_header): Value can be NULL.
1486
1487 * pmult/pmult.c: Implement most of the SMTP functionality.
1488
1489 * src/mailfromd.h, lib/libmf.h (dict_init, dict_install)
1490 (dict_destroy, dict_getsym): Move to lib/libmf.h.
1491 * src/prog (dict_init, dict_install, dict_destroy)
1492 (dict_getsym): Move to lib/dict.c.
1493 * lib/dict.c: New file.
1494 * lib/Makefile.am: Add dict.c.
1495
1496 * pmult/pmult.c: Implement framework for milter macros.
1497
1498 2008-01-11 Sergey Poznyakoff <gray@gnu.org.ua>
1499
1500 * gacopyz/gacopyz.c (parse_url): Bugfix.
1501 * pmult/pmult.c: Update.
1502
1503 * pmult/pmult.c: Update.
1504 * gacopyz/gacopyz.h, gacopyz/server.c: Implement gacopyz_srv_conn.
1505
1506 * src/gram.y (parse_time_interval): Move to lib/parsetime.c.
1507 * src/mailfromd.h (parse_time_interval): Move to lib/libmf.h
1508 * lib/libmf.h (parse_time_interval): New proto.
1509 * lib/Makefile.am: Add parsetime.c.
1510 * lib/parsetime.c: New file.
1511 * smap/smap.c: Include mailutils/daemon.h.
1512 * pmult: New directory.
1513 * pmult/pmult.c: New file. A framework for pmilter multiplexer.
1514 * pmult/Makefile.am: New file.
1515 * configure.ac: New option --enable-pmilter.
1516 * Makefile.am (SUBDIRS): Add pmult.
1517
1518 2008-01-09 Sergey Poznyakoff <gray@gnu.org.ua>
1519
1520 * src/engine.c (check_pidfile): Bugfix.
1521 * src/gram.y (mailfromd): dict is mu_assoc_t.
1522 * src/mailfromd.h (dict_init,dict_install,dict_destroy)
1523 (dict_getsym): dict is mu_assoc_t.
1524 * src/prog.c: Likewise.
1525 * src/main.c (mf_diag_syslog_printer): Return 0.
1526 * smap/smap.c (expand_reply_text): Tolerate arg==NULL.
1527 (--foreground,--inetd,--daemon): New options.
1528 (argp_capa): Add debug.
1529 * lib/nls.c (mf_init_nls): Bind "mailfromd" domain.
1530
1531 * gacopyz/smfi.c, gacopyz/gacopyz.h, gacopyz/gacopyz_priv.h,
1532 gacopyz/log.c, gacopyz/proc.c, gacopyz/server.c,
1533 gacopyz/gacopyz.c: Move logmask and ctx_timeout from
1534 gacopyz_conn_t to gacopyz_milter_descr. Fix some minor issues.
1535
1536 * src/db.c, src/bi_dns.m4, src/bi_sprintf.m4, src/prog.c,
1537 src/bi_db.m4: Fix format strings/arguments.
1538 * src/bi_sieve.m4: Minor fixes.
1539 * src/mtasim.c: Include libmf.h
1540 * smap/smap.c: Include mailutils/server.h. Minor bugfixes.
1541 * tests/version.at, tests/macros.at: Use mailfromd canonical name,
1542 not AT_PACKAGE_NAME (in message patterns).
1543
1544 2008-01-08 Sergey Poznyakoff <gray@gnu.org.ua>
1545
1546 * src/gram.y, src/main.c: Remove deprecated features.
1547 * doc/mailfromd.texi, NEWS: Update.
1548 * gacopyz/gacopyz.c: Support URLs.
1549
1550 * lib/libmf.h (mf_init_nls): New proto.
1551 * lib/nls.c: New file.
1552 * lib/Makefile: Add nls.c.
1553 * bootstrap: Fix TP issues.
1554 * src/main.c, src/mtasim.c, smap/smap.c: Use mf_init_nls.
1555 * lib/version.c: Update year.
1556
1557 * configure.ac (AC_INIT): Rename to gmach (working name).
1558 (MF_VERSION_PATCH): Raise to 91
1559 Require at least MU-1.2.90
1560 (AC_CONFIG_FILES): Add gnu/Makefile and smap/Makefile.
1561 * NEWS: Update.
1562
1563 * bootstrap: Place gnulib files in gnu/
1564
1565 * lib: New directory.
1566 * lib/libmf.h: New file.
1567 * src/daemon.c, src/syslog_async.c, src/syslog_async.h,
1568 src/version.c: Moved to lib
1569 * src/mailfromd.h: Incude sysexits.h unconditionally.
1570 Include libmf.h
1571 * src/bi_sa.m4: Rewrite using mu_socket_stream_t.
1572 * src/main.c: Remove pre-mu-1.2.90 dependencies.
1573
1574 * Makefile.am (SUBDIRS): Add gnu and smap.
1575 * src/Makefile.am, gacopyz/Makefile.am: Update.
1576
1577 * src/mtasim.c (main): Remove (now superfluous) invocation of
1578 mu_error_set_print.
1579
1580 * smap/smap.c: Rewrite using MU-1.2.90
1581
1582 * po/POTFILES.in: Update.
1583
1584 2007-12-28 Sergey Poznyakoff <gray@gnu.org.ua>
1585
1586 * src/Makefile.am (libmf_a_DEPENDENCIES): Add BUILD_SYSLOG_ASYNC
1587
1588 2007-12-13 Sergey Poznyakoff <gray@gnu.org.ua>
1589
1590 * src/main.c (mf_cfg_param): Add docstrings.
1591
1592 2007-12-12 Sergey Poznyakoff <gray@gnu.org.ua>
1593
1594 Ported r1536 from branches/release_4_2_patches (= r1535 from
1595 tags/release_4_2):
1596
1597 * src/syslog_async.c: Include config.h, netinet/in.h and signal.h
1598 Conditionally include paths.h, provide replacements for _PATH_LOG
1599 and _PATH_CONSOLE if it is absent.
1600 Provide dummy replacement for MSG_NOSIGNAL and LOG_PERROR.
1601 (log_write_async): Ignore SIGPIPE if MSG_NOSIGNAL is not defined.
1602 * src/main.c: Conditionally compile syslog-async stuff.
1603 * src/Makefile.am: Likewise.
1604 * configure.ac: Check for paths.h.
1605 Restore previous meaning of --enable-syslog-async.
1606 (DEFAULT_SYSLOG_ASYNC): New variable.
1607
1608 * doc/mailfromd.texi: Reflect above-mentioned changes.
1609
1610 * src/main.c: Reflect recent changes to Mailutils.
1611
1612 2007-11-22 Sergey Poznyakoff <gray@gnu.org.ua>
1613
1614 * src/main.c: Implement MU configuration statements.
1615 * tests/atlocal.in (MFOPTS): Ignore site-wide and per-user
1616 configuration files.
1617 * doc/mailfromd.texi: Document sieve interface.
1618
1619 2007-11-22 Sergey Poznyakoff <gray@gnu.org.ua>
1620
1621 * doc/mailfromd.texi: Update
1622
1623 2007-11-21 Sergey Poznyakoff <gray@gnu.org.ua>
1624
1625 * src/bi_io.m4 (write): Implement optional third argument.
1626 * src/bi_sieve.m4: New file.
1627 * src/mailfromd.h (vlogmsg): New proto.
1628 * src/main.c (capa): Request "common" capability.
1629 (main): Register all mailbox formats (needed for sieve).
1630 * src/Makefile.am (M4_FILES): Add bi_sieve.m4
1631 * src/mtasim.c (process_header): chop trailing newline.
1632 * mflib/sieve.mfh: New file.
1633 * mflib/Makefile.am (inc_DATA): Add sieve.mfh.
1634 * configure.ac: Set patchlevel 90.
1635 (AM_GNU_MAILUTILS): Request 'all' and 'sieve' link flags.
1636 * doc/mailfromd.texi: Document 3rd argument of write.
1637 * NEWS: Update.
1638
1639 2007-11-19 Sergey Poznyakoff <gray@gnu.org.ua>
1640
1641 * README-alpha: Update
1642 * configure.ac: Use AM_GNU_MAILUTILS.
1643 * acinclude.m4: Minor fix.
1644
1645 * smap: New directory.
1646 * smap/smap.c: New file. A general-purpose socket map for MeTA1
1647 (for future use).
1648
1649 * src/mu_dbm.c [WITH_GDBM]: do not bail out if the database does
1650 not exist.
1651 * src/mailfromd.h: Add argp.h
1652 * src/bi_sa.m4: Minor fixes.
1653 * src/main.c: Support for Mailutils CVS HEAD.
1654 * configure.ac: Likewise.
1655
1656 2007-11-11 Sergey Poznyakoff <gray@gnu.org.ua>
1657
1658 * src/engine.c (check_on_host): Wait for an answer to QUIT.
1659 Fix courtesy of Nacho Gonzalez Lopez.
1660 * src/bi_sa.m4: Revert the changes inadvertently pushed on
1661 2007-10-21.
1662 * doc/Makefile.am: Use texi2html to produce HTML version of the
1663 manual.
1664 * doc/gendocs_template: Likewise
1665 * doc/gendocs.sh: Remove. Changes incorporated into the Texinfo
1666 repository.
1667 * doc/gendocs_template: Use conditionals, introduced in the
1668 Texinfo CVS.
1669
1670 2007-10-29 Sergey Poznyakoff <gray@gnu.org.ua>
1671
1672 * src/dnsbase.c (domain_name_cmp): Allow for trailing dot after
1673 the domain.
1674
1675 2007-10-23 Sergey Poznyakoff <gray@gnu.org.ua>
1676
1677 * doc/mailfromd.texi: Do not use subheading commands inside of
1678 deffn.
1679 * doc/Makefile.am
1680 * doc/gendocs.sh: New file. A customized version.
1681 * doc/gendocs_template: Update
1682
1683 * configure.ac, src/syslog_async.c, src/syslog_async.h,
1684 src/main.c, src/Makefile.am: Reimplement syslog-async. Thanks
1685 Simon Kelley for relicensing it under GPLv3.
1686 * doc/mailfromd.texi, NEWS: Update
1687
1688 2007-10-21 Sergey Poznyakoff <gray@gnu.org.ua>
1689
1690 * src/dnsbase.c (cname_loop_body): Return TXT only if explicitly
1691 required. Bug reported by Jan Rafaj.
1692
1693 * src/engine.c: Fix timeout calculations
1694 (struct timeout_ctl): New data type
1695 (UPDATE_TTW,smtp_stream_wait,smtp_wait): Operate on struct timeout_ctl.
1696 All callers updated.
1697 (init_timeout_ctl): New function.
1698
1699 2007-10-12 Sergey Poznyakoff <gray@gnu.org.ua>
1700
1701 * src/mtasim.c (_def_read): Return 0 if zero bytes were read
1702 (get_input_line): Fix counting of input bytes.
1703 (smtp): Fix checking for returns from process_data_reply.
1704 * gacopyz/server.c (srv_format_macros): Do not add trailing zero
1705 to the packet.
1706
1707 2007-10-10 Sergey Poznyakoff <gray@gnu.org.ua>
1708
1709 * src/mailfromd.h [!ENABLE_NLS] (bindtextdomain): Fix definition.
1710 * src/cache.c (cache_get2): Fix misplaced variable definition.
1711
1712 * src/dnsbase.c (dns_resolve_hostname): Remove stray free, left
1713 over after 2007-09-03.
1714
1715 2007-09-13 Sergey Poznyakoff <gray@gnu.org.ua>
1716
1717 * src/prog.c (heap_obstack_grow): Bugfix. The condition didn't
1718 take into account usignedness.
1719 (get_numeric_arg): Extra safety fix.
1720
1721 * configure.ac (MAILUTILS_VERSION): Bugfix.
1722
1723 2007-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
1724
1725 * src/main.c (log_setup): Set up gacopyz_syslog_log_printer when
1726 logging to syslog.
1727
1728 2007-09-11 Sergey Poznyakoff <gray@gnu.org.ua>
1729
1730 * src/mu_dbm.c [WITH_GDBM] (mu_dbm_firstkey,mu_dbm_nextkey):
1731 Return MU_ERR_NOENT instead of MU_ERR_FAILURE.
1732 * src/mailfromd.h (get_rate): New argument mincount
1733 * src/rate.c: Likewise
1734 * src/bi_other.m4 (rate): Optional argument mincnt
1735 * src/mtasim.c: Accept MAIL FROM: and RCPT TO: without extra space
1736 after `:'.
1737 * doc/mailfromd.texi, NEWS: Update
1738
1739 2007-09-03 Sergey Poznyakoff <gray@gnu.org.ua>
1740
1741 * src/dnsbase.c (dns_resolve_hostname): Make name buffer big
1742 enough to hold eventual CNAME expansions. Reported by Jan Rafaj.
1743 * configure.ac: Improve to compile with the latest MU CVS.
1744
1745 2007-08-11 Sergey Poznyakoff <gray@gnu.org.ua>
1746
1747 * configure.ac (check_slackware_bdb): Add heuristics to find the
1748 correct include directory.
1749
1750 2007-08-10 Sergey Poznyakoff <gray@gnu.org.ua>
1751
1752 * src/gram.y (on_cond): Fix coredump if target address is not
1753 specified.
1754 (vardecl): Signal error if an auto variable is doubly defined.
1755 * tests/testsuite.at (EX_OK--EX_CONFIG): New defines
1756 (MF_CHECK_TEXT): New macro
1757 Add poll04.at and ashadow.at
1758 * tests/ashadow.at, tests/poll04.at: New files
1759 * doc/mailfromd.texi: Minor fixes
1760 * src/dnsbase.c (a_lookup): Make name buffer big enough to hold
1761 eventual CNAME expansions.
1762
1763 2007-08-09 Sergey Poznyakoff <gray@gnu.org.ua>
1764
1765 * src/engine.c (check_on_host): Do not send space character after
1766 MAIL FROM: and RCPT TO:
1767 * doc/mailfromd.texi, TODO: Minor fixes.
1768 * NEWS: Update
1769
1770 2007-06-30 Sergey Poznyakoff <gray@gnu.org.ua>
1771
1772 Relicense everything under the GPLv3.
1773
1774 * src/syslog_async.c, src/syslog_async.h: Removed
1775
1776 2007-06-11 Sergey Poznyakoff <gray@gnu.org.ua>
1777
1778 * configure.ac, NEWS: Version 4.1
1779 * doc/mailfromd.texi: Update
1780 * src/pp.c (next_line): Bugfix
1781
1782 2007-06-08 Sergey Poznyakoff <gray@gnu.org.ua>
1783
1784 * doc/mailfromd.texi (NLS Functions): Update
1785 * elisp/mfl-mode.el (mfl-mode-syntax-table): Update
1786
1787 2007-06-01 Sergey Poznyakoff <gray@gnu.org.ua>
1788
1789 * src/lex.l: Fix line counting within here-documents
1790
1791 2007-05-27 Sergey Poznyakoff <gray@gnu.org.ua>
1792
1793 * elisp/mfl-mode.el: Initial implementation
1794 * tests/shadow.at, tests/bctx00.at, tests/fctx00.at,
1795 tests/macros.at, tests/etc/reject.rc, tests/etc/farg.rc,
1796 tests/etc/cidr.rc, tests/etc/catch.rc, tests/etc/catch01.rc,
1797 tests/etc/cond.rc, tests/etc/dns.rc, tests/etc/macros.rc,
1798 tests/etc/shadow.rc, tests/etc/relayed.rc, tests/etc/var.rc,
1799 tests/etc/numrcpt.rc, tests/etc/strings.rc, tests/etc/prec.rc,
1800 tests/etc/ack.rc, tests/etc/accept.rc, tests/etc/switch.rc,
1801 tests/etc/tempfail.rc, tests/etc/greylist.rc, tests/etc/poll-1.rc,
1802 tests/etc/sa01.rc, tests/etc/sa02.rc, tests/etc/poll.rc,
1803 tests/etc/sa03.rc, tests/etc/sa04.rc, tests/etc/ml.rc,
1804 tests/etc/arg.rc, etc/mailfromd.rc: Use MFL Emacs mode
1805
1806 2007-05-26 Sergey Poznyakoff <gray@gnu.org.ua>
1807
1808 * doc/mailfromd.texi: Update
1809 * Makefile.am: Update
1810 * elisp: New directory
1811 * elisp/mfl-mode.el: New file
1812 * elisp/Makefile.am: New file
1813
1814 2007-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1815
1816 * src/snarf.m4 (MF_OPTVAL): Fix a leftover bug
1817 * src/gram.y (on_cond): Reverse selector argument list.
1818 * src/drivers.c (code_type_call): Provide placeholders for
1819 missing optional arguments, so they can be safely accessed and
1820 assigned.
1821 * src/bi_dns.m4, src/bi_db.m4: Use MF_OPTVAL insted of MF_DEFINED.
1822 * src/bi_sa.m4: Avoid splitting strings within NLS markers,
1823 because M4 inserts line directives in between, which causes grief
1824 for many compilers.
1825 * src/Makefile.am (.m4.c): Fix the sed rule
1826 * src/mtasim.c (recursive_rmdir): Do not complain when attempting
1827 to delete a non-existing file.
1828
1829 2007-05-24 Sergey Poznyakoff <gray@gnu.org.ua>
1830
1831 * src/bi_gettext.m4: Built-in NLS support
1832 * mflib/gettext.mf: NLS support; library level.
1833 * src/Makefile.am, mflib/Makefile.am, mflib/pp-setup: Implement
1834 NLS support
1835
1836 * src/snarf.m4 (mf_c_arglist,MF_RETURN_TEMP_SPACE): Fix stack
1837 offset calculation for adjust_stack and unroll_stack
1838 (MF_VA_ARG): Raise an exception if the argument number is out of
1839 range.
1840 (MF_THROW): Avoid outputting extra newlines
1841 (MF_ASSERT): Remove spurious semicolon
1842 * src/bi_sprintf.m4: Implemented xXu.
1843 * src/Makefile.am (.m4.c): Fix the sed rule.
1844 * mflib/pp-setup (printf): New macro
1845
1846 * src/snarf.m4 (MF_GROW_TEMP_SPACE): Take optional 3rd argument
1847 * src/bi_sprintf.m4: Implement all modifiers, flags and basic
1848 conversions
1849 * src/prog.c (struct eval_environ.temp_start): New field.
1850 (heap_tempspace_begin,heap_tempspace_finish)
1851 (heap_tempspace_grow): Update tos in sync with temp_size so that
1852 heap_tempspace() can be used.
1853 * src/Makefile.am (builtin.h): Depend on Makefile.am
1854
1855 2007-05-23 Sergey Poznyakoff <gray@gnu.org.ua>
1856
1857 * src/symtab.c (va_builtin_install_ex): Extra argument: varargs
1858
1859 * src/snarf.m4 (MF_DEFUN_VARARGS,MF_VA_START,MF_VA_END)
1860 (MF_VA_COUNT,MF_VA_ARG): New macros: Support for variable number
1861 of arguments to built-in functions
1862 (MF_BEGIN_TEMP_SPACE,MF_GROW_TEMP_SPACE,MF_1GROW_TEMP_SPACE)
1863 (MF_END_TEMP_SPACE): New macros. Improved growable heap space
1864 support.
1865 (m4wrap): Use m4_m4wrap.
1866
1867 * src/gram.y (cast_arg_list): Take extra argument
1868 (funcall: BUILTIN): Allow for builtins taking varying number of
1869 arguments.
1870 * src/drivers.c (code_type_builtin): Allow for builtins taking
1871 varying number of arguments.
1872 * src/mailfromd.h (struct builtin.varargs): New field
1873 (va_builtin_install_ex): Change signature.
1874 * src/bi_dns.m4 (dns_getaddr, dns_getname, getmx): Use new heap
1875 allocation macros.
1876 * src/bi_system.m4 (strftime): Rewrite using MF_ALLOC_HEAP
1877 * src/prog.c (struct eval_environ.temp_size): New field
1878 (unroll_stack): New function
1879 (expand_dataseg): If errtext is NULL return 1/0 isntead of raising
1880 a runtime error.
1881 (push): Fix expansion condition
1882 (heap_tempspace_begin, heap_tempspace_finish)
1883 (heap_tempspace_grow): New functions
1884 (heap_max_tempspace): Remove
1885 (env_vsprintf): Rewrite.
1886 * src/prog.h (heap_max_tempspace,heap_fix_tempspace): Remove
1887 (heap_tempspace_begin,heap_tempspace_finish)
1888 (heap_tempspace_grow,unroll_stack): New functions
1889 * src/bi_sprintf.m4: New file. Sprintf support (limited at the time)
1890 * src/Makefile.am: Add bi_sprintf.m4
1891 * doc/mailfromd.texi: Update
1892
1893 2007-05-22 Sergey Poznyakoff <gray@gnu.org.ua>
1894
1895 * mflib/dns.mf: Rewritten as
1896 * mflib/dns.mf4: .. this
1897 * mflib/safedb.mf: Rewritten as
1898 * mflib/safedb.mf4: .. this
1899 * mflib/Makefile.am (.mf4.mf): New rule
1900
1901 * src/lex.l: Discontinue supporting &code form.
1902 New lexical entities: $# with the usual meaning and @parm,
1903 for getting ordinal number of parameter `parm' in the parameter
1904 list.
1905 New built-in constant __preproc__. Expands to the command name of
1906 the preprocessor.
1907 * src/snarf.m4 (MF_THROW): Bugfix: do not output ": " after the
1908 function name, it is done automatically by the error reporting
1909 routines.
1910 * src/gram.y: Support $# and @parm. Fix missing occurrences of
1911 `reverse' (yesterday's changes).
1912 * src/drivers.c (code_type_builtin): Fix passing $#
1913 (code_type_call): Implement $# (a hidden first argument) for MFL
1914 functions.
1915 (type offset): New node type
1916 * src/mailfromd.h (struct variable.ord): New field.
1917 * mflib/dns.mf, mflib/safedb.mf: Reflect the recent changes in
1918 optional argument handling.
1919 * mflib/pp-setup (defined): New macro
1920 * NEWS: Update
1921
1922 * src/snarf.m4 (__mf_has_optarg): New macro
1923 (__mf_defined_argname,__mf_defined_argnames)
1924 (mf_defined_argnames,mf_argpos): New macro
1925 (__mf_optarg_defined,__mf_defined,MF_DEFINED,MF_OPTVAL)
1926 (__mf_c_arglist,mf_c_arglist)
1927 Fix typo (m4_errprint)
1928 * src/gram.y: Arguments are passed the in the same order for both
1929 built-in and MFL-level functions.
1930 (print_node_list_reverse): New function
1931 * src/bi_string.m4 (substr): Bugfix: Use MF_DEFINED
1932 * src/drivers.c (print_type_builtin): Use print_node_list_reverse
1933 (code_type_builtin): Pass total number of arguments in a hidden
1934 argument if the built-in takes optional parameters.
1935 * src/mailfromd.h: Fix typo
1936 * src/main.c: Make sure logging goes to stderr for --dump-*
1937 options.
1938 * TODO: Update
1939
1940 2007-05-20 Sergey Poznyakoff <gray@gnu.org.ua>
1941
1942 * src/lex.l: Fix input file location tracing
1943 * src/pp.c (try_file): extra argument err_not_found controls
1944 whether to bail out if the file is not found.
1945
1946 * src/lex.l: Use pp_extrn_start/pp_extrn_shutdown to launch the
1947 external preprocessor.
1948 * src/mailfromd.h (pp_extrn_start, pp_extrn_shutdown, pp_init)
1949 (pp_done): New functions
1950 * src/pp.c (pp_extrn_start, pp_extrn_shutdown): New functions
1951 (preprocess_input): If a file named "pp-setup" is found in the
1952 include path, feed its contents to the preprocessor first.
1953 * mflib/pp-setup: Default preprocessor setup file.
1954 * mflib/Makefile.am (inc_DATA): Add pp-setup
1955 * configure.ac: Install default pp-setup file if the preprocessor
1956 is m4
1957
1958 Implement built-in and external preprocessors.
1959
1960 * src/pp.c: New file. Built-in preprocessor
1961 * src/lex.l, src/gram.y, src/mailfromd.h, src/main.c: Use
1962 preprocessor feature.
1963 * src/Makefile.am (mailfromd_SOURCES): Add pp.c
1964 (AM_CPPFLAGS): Define DEFAULT_PREPROCESSOR
1965 * tests/atlocal.in (MFOPTS): Disable external preprocessor
1966 * configure.ac: New option --with-preprocessor and variable
1967 DEFAULT_PREPROCESSOR
1968
1969 * src/engine.c (listens_on): port argument was ignored
1970
1971 2007-05-17 Sergey Poznyakoff <gray@gnu.org.ua>
1972
1973 * src/bi_dns.m4 (listens): Bugfix
1974
1975 * po/pl.po, po/uk.po: Move to
1976 http://svn.gnu.org.ua/sources/mailfromd/trunk/po. Mailfromd is now
1977 officially registered at TP.
1978 * po/LINGUAS: Remove. The file is generated automatically
1979 * bootstrap: Get translations from the TP.
1980 * README-alpha: Update
1981
1982 2007-05-16 Sergey Poznyakoff <gray@gnu.org.ua>
1983
1984 * src/snarf.m4, src/init.m4, src/Makefile.am: Save namespace from
1985 pollution: Use m4_ prefixed keywords.
1986 * src/main.c: Add missing NLS markers
1987
1988 * src/Makefile.am (EXTRA_DIST): Add daemon.c
1989 * src/prog.c (instr_symbol): Add missing NLS marker.
1990 * src/engine.c (mailfromd_daemon): Leave the first three
1991 descriptors open before attemtping to restart.
1992
1993 2007-05-15 Sergey Poznyakoff <gray@gnu.org.ua>
1994
1995 * src/debug.cin (debug_level_p): Change logic so that per-module
1996 specification takes precedence over the global one.
1997
1998 2007-05-14 Sergey Poznyakoff <gray@gnu.org.ua>
1999
2000 * po/uk.po: Ukrainian translation
2001 * po/pl.po: Minor fixes
2002 * po/LUNGUAS: Add uk
2003 * src/lex.l, src/gram.y, src/bi_dns.m4, src/mtasim.c,
2004 gacopyz/gacopyz.c: Minor fixes.
2005
2006 2007-05-13 Sergey Poznyakoff <gray@gnu.org.ua>
2007
2008 * src/symtab.c, src/lex.l, src/mu_dbm.c, src/engine.c,
2009 src/snarf.m4, src/dnscache.c, src/gram.y, src/debug.cin,
2010 src/drivers.c, src/bi_string.m4, src/bi_poll.m4, src/dnsbase.c,
2011 src/mailfromd.h, src/db.c, src/openat-die.c, src/spf.c,
2012 src/bi_dns.m4, src/cache.c, src/optab.opc, src/prog.c,
2013 src/bi_ipaddr.m4, src/bi_sa.m4, src/mf-status.mfi, src/bi_io.m4,
2014 src/main.c, src/Makefile.am, src/bi_other.m4, src/bi_mail.m4,
2015 src/mtasim.c, src/rate.c, src/bi_db.m4, tests/shadow.at,
2016 tests/invcidr.at, tests/invcidr2.at, configure.ac, gacopyz/smfi.c,
2017 gacopyz/gacopyz_priv.h, gacopyz/proc.c, gacopyz/server.c,
2018 gacopyz/io.c, gacopyz/Makefile.am, gacopyz/gacopyz.c,
2019 bootstrap: Add i18n framework
2020
2021 * po: New directory
2022 * po/POTFILES.in: New file
2023 * po/LINGUAS: New file
2024 * po/pl.po: New translation
2025
2026 2007-05-12 Sergey Poznyakoff <gray@gnu.org.ua>
2027
2028 -= Release 4.0 =-
2029
2030 2007-05-12 Sergey Poznyakoff <gray@gnu.org.ua>
2031
2032 * bootstrap: Avoid importing openat-die. This needs the following
2033 patch:
2034 http://lists.gnu.org/archive/html/bug-gnulib/2007-05/msg00056.html
2035 * README-alpha: Update
2036 * src/openat-die.c: New source
2037 * src/Makefile.am (mtasim_SOURCES): Add openat-die.c
2038 * doc/mailfromd.texi, doc/mtasim.texi: Update
2039
2040 2007-05-11 Sergey Poznyakoff <gray@gnu.org.ua>
2041
2042 * configure.ac, NEWS: Raise version number to 4.0. Ready for the
2043 release.
2044 * src/version.c: New file.
2045 * src/Makefile.am (libmf.a): New library
2046 * bootstrap (MODLIST): Add version-etc
2047 * src/mailfromd.h (mailfromd_version): New function
2048 * src/main.c, src/mtasim.c: Use mailfromd_version to display
2049 program version/license. Remove --license option, because
2050 --version does the job.
2051 * tests/version.at: Fix version format to match that of version-etc
2052 output.
2053
2054 * doc/mailfromd.texi: Final polish.
2055
2056 2007-05-10 Sergey Poznyakoff <gray@gnu.org.ua>
2057
2058 * src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Up to v.4.1 there were no
2059 txn argument to db->open.
2060 * src/engine.c (check_on_host): Clear last_poll_* values before
2061 startning the new poll.
2062
2063 2007-05-08 Sergey Poznyakoff <gray@gnu.org.ua>
2064
2065 * src/engine.c (check_portspec): Bugfix
2066
2067 * src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Locking mode
2068 depends on the open flags.
2069
2070 2007-05-06 Sergey Poznyakoff <gray@gnu.org.ua>
2071
2072 * src/mtasim.c: \E can take 1 and 2 digit codes.
2073 Correctly close the milter server before exiting
2074 * configure.ac: Call MU_DEBUG_MODE
2075 * doc/mailfromd.texi, doc/mtasim.texi: Update
2076 * acinclude.m4: New file
2077 * gacopyz/gacopyz.h, gacopyz/server.c (gacopyz_srv_abort)
2078 (gacopyz_srv_quit): New functions
2079 * gacopyz/gacopyz.c: Do not complain if the socket does not exist.
2080
2081 2007-05-05 Sergey Poznyakoff <gray@gnu.org.ua>
2082
2083 * src/mailfromd.h (DEFAULT_PIDFILE): Use file name relative to
2084 the state directory
2085 * src/main.c (portspec,pidfile): Initialize dynamically.
2086 (init_names): New function
2087 (state_dir_fixup,portspec_fixup,fixup_state_dir_names): New
2088 functions
2089 (main): Call init_names and fixup_state_dir_names
2090 (mailfromd_show_defaults): Use variables, not defines (hmmm)
2091
2092 2007-05-04 Sergey Poznyakoff <gray@gnu.org.ua>
2093
2094 * src/gram.y (convert_rate): Bugfix.
2095 * src/main.c: --predict implies --format=rate --list
2096 Update copyright years
2097 * doc/mailfromd.texi: Update
2098 * etc/Makefile.am (.in.mailfromd): Set executable bit on the
2099 target.
2100
2101 * src/mu_dbm.c [WITH_BDB] (mu_dbm_open): install errcall fn if
2102 debug level >= 1
2103 * src/engine.c (save_cmdline,sig_restart): New function
2104 (mailfromd_daemon): SIGHUP causes restart (if the program is
2105 invoked using the absolute file name)
2106 * src/mailfromd.h (getmaxfd): New macro from bi_io.m4
2107 (script_file,mtasim_option): New globals
2108 (log_setup,save_cmdline): New functions
2109 * src/bi_io.m4 (getmaxfd): move to src/mailfromd.h
2110 * src/main.c: New option --mtasim for mtasim interaction
2111 (log_setup): New function
2112 (main): Initial logging stream depends on whether stderr is closed
2113 or not.
2114 Save command line unless script file is not an absolute file name
2115 * src/mtasim.c (start_mailfromd): Use --mtasim instead of
2116 --foreground (mainly for further use.
2117 * configure.ac: Check for sysconf and getdtablesize
2118 * doc/mailfromd.texi: Update
2119 * doc/Makefile.am (check-fixmes): The rule missed multiline fixmes
2120 * etc/rc.in (mailfromd_status): remove trailing space from the
2121 first grep pattern
2122 (mailfromd_reload): New function
2123 New option `reload'
2124
2125 * gacopyz/gacopyz_priv.h (struct gacopyz_conn): New members
2126 cleanup and cleanup_data.
2127 * gacopyz/proc.c (gacopyz_cleanup_conn): Call conn->cleanup
2128 * gacopyz/gacopyz.c (do_connect): Install a cleanup handler to
2129 remove the UNIX socket.
2130 * NEWS: Update
2131
2132 2007-05-02 Sergey Poznyakoff <gray@gnu.org.ua>
2133
2134 * src/mu_dbm.c (mu_dbm_strerror): Improve error logging.
2135
2136 2007-05-01 Sergey Poznyakoff <gray@gnu.org.ua>
2137
2138 * src/mu_dbm.c (lock_file): fcntl can return non-null values.
2139 Retry if F_GETLK returns F_UNLCK
2140 (mu_dbm_open): Always use O_RDWR if the file could need to be
2141 locked for writing afterwards.
2142
2143 Ensure begin blocks can set exception handlers:
2144
2145 * doc/mailfromd.texi: Update
2146 * src/engine.c (xeval): Call env_save_catches after running begin
2147 blocks
2148 * src/prog.c (struct eval_environ.defcatch): New field
2149
2150 2007-04-30 Sergey Poznyakoff <gray@gnu.org.ua>
2151
2152 * src/gram.y: Use inner context to check for action usage in
2153 begin/end blocks. This allows to define global catches.
2154
2155 2007-04-28 Sergey Poznyakoff <gray@gnu.org.ua>
2156
2157 * src/mu_dbm.c: Use F_SETLKW
2158 * src/engine.c (priv_get, filter_cleanup): Add missing env_init
2159 * src/gram.y: Reset state_tag after reducing prog rules
2160 (sendmail_action, header_action): Additional checks
2161 * src/main.c: New option --gacopyz-log
2162 * doc/mailfromd.texi: Document --gacopyz-log
2163
2164 * gacopyz/smfi.c (smfi_setlogmask): Do what its name suggests.
2165 * gacopyz/gacopyz.h (SMI_LOG_UPTO, SMI_LOG_FROM): New macros
2166 (gacopyz_string_to_log_level, gacopyz_log_level_to_string): New
2167 functions
2168 * gacopyz/log.c (gacopyz_string_to_log_level)
2169 (gacopyz_log_level_to_string): New functions.
2170
2171 2007-04-27 Sergey Poznyakoff <gray@gnu.org.ua>
2172
2173 * src/mailfromd.h (smtp_state_begin,smtp_state_end): New
2174 (pseudo)states.
2175 (struct db_format.enabled): New field
2176 * src/lex.l (begin,end): New keywords
2177 * src/gram.y (begin,end): New statements
2178 * src/engine.c (priv_get, filter_cleanup): call `begin' and `end'
2179 handlers.
2180 (mlfi_abort): Clear session-specific information
2181
2182 * src/dnscache.c, src/cache.c, src/rate.c: Honor `.enabled' field
2183 * src/bi_db.m4: Honor `.enabled' field
2184 (db_get_active,db_set_active): New builtins
2185 (greylist): Remove spurious debugging info
2186 * doc/mailfromd.texi: Update
2187 * NEWS: Update
2188
2189 * src/mu_dbm.c [WITH_BDB]: Improve locking algo: yield control to
2190 the system before locking DB for writing to give other processes a
2191 chance to get the DB.
2192 * src/engine.c: Use SIGUSR1 to let the siblings know we changed
2193 lock status.
2194 (mailfromd_daemon,child_start): Ignore SIGUSR1.
2195
2196 2007-04-25 Sergey Poznyakoff <gray@gnu.org.ua>
2197
2198 * NEWS: Update
2199 * src/lex.l (parse_require): Bugfix
2200 * mflib/heloarg_test.mf, mflib/spf.mf: Begin the names of the static
2201 functions with __
2202 * doc/Makefile.am (check-refs): Scan all texi sources
2203 (check-mflib): Ignore static names (__.*)
2204 * doc/mailfromd.texi, doc/mtasim.texi, doc/macros.texi: Update.
2205
2206 2007-04-24 Sergey Poznyakoff <gray@gnu.org.ua>
2207
2208 * src/lex.l (parse_require): Bugfix
2209 * src/bi_mail.m4: Bugfix
2210 * src/mtasim.c: Implement help, fix directory removal at exit,
2211 implement readline history file. Bugfixes in smtp()
2212 * tests/testsuite.at, tests/accept.at, tests/greylist.at,
2213 tests/arg.at, tests/reject.at, tests/numrcpt.at,
2214 tests/tempfail.at: Use mtasim -Xauto when necessary
2215 * configure.ac, NEWS: Raise patchlevel to 92
2216 * doc/mailfromd.texi: Update
2217 * doc/mtasim.texi: mtasim documentation
2218 * doc/Makefile.am: Add mtasim.texi
2219 * gacopyz/gacopyz_priv.h (struct gacopyz_conn): Keep information
2220 about children pids
2221 * gacopyz/proc.c (gacopyz_register_child)
2222 (gacopyz_unregister_child): New functions
2223 (cleanup_children): Call gacopyz_unregister_child
2224 (gacopyz_cleanup_conn): Terminate children individualy instead of
2225 sending TERM to the whole process group, because we might be not
2226 the group leader.
2227 * gacopyz/gacopyz.c (gacopyz_handle_connection): Register child
2228 pid after startup.
2229 * bootstrap: Require save-cwd. Test if lib/daemon.c exists before
2230 attempting to create it.
2231
2232 2007-04-23 Sergey Poznyakoff <gray@gnu.org.ua>
2233
2234 * src/mtasim.c: Implement --port=auto, a special mode, where
2235 mtasim starts the mailfromd on an agreed-upon port and terminates
2236 it before exiting.
2237 * bootstrap: Require mkdtemp
2238
2239 * mflib/mx.mf: Remove. Superceded by the `getmx' builtin function.
2240 * mflib/Makefile.am: Remove mx.mf
2241 * doc/mailfromd.texi, NEWS: Update
2242
2243 * src/debug.cin, src/debugdef.m4 (debug_spec_string): New function
2244 (modname): Redefine as char *[]
2245 * src/lex.l, mflib/match_dnsbl.mf, mflib/heloarg_test.mf,
2246 mflib/mx.mf, mflib/valid_domain.mf, mflib/match_rhsbl.mf,
2247 mflib/spf.mf, tests/etc/cidr.rc, tests/etc/catch.rc,
2248 tests/etc/catch01.rc, tests/etc/poll-1.rc, etc/mailfromd.rc,
2249 NEWS: Introduce module system
2250
2251 * src/main.c: Minor wording fixes
2252 * src/Makefile.am (.cin.c): Require line info from m4
2253 * src/bi_other.m4 (debug_spec, debug_level): New functions.
2254
2255 2007-04-21 Sergey Poznyakoff <gray@gnu.org.ua>
2256
2257 * src/debugdef.m4, src/debug.cin, src/debug.hin: Debugging macros
2258 and supporting functions.
2259 * src/snarf.m4 (MF_SOURCE_DEBUG_NAME): New macro
2260 * src/lex.l, src/engine.c, src/dnscache.c,
2261 src/gram.y, src/dnsbase.c, src/mailfromd.h, src/dns.c, src/db.c,
2262 src/spf.c, src/cache.c, src/prog.c, src/main.c, src/rate.c: Use
2263 new debugging system.
2264 * src/Makefile.am: Build debug.[ch]
2265 * src/bi_other.m4 (cancel_debug): Removed
2266
2267 * etc/sendmail-8.13.7.connect.diff: New file. Patch for Sendmail
2268 to honor extended codes and textual messages returned by the connect
2269 handler.
2270 * etc/Makefile.am: Add sendmail-8.13.7.connect.diff
2271
2272 * gacopyz/smfi.c, gacopyz/gacopyz.h (smfi_setlogmask): New function
2273 * gacopyz/gacopyz.c (gacopyz_handle_connection): Log an info
2274 message before finishing.
2275
2276 2007-04-20 Sergey Poznyakoff <gray@gnu.org.ua>
2277
2278 * src/syslog_async.c, src/syslog_async.h: Async syslog
2279 implementation by Simon Kelley
2280 * src/mailfromd.h, src/main.c, src/Makefile.am,
2281 configure.ac: Implement async syslog.
2282
2283 * doc/mailfromd.texi, NEWS: Document syslog-async
2284
2285 * gacopyz/gacopyz.c (gacopyz_handle_connection): Print connection
2286 info after forking, so the actual PID is displayed.
2287
2288 2007-04-18 Sergey Poznyakoff <gray@gnu.org.ua>
2289
2290 * src/mu_dbm.c: When possible lock BDB databases directly.
2291 For version 2.x fall back to external lock method.
2292
2293 * src/snarf.m4 (MF_DEFINED, MF_OPTVAL): New macros
2294 * src/bi_string.m4, src/bi_dns.m4, src/bi_mail.m4,
2295 src/bi_db.m4: Use MF_DEFINED and MF_OPTVAL to test values of
2296 the optional variables.
2297 * src/main.c: New option --state-directory
2298 * doc/mailfromd.texi: Revert the description of `#pragma option'
2299
2300 * src/gram.y (apply_deferred_init): Fix error messages
2301 * src/mailfromd.h, src/prog.c, src/main.c, src/bi_other.m4,
2302 NEWS: Implement stack traces.
2303
2304 * mflib/match_dnsbl.mf, mflib/heloarg_test.mf,
2305 mflib/valid_domain.mf, mflib/match_rhsbl.mf, mflib/spf.mf,
2306 mflib/match_cidr.mf, doc/mailfromd.texi: Use <> in #include
2307 statements
2308
2309 2007-04-17 Sergey Poznyakoff <gray@gnu.org.ua>
2310
2311 * src/engine.c (mailfromd_daemon): Do not call
2312 mu_daemon_remove_pidfile, this results in a duplicate free at
2313 exit (compensate for mailutils bug)
2314 * src/bi_dns.m4 (getmx): Fix iteration over mxbuf
2315
2316 2007-04-16 Sergey Poznyakoff <gray@gnu.org.ua>
2317
2318 * src/mu_dbm.c, src/mu_dbm.h: Use external lock file for Berkeley
2319 DB (argghh)
2320 * src/mailfromd.h, src/db.c, src/main.c: Implement pragma option
2321 state-directory
2322 * tests/etc/config.in: Use #pragma option state-directory
2323 * doc/mailfromd.texi: Document #pragma option state-directory
2324
2325 * gacopyz/gacopyz.c (shan_connect): Fix packet length calculation.
2326 * NEWS: Update
2327
2328 * src/prog.c (instr_restex): Fix stack addressing (broken after
2329 2007-04-01). Add trace output.
2330
2331 2007-04-12 Sergey Poznyakoff <gray@gnu.org.ua>
2332
2333 * src/mu_dbm.c: Re-implement database locking for Berkeley DB
2334
2335 * src/mu_dbm.c, src/mu_dbm.h (mu_dbm_strerror): New function
2336 (mu_dbm_firstkey, mu_dbm_nextkey): Change signature
2337 * src/dnscache.c, src/db.c, src/cache.c, src/rate.c,
2338 src/bi_db.m4: Update for new mu_dbm interface.
2339
2340 2007-04-11 Sergey Poznyakoff <gray@gnu.org.ua>
2341
2342 * src/engine.c, src/mailfromd.h, src/prog.c, src/main.c,
2343 TODO, doc/mailfromd.texi: Provide a special exception type for
2344 unresolved sendmail macros.
2345
2346 2007-04-04 Sergey Poznyakoff <gray@gnu.org.ua>
2347
2348 * doc/mailfromd.texi, NEWS: Document SPF functions
2349
2350 2007-04-03 Sergey Poznyakoff <gray@gnu.org.ua>
2351
2352 * src/engine.c (concat_args): Print all arguments in debuging
2353 mode.
2354 (mailfromd_daemon): Set single-process mode if requested
2355 (mlfi_abort): Do not call filter_cleanup.
2356
2357 * src/mailfromd.h (single_process_option): New variable
2358 * src/prog.c: Fix initialization of toh and computation of
2359 heap bounds in gc.
2360 * src/main.c: New option --single-process (Do not use, unless you
2361 know what you are doing!)
2362 * gacopyz/smfi.c, gacopyz/gacopyz.h (smfi_set_foreground): New
2363 function.
2364
2365 2007-04-02 Sergey Poznyakoff <gray@gnu.org.ua>
2366
2367 * src/gram.y (FOR ..) takes a stmtlist
2368 * src/bi_string.m4 (substr): Extra argument check
2369 * src/bi_dns.m4 (dns_getaddr, dns_getname): New functions
2370 * src/prog.c (expand_dataseg): Update `base'
2371 * doc/mailfromd.texi: Update
2372
2373 * src/gram.y (loop_parm): Is a stmtlist
2374 * src/prog.c (instr_echo): Pop the argument
2375
2376 2007-04-01 Sergey Poznyakoff <gray@gnu.org.ua>
2377
2378 * src/lex.l, src/stack.c, src/gram.y, src/drivers.c,
2379 src/mailfromd.h, src/prog.h, doc/mailfromd.texi, NEWS: Implement
2380 loop statement.
2381 * etc/mailfromd.rc: Replace `next' with `pass'
2382
2383 * src/prog.c (s_off_cmp): Revert sorting order to match that of
2384 heap growth.
2385
2386 * src/drivers.c (code_memref, code_type_arg),
2387 src/prog.c (struct eval_environ, adjust_stack, env_base, get_arg)
2388 (push, pop, heap_reserve_words, heap_tempspace, heap_max_tempspace)
2389 (heap_fix_tempspace, instr_xchg, instr_dup, env_init)
2390 (env_make_frame, env_leave_frame, eval_environment, env_final_gc),
2391 src/prog.h, NEWS, doc/mailfromd.texi: Revert stack growth
2392 direction. Expand stack as the need arises.
2393
2394 * src/gram.y (dataseg_layout): Make sure all global variables are
2395 subject to final_gc
2396
2397 2007-03-31 Sergey Poznyakoff <gray@gnu.org.ua>
2398
2399 Switch to flat address space model. Data space (and stack) contain
2400 only references to objects within the data space (virtual
2401 addresses), no actual pointers are passed.
2402
2403 * src/snarf.m4 (MF_ALLOC_HEAP, MF_COPY_STRING): Take two arguments
2404 (MF_BEGIN_TEMP_SPACE): Use env_data_ref
2405 (MF_VAR_SET_STRING): New macro
2406 * src/bi_poll.m4, src/bi_string.m4, src/bi_dns.m4, src/bi_spf.m4,
2407 src/bi_sa.m4, src/bi_vars.m4, src/bi_db.m4: Use new heap
2408 allocation macros.
2409 * src/drivers.c (code_memref, code_type_string): Use opcode_push
2410 (code_type_variable): Remove opcode_svalidate. This time for good
2411 * src/mailfromd.h (env_throw_0): Change signature
2412 * src/prog.c (struct eval_environ.stack): Remove. Use plain
2413 addressing model. All references updated.
2414 (env_reference,env_var_ref): Remove
2415 (heap_reserve_words, heap_reserve): Return offset into the data
2416 space instead of the pointer. All uses updated.
2417 (env_data_ref): New function
2418 * src/opcodes (MEMEXT,MEM,SVALIDATE): Remove
2419 * src/prog.h (env_data_ref): New function
2420 (heap_reserve_words): New function
2421 (heap_reserve): Return size_t
2422 * TODO: Update
2423
2424 * src/snarf.m4, src/prog.c, src/prog.h: Use different argument
2425 accessors for different argument types.
2426
2427 * src/drivers.c (code_type_bin, code_type_regex,
2428 optimize_type_regcomp, code_type_regcomp), src/mailfromd.h (struct
2429 regcomp_data), src/prog.c (register_regex, instr_regex,
2430 instr_regcomp, instr_regmatch, instr_regmatch_mx): Use reserved
2431 rt_regex slots for dynamically compiled regular expressions.
2432
2433 2007-03-28 Sergey Poznyakoff <gray@gnu.org.ua>
2434
2435 * src/Makefile.am, src/mtasim.c: mtasim supports standard options.
2436
2437 * src/drivers.c, src/prog.c, src/opcodes: Prepare the instruction
2438 set for array data type: remove PUSH_LITERAL, PUSH_IMMEDIATE,
2439 VARIABLE, AUTO, ARG; introduce instead MEM, MEMSTK, MEMEXT, DEREF;
2440 Change semantics of ASGN
2441
2442 2007-03-27 Sergey Poznyakoff <gray@gnu.org.ua>
2443
2444 * src/symtab.c, src/lex.l, src/gram.y, src/drivers.c,
2445 src/mailfromd.h, src/optab.opc, src/prog.c, src/opcodes,
2446 src/prog.h, src/main.c: Reimplement pre-compiled regular
2447 expressions.
2448
2449 2007-03-24 Sergey Poznyakoff <gray@gnu.org.ua>
2450
2451 * configure.ac, Makefile: Switch to Autotest based testsuite
2452 * testsuite/: Remove
2453 * tests/: New directory
2454 * tests/farg.at, tests/ismx.at, tests/atlocal.in, tests/catch.at,
2455 tests/catch01.at, tests/version.at, tests/cond02.at,
2456 tests/shadow.at, tests/cond04.at, tests/relayed02.at,
2457 tests/cond06.at, tests/testsuite.at, tests/invcidr.at,
2458 tests/ack.at, tests/accept.at, tests/bctx00.at,
2459 tests/switchn1.at, tests/greylist.at, tests/switchn3.at,
2460 tests/cidr2.at, tests/fctx00.at, tests/switchs1.at,
2461 tests/invip2.at, tests/switchs3.at, tests/poll02.at,
2462 tests/arg.at, tests/reject.at, tests/hostname.at,
2463 tests/resolve.at, tests/hasmx.at, tests/invcidr2.at,
2464 tests/macros.at, tests/cond01.at, tests/invip.at, tests/cond03.at,
2465 tests/relayed01.at, tests/numrcpt.at, tests/cond05.at,
2466 tests/prec.at, tests/strings.at, tests/rescname.at,
2467 tests/tempfail.at, tests/bctx01.at, tests/switchn2.at,
2468 tests/cidr1.at, tests/switchn4.at, tests/cidr3.at,
2469 tests/fctx01.at, tests/Makefile.am, tests/poll.at,
2470 tests/switchs2.at, tests/poll01.at, tests/ml.at, tests/switchs4.at,
2471 tests/poll03.at: New files
2472 * tests/etc: New directory
2473 * tests/etc/reject.rc, tests/etc/farg.rc, tests/etc/cidr.rc,
2474 tests/etc/catch.rc, tests/etc/catch01.rc, tests/etc/cond.rc,
2475 tests/etc/dns.rc, tests/etc/macros.rc, tests/etc/relayed.rc,
2476 tests/etc/shadow.rc, tests/etc/var.rc, tests/etc/numrcpt.rc,
2477 tests/etc/strings.rc, tests/etc/prec.rc, tests/etc/relayed.list,
2478 tests/etc/ack.rc, tests/etc/accept.rc, tests/etc/tempfail.rc,
2479 tests/etc/switch.rc, tests/etc/greylist.rc, tests/etc/poll-1.rc,
2480 tests/etc/sa01.rc, tests/etc/sa02.rc, tests/etc/poll.rc,
2481 tests/etc/sa03.rc, tests/etc/config.in, tests/etc/sa04.rc,
2482 tests/etc/ml.rc, tests/etc/arg.rc: Move from testsuite/etc
2483
2484 2007-03-22 Sergey Poznyakoff <gray@gnu.org.ua>
2485
2486 * src/gram.y, srv/drivers.c: Remove `next' node type
2487
2488 * src/drivers.c: New file. Code generation drivers.
2489 * src/gram.y: Include drivers.c and node-tab.c.
2490 * src/drv.awk: New file. Generate node-type.h and node-tab.c
2491 headers.
2492 * src/mailfromd.h: Include node-type.h instead of defining
2493 node_type.
2494 * src/Makefile.am: Add drivers.c, drv.awk and build rules for
2495 node-type.h and node-tab.c
2496
2497 2007-03-21 Sergey Poznyakoff <gray@gnu.org.ua>
2498
2499 * src/mailfromd.h (getmxip): New function
2500 * src/dns.c (getmxip): New function
2501 * src/bi_dns.m4: (getmx): New built-in
2502 * doc/mailfromd.texi: Document getmx
2503
2504 * src/prog.c (mx_match): Do not raise exception if mf_not_found is
2505 returned.
2506 * src/bi_sa.m4 (open_connection): Raise mf_url if unknown protocol
2507 is specified in the URL.
2508 * src/mtasim.c: Minor fix
2509
2510 2007-03-19 Sergey Poznyakoff <gray@gnu.org.ua>
2511
2512 * src/engine.c, src/gram.y, src/status.mfi, doc/mailfromd.texi:
2513 Implement connect handler. Pass additional argument to envfrom and
2514 envrcpt.
2515 * gacopyz/gacopyz.c (shan_connect): Bugfix
2516 * NEWS: Update
2517
2518 * src/mtasim.c (process_gacopyz_reply): Do not switch to quit
2519 state unless SMFIR_SHUTDOWN is received.
2520
2521 * testsuite/lib/mailfromd.exp: Use mtasim instead of sendmail
2522 * testsuite/etc/ml.pat, testsuite/etc/reject.pat: Adopt for
2523 mtasim.
2524 * gacopyz/server.c (gacopyz_srv_send_command): Bugfix
2525
2526 * src/gram.y, src/mailfromd.h, src/prog.c, src/opcodes: Code
2527 regex_flags along with regcomp.
2528 * src/bi_dns.m4 (primitive_hasmx): Do not free mxbuf if the lookup
2529 failed.
2530 * testsuite/mailfromd/hasmx.exp: Modify
2531
2532 * src/lex.l: Fix handling of double % and $ in literals
2533 * src/bi_ipaddr.m4 (len_to_netmask): Raise mf_range if n is out of
2534 range.
2535 * mflib/heloarg_test.mf: Fix typo
2536 * mflib/revip.mf: Revrite using IP built-ins
2537 * mflib/match_dnsbl.mf, mflib/strip_domain_part.mf,
2538 mflib/is_ip.mf, mflib/match_rhsbl.mf: Move detailed descriptions
2539 to the docs
2540 * mflib/revip.mf: Rewrite using ntohl().
2541
2542 * doc/mailfromd.texi: Update
2543 * doc/Makefile.am (check-mflib): New rule
2544 * NEWS: Update
2545
2546 2007-03-18 Sergey Poznyakoff <gray@gnu.org.ua>
2547
2548 * src/stack.c: New file
2549 * src/Makefile.am: Add stack.c
2550 * src/gram.y, src/mailfromd.h, doc/mailfromd.texi: Implement
2551 `#pragma regex push|pop'
2552 * mflib/match_dnsbl.mf, mflib/strip_domain_part.mf,
2553 mflib/heloarg_test.mf, mflib/is_ip.mf, mflib/revip.mf,
2554 mflib/match_rhsbl.mf, mflib/spf.mf, mflib/match_cidr.mf: preserve
2555 user regex settings.
2556
2557 * configure.ac, Makefile.am: Add mflib
2558 * NEWS: Update
2559
2560 * mflib: New subdirectory
2561 * mflib/match_dnsbl.mf, mflib/strip_domain_part.mf,
2562 mflib/heloarg_test.mf, mflib/is_ip.mf, mflib/safedb.mf,
2563 mflib/mx.mf, mflib/dns.mf, mflib/revip.mf, mflib/valid_domain.mf,
2564 mflib/match_rhsbl.mf, mflib/spf.mf, mflib/Makefile.am,
2565 mflib/match_cidr.mf: New files
2566
2567 * doc/Makefile.am: Remove extract.awk
2568 * doc/extract.awk: Remove
2569 * doc/mailfromd.texi: Update
2570
2571 * src/symtab.c, src/gram.y, src/mailfromd.h: Implement optional
2572 arguments for user functions
2573 * src/lex.l: Implement #include_once
2574 * src/prog.c (name_destroy): Free the object
2575 * src/bi_ipaddr.m4 (match_cidr): Remove. The function is
2576 implemented in MFL (mflib/match_cidr.mf)
2577
2578 * testsuite/lib/mailfromd.exp, testsuite/etc/cidr.rc,
2579 testsuite/etc/catch.rc, testsuite/etc/catch01.rc,
2580 etc/mailfromd.rc: Use includes when necessary
2581
2582 2007-03-17 Sergey Poznyakoff <gray@gnu.org.ua>
2583
2584 * src/snarf.m4, src/bi_dns.m4, src/bi_dns.m4, src/bi_sa.m4,
2585 src/bi_other.m4, src/bi_mail.m4, src/bi_db.m4: Use MF_THROW
2586 instead of MF_CATCH
2587
2588 * src/gram.y, src/mailfromd.h, src/prog.c, src/opcodes,
2589 src/prog.h, TODO: Provide access for outermost auto variables and
2590 parameters from catch blocks.
2591
2592 * testsuite/etc/hasmx.rc, testsuite/etc/dns.rc: Use primitive_
2593 functions.
2594
2595 * src/lex.l, src/gram.y, src/mailfromd.h, src/prog.c,
2596 src/opcodes: Implement throw statement
2597 * src/bi_dns.m4 (match_cidr): Move into bi_ipaddr.m4
2598 * src/bi_ipaddr.m4: New module
2599 * src/Makefile.am: Add bi_ipaddr.m4
2600 * doc/mailfromd.texi: Initial doc for IP functions
2601 * NEWS: Update
2602
2603 2007-03-15 Sergey Poznyakoff <gray@gnu.org.ua>
2604
2605 * src/dnsbase.c (comp_pref): Secondary ordering by MX name
2606 * src/main.c, testsuite/lib/mailfromd.exp, doc/mailfromd.texi:
2607 Discontinue support for the old semantics of options -c, -l and -L.
2608 * doc/Makefile.am (check-exceptions): Fix the rule
2609 * NEWS: Update
2610
2611 * src/engine.c, src/gram.y, src/dnsbase.c, src/mtasim.c: Minor
2612 stylistic and bug fixes.
2613
2614 2007-03-12 Sergey Poznyakoff <gray@gnu.org.ua>
2615
2616 * doc/mailfromd.texi (Data Types): Fix description of numeric
2617 data type implementation.
2618
2619 * etc/Makefile.am (DEFAULT_PIDFILE): Fix the leftover usage of
2620 MAILFROMSTATEDIR
2621 * src/engine.c (check_on_host): Break sender email iteration if
2622 the server tempfails.
2623
2624 2007-03-10 Sergey Poznyakoff <gray@gnu.org.ua>
2625
2626 * src/mtasim.c: Implement basic milter support
2627 Implement long options.
2628 * gacopyz/gacopyz.h, gacopyz/gacopyz_priv.h, gacopyz/server.c: Update
2629
2630 2007-03-09 Sergey Poznyakoff <gray@gnu.org.ua>
2631
2632 * src/engine.c, src/gram.y, src/mailfromd.h: Implement prog data
2633 * src/mtasim.c: Implement headers
2634 * gacopyz/gacopyz_priv.h, gacopyz/gacopyz.c: Fix processing of
2635 data and eoh
2636 * gacopyz/server.c: Implement most of the stuff
2637
2638 * src/mtasim.c: Implement mail from and rcpt to
2639 * gacopyz/gacopyz.h: Likewise
2640 * gacopyz/gacopyz_priv.h: Likewise
2641 * gacopyz/log.c: Likewise
2642 * gacopyz/server.c: Likewise
2643 * gacopyz/io.c: Likewise
2644
2645 2007-03-07 Sergey Poznyakoff <gray@gnu.org.ua>
2646
2647 * src/Makefile.am: Allow to specify the m4 binary.
2648
2649 * src/prog.c (env_push_string): Use pushs. This makes sure that
2650 the handler arguments are allocated in heap, which is necessary
2651 for normal functioning of the gc.
2652 * src/engine.c (mlfi_body): Pass bodyp as number. This is a
2653 temporary kludge.
2654 * testsuite/etc/ack.rc: The above change needs extra 2 words for
2655 the stack allocation.
2656
2657 * NEWS: Update
2658
2659
2660 2007-03-02 Sergey Poznyakoff <gray@gnu.org.ua>
2661
2662 * src/symtab.c (function_install): Init statemask
2663 * src/gram.y: Fix builtin context checks. Implement function
2664 context checks.
2665 * src/mailfromd.h (struct function): New member `statemask'
2666 * src/Makefile.am: Exempt mtasim from installcheck
2667 * testsuite/mailfromd/functx.exp: New testcase
2668 * testsuite/mailfromd/DISTFILES: Add functx.exp
2669 * testsuite/etc/Makefile.am: Add sa*.rc
2670 * testsuite/etc/sa01.rc, testsuite/etc/sa02.rc,
2671 testsuite/etc/sa03.rc, testsuite/etc/sa04.rc: New files.
2672
2673 * NEWS: Update
2674
2675 Start implementing test MTA simulator.
2676
2677 * src/mtasim.c: New file
2678 * src/gram.y: Minor fixes
2679 * src/main.c: New option --gacopyz-debug
2680 * src/Makefile.am: Build nullmta
2681 * gacopyz/io.c: New file
2682 * gacopyz/server.c: New file
2683 * gacopyz/gacopyz.h, gacopyz/gacopyz_priv.h, gacopyz/log.c,
2684 gacopyz/gacopyz.c, gacopyz/Makefile.am: Start implementing server
2685 code.
2686
2687 2007-02-21 Sergey Poznyakoff <gray@gnu.org.ua>
2688
2689 * src/spf.c (spf_data): Add mech
2690 (parse_record): Always allocate expr_space
2691 * src/bi_spf.m4 (update_spf_vars): Bugfix
2692 * src/prog.c (instr_backref): Allow to reference optional groups
2693 * src/Makefile.am (noinst_HEADERS): Add spf.h
2694
2695 * src/lex.l: New built-in macro __statedir__
2696 * NEWS: Update
2697 * src/mailfrom.h: Finally renamed to
2698 * src/mailfromd.h: this
2699
2700 Affected files:
2701
2702 * src/symtab.c, src/mu_dbm.c, src/engine.c, src/snarf.m4,
2703 src/dnscache.c, src/gram.y, src/dnsbase.c, src/dns.c, src/db.c,
2704 src/spf.c, src/spf.h, src/cache.c, src/optab.opc, src/prog.c,
2705 src/mf-status.mfi, src/main.c, src/Makefile.am, src/rate.c
2706
2707 2007-02-20 Sergey Poznyakoff <gray@gnu.org.ua>
2708
2709 * src/gram.y (constdecl): Return NULL. Fixes coredump if const is
2710 used within a code block.
2711
2712 2007-02-19 Sergey Poznyakoff <gray@gnu.org.ua>
2713
2714 * src/mailfrom.h (node_type_noop): New node type
2715 * src/gram.y: Allow declarations of initialized variables.
2716 (print_node) <node_type_return>: Fix coredump on void returns
2717 (optimize_node): Fix coredump on `if 0 <expr>'
2718 * NEWS: Update
2719
2720 * src/spf.c: Change handling of modifiers.
2721
2722 * src/dnsbase.c, src/spf.c, src/dns.h, src/spf.h,
2723 bi_spf.m4: Change calling convention for the interface
2724 functions (spf_query_t, spf_answer_t); fix IP address comparisons;
2725 implement builtin spf variables
2726
2727 2007-02-18 Sergey Poznyakoff <gray@gnu.org.ua>
2728
2729 * src/spf.c: Implement all modifiers, improve debugging.
2730
2731 2007-02-17 Sergey Poznyakoff <gray@gnu.org.ua>
2732
2733 * src/dnsbase.c (_getmx, dns_get_mx_records): ttl can be NULL
2734 * src/spf.c: Implement all mechanisms
2735
2736 * src/spf.c, src/spf.h: Templates for SPF support
2737 * src/bi_spf.m4: Interface definitions for SPF support
2738 * src/dns.c: Move generic DNS calls to dnsbase.c. Retain only
2739 interface calls.
2740 * src/dnsbase.c, src/dns.h: Generic DNS support
2741
2742 * src/mailfrom.h: Move generic DNS declarations to dns.h
2743 * src/engine.c, src/bi_dns.m4, src/prog.c: Rename freemx to
2744 dns_freemx
2745 * src/main.c: Fix warning message wording
2746 * src/Makefile.am: Add new sources
2747 * bootstrap (MODLIST): Add memrchr
2748
2749 2007-02-11 Sergey Poznyakoff <gray@gnu.org.ua>
2750
2751 * gacopyz/trans.awk: Always quote /dev/stderr
2752
2753 2007-02-08 Sergey Poznyakoff <gray@gnu.org.ua>
2754
2755 Move version control under SVN. Remove .cvsignore files.
2756 CVS copy kept around for references.
2757
2758 2007-01-24 Sergey Poznyakoff <gray@gnu.org.ua>
2759
2760 * doc/mailfromd.texi: Update
2761 * src/gram.y: Change deprecation warning.
2762
2763 * gacopyz/proc.c (gacopyz_cleanup_conn): Print debugging message;
2764 Do not display spurious 'signal 15' messages
2765 * src/engine.c (mailfromd_daemon): Improve logging
2766
2767 * src/main.c: Hide deprecated command line options
2768
2769 * src/bi_vars.m4 (builtin_post_setup): Use string_alloc to
2770 allocate literals
2771 * src/mailfrom.h (DEFAULT_FROM_ADDRESS): New define
2772 * src/main.c: Use DEFAULT_FROM_ADDRESS
2773
2774 * src/gram.y: Store xlat tables in the data segment.
2775 * src/prog.c: Likewise
2776 * src/mailfrom.h (struct switch_stmt): Additional fields to help
2777 code generation
2778 * src/opcodes (XLAT, XLATS): instruction data has 2 words
2779 * src/optab.opc (scan_code): Remove special handling for xlat(s)
2780
2781 Create a relocatable code. Fixup relocatable references before
2782 entering the working mode.
2783
2784 * src/optab.opc: New file
2785 * src/optab.oph: New file
2786 * src/opcode.awk: New file
2787 * src/opcodes: New file
2788 * src/Makefile.am: Add optab.opc, optab.oph, opcode.awk
2789 * src/gram.y: Use code_op instead of code_instr
2790 * src/mailfrom.h (instr_*): Remove prototypes.
2791 (code_op, fixup_code): New prototypes.
2792 * src/main.c (main): Call fixup code
2793 * src/mf-status.mfi: Indicate c mode for emacs.
2794 * src/prog.c (prog): Remove static qualifier
2795 (code_op): New function
2796 (dump_*): Change number of arguments
2797 (optab,find_op): Remove
2798 (dump_code): Rewrite using scan_code
2799 (fixup_code): New function
2800 (print_code): Rewrite using dump_code
2801 * src/prog.h (struct optab): New data type
2802 (scan_code): New function
2803 (prog): extern decl
2804
2805 2007-01-22 Sergey Poznyakoff <gray@gnu.org.ua>
2806
2807 * NEWS: Update
2808 * doc/mailfromd.texi: Update
2809 * etc/mailfromd.rc: Remove pragma option mailfrom and ehlo
2810 * src/gram.y,src/symtab.c: Use parse_warning where appropriate
2811 * src/lex.l, src/mailfrom.h (parse_warning)
2812 (parse_warning_locus): New functions
2813 * src/main.c: Print informative warning messages where
2814 (pragma or command line option) ehlo or mailfrom is used
2815
2816 2007-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2817
2818 * NEWS: Update
2819 * doc/mailfromd.texi: Update
2820 * src/bi_vars.m4 (builtin_post_setup): smtp_domain and
2821 postmaster_email removed.
2822 * src/gram.y: Bugfix
2823 * src/main.c (smtp_domain,postmaster_email): Remove
2824 --ehlo and --mailfrom deprecated
2825
2826 * gacopyz/context.c (smfi_setpriv, smfi_getpriv): Rename to
2827 gacopyz_*
2828 * gacopyz/gacopyz.h (gacopyz_setpriv, gacopyz_getpriv): New
2829 functions.
2830 * src/bi_other.m4, src/bi_sa.m4: Minor fixes.
2831 * src/db.c (db_format_enumerate, db_format_install)
2832 (db_format_lookup): New functions
2833 * src/dns.c (_resolve_ipstr): Always copy ipstr to namebuf
2834 * src/engine.c (MLFIPRIV): Remove unused macro. Use gacopyz_
2835 calls instead of smfi_ ones, except for initialization functions.
2836 * src/gram.y: Provide for deferred variable initialization (to
2837 initialize variables from the command line).
2838 * src/lex.l (free_string_space, mf_strdup): New functions
2839 * src/mailfrom.h (struct old_header_node.name): const
2840 (SYM_DB_FORMAT): Remove macro
2841 (free_symbols,defer_initialize_variable,free_string_space)
2842 (db_format_enumerate): New functions.
2843 * src/main.c (options, parse_opt): New option -v
2844 (mailfromd_expire, mailfromd_compact)
2845 (mailfromd_show_defaults): Use db_format_enumerate instead of
2846 symbol_enumerate
2847 (main): Free symbol and string space after compiling the script.
2848 * src/prog.c (env_reference): Minor enhancement
2849 (env_set_variable): Fix call to mu_error
2850 * src/symtab.c (union symentry): Remove v.db
2851 (free_symbols): New function
2852 (db_format_install, db_format_lookup): Remove. Reimplement in db.c
2853 * testsuite/mailfromd/catch.exp: Update invocations of mailfromd
2854
2855 2007-01-19 Sergey Poznyakoff <gray@gnu.org.ua>
2856
2857 * doc/mailfromd.texi: Update
2858 * src/prog.c (struct optab): Fix opname for instr_asgn
2859 (env_final_gc): Bugfix
2860
2861 * doc/Makefile.am (check-exceptions): Fix rule
2862 * doc/mailfromd.texi: Update
2863 * src/gram.y (asgn:): Remove erroneous flag assignement
2864 (branch:): Warn about legacy constant usage only once
2865 (LOCUS_EQ): Moved to mailfrom.h
2866 (code_node): Restore svalidate - synch with 3.1 branch.
2867 Call MARK_LOCUS under node_type_result
2868 * src/lex.l: Warn about legacy constant usage only once
2869 Implement #error.
2870
2871 * etc/mailfromd.rc: Update
2872 * src/main.c (main): Remove call to builtin_post_setup.
2873 * src/prog.c (instr_variable): Print more trace info
2874 (instr_svalidate): Restore - synch with 3.1 branch.
2875
2876 2007-01-18 Sergey Poznyakoff <gray@gnu.org.ua>
2877
2878 * src/gram.y: Do not compile autogenerated functions at once.
2879 Expand unprefixed named constants only when a value is expected
2880 * src/lex.l: Likewise
2881 * src/mailfrom.h (struct stmtlist): New data type
2882
2883 2007-01-17 Sergey Poznyakoff <gray@gnu.org.ua>
2884
2885 * NEWS: Update
2886 * configure.ac: Raise patchlevel to 91
2887 * doc/mailfromd.texi: Update
2888 * src/Makefile.am (status.mfh, mf-status.c): New built sources
2889 * src/mfstat.awk: New file
2890 * src/status.mfi: New file
2891 * src/mf-status.mfi: New file
2892 * src/mailfrom.h, src/bi_dns.m4 (mf_resolve): Rename to mf_noresolve
2893 * src/gram.y (string: STRING): Fix incorrect argument to parse_error
2894 (parse_program): Remove call to post_parse
2895 (branch: WHEN): Issue deprecation warning if &const is used.
2896 (string_to_stat, mf_status_str): Defined in separate source
2897 * src/lex.l (lex_setup): Change default include path
2898 Issue deprecation warning if &const is used.
2899 Allow to use constants both in the program text and in literals
2900 * src/prog.c (string_off,string_count): Removed. Relocation table
2901 is used instead.
2902 * src/prog.h (post_parse): Remove
2903 * testsuite/etc/catch.rc: Include <status.mfh>, do not use &const.
2904 * testsuite/etc/catch01.rc: Likewise
2905 * testsuite/etc/hasmx.rc: Likewise
2906 * testsuite/etc/poll-1.rc: Likewise
2907 * testsuite/etc/poll.rc: Likewise
2908 * testsuite/lib/mailfromd.exp: Update include path
2909
2910 2007-01-14 Sergey Poznyakoff <gray@gnu.org.ua>
2911
2912 * src/gram.y, src/lex.l, src/mailfrom.h, src/prog.c: Store
2913 locus.file in the dataseg.
2914
2915 * src/gram.y: Implement const declarations
2916 * src/lex.l: Likewise
2917 * src/mailfrom.h: Likewise
2918 * src/symtab.c: Likewise
2919 * src/main.c: Minor change
2920 * src/prog.c: Minor change
2921
2922 2007-01-13 Sergey Poznyakoff <gray@gnu.org.ua>
2923
2924 * gacopyz/gacopyz.h (GACOPYZ_VBUFSIZE): New define
2925 (gacopyz_format_vbuf): New decl
2926 * gacopyz/log.c (VBUFSIZE): Rename to GACOPYZ_VBUFSIZE
2927 (format_vbuf): Rename to gacopyz_format_vbuf; make extern
2928 * src/bi_mail.m4, src/bi_sa.m4, src/bi_system.m4, src/cache.c,
2929 src/dns.c, src/dnscache.c, src/engine.c, src/main.c,
2930 src/rate.c: Minor fixes
2931 * src/bi_vars.m4 (builtin_post_setup): Change initialization of
2932 ehlo_domain and mailfrom_address.
2933 * src/gram.y, src/mailfrom.h, src/prog.c, src/symtab.c: Use
2934 literals instead of string pointers.
2935 Each string reference in the resulting program should point
2936 within the current stack or data space (except for the values of
2937 Sendmail macros).
2938 * src/lex.l (string_alloc,string_finish): Return literal
2939
2940 2007-01-06 Sergey Poznyakoff <gray@gnu.org.ua>
2941
2942 * src/bi_vars.m4 (builtin_post_setup): Change initialization of
2943 ehlo_domain and mailfrom_address built-in variables.
2944 * src/gram.y: Put string values initially assigned to the
2945 variables into the data segment. Redo its planning.
2946 Process only variables marked as volatile (built-in) or as
2947 referenced.
2948 (builtin_variable_install): Initialize flags.
2949 (vardecl): Remove initialization of var->off
2950 (externdecl): Change declaration.
2951 (initialize_variable,ensure_initialized_variable)
2952 (dataseg_layout): New functions
2953 * src/prog.c: Redo data segment initialization and handling.
2954 (dataseg,datasize,dataseg_reloc,dataseg_reloc_count): New
2955 variables
2956 (struct eval_environ.var): Rename to dataseg
2957 * src/prog.h (B2STACK): New macro (moved from prog.c)
2958 (variable_declared_p,declare_variable): Removed
2959 (ensure_initialized_variable): New function
2960 (dataseg,datasize,dataseg_reloc,dataseg_reloc_count): New externs
2961
2962 2007-01-04 Sergey Poznyakoff <gray@gnu.org.ua>
2963
2964 * TODO: Update
2965 * src/engine.c (smtp_last_received): Remove superfluous
2966 conditional
2967 (method_strict,method_standard): Set last_poll_* variables to "",
2968 not NULL
2969 * src/gram.y: First build the entire tree, than compile it at
2970 once.
2971 Fix varaible shadowing.
2972 Reorganize lexical tie-ins.
2973 * src/lex.l: New keyword `const'.
2974 (parse_error,parse_error_locus): Increase buffer size to 512.
2975 * src/mailfrom.h (enum lexical_context): New data type.
2976 (struct catch_node.context): New field
2977 (struct progdecl, struct funcdecl): New data types.
2978 (enum node_type): Add new types: node_type_funcdecl and
2979 node_type_progdecl.
2980 (struct node.v): New members progdecl and funcdecl
2981 (VAR_REFERENCED): New macros
2982 (struct variable): New fields next and owner
2983 (variable_replace): New function
2984 * src/symtab.c (init_variable): New function
2985 (variable_install): Use init_variable
2986 (variable_replace): New function
2987 * testsuite/etc/shadow.rc: New file
2988 * testsuite/etc/Makefile.am (RCFILES): Add shadow.rc
2989 * testsuite/mailfromd/shadow.exp: New file
2990 * testsuite/mailfromd/DISTFILES: Add shadow.exp
2991
2992 2006-12-27 Sergey Poznyakoff <gray@gnu.org.ua>
2993
2994 * doc/mailfromd.texi: Fix typo
2995
2996 2006-12-25 Sergey Poznyakoff <gray@gnu.org.ua>
2997
2998 * configure.ac: Do not quote DEFAULT_LOG_FACILITY
2999 * NEWS: update
3000 * src/bi_string.m4 (unfold) new function
3001 * src/engine.c (check_on_host): Issue RSET if the previous MAIL
3002 FROM returned 4xx
3003 (mlfi_helo): Push malloced copy of helohost
3004 * src/main.c (option_deprecated): mark as warning.
3005
3006 2006-12-21 Sergey Poznyakoff <gray@gnu.org.ua>
3007
3008 * NEWS: Update
3009 * src/bi_string.m4 (message_header_decode, message_header_encode):
3010 New functions.
3011
3012 2006-12-15 Sergey Poznyakoff <gray@gnu.org.ua>
3013
3014 * NEWS: Update
3015 * TODO: Update
3016 * doc/mailfromd.texi: Update the description of resolve and the
3017 code of match_dnsbl and match_rhsbl
3018 * src/bi_dns.m4 (resolve): Take an optional second argument
3019 * src/dns.c (is_ipaddr): Stricter check
3020 (struct loop_data.atype): New member
3021 (cnameloop): Return the type of obtained answer in atype
3022 (_resolve_ipstr): Additional argument: domain to look up into. If
3023 not NULL, the ipstr is not reversed
3024 (resolve_ipstr_domain): New function
3025 (resolve_ipstr): Rewrite using resolve_ipstr_domain
3026 (_resolve_hostname): Convert IP to string if gotten T_A. All
3027 callers updated.
3028 * src/lex.l: Allow `==' as well as `='
3029 * src/mailfrom.h (resolve_ipstr_domain): New function
3030
3031 * src/main.c (switch_to_privs): Refuse to run as root
3032 * doc/mailfromd.texi: Fix typo.
3033 * bi_io.m4, db.c, dnscache.c, engine.c, gram.y, lex.l, main.c,
3034 prog.c: Capitalize diagnostic messages
3035
3036 2006-12-14 Sergey Poznyakoff <gray@gnu.org.ua>
3037
3038 * NEWS: Update
3039 * configure.ac: New configuration variable DEFAULT_LOG_FACILITY
3040 * doc/mailfromd.texi: Update
3041 * src/main.c (main): Set log_facility.
3042
3043 * src/lex.l: Allow any amount of whitespace between the function
3044 name and the opening parenthesis.
3045 * src/lex.l: Fix the previous patch
3046 * src/gram.y: Revert accidental commit
3047
3048 2006-12-13 Sergey Poznyakoff <gray@gnu.org.ua>
3049
3050 Synchronization with 3.1 branch:
3051
3052 * NEWS, configure.ac: Version 3.1.90
3053 * doc/mailfromd.texi: Fix typo
3054 * src/bi_sa.m4 (spamd_send_stream): Assume captured stream already
3055 has \r in front of each \n
3056 (clamav): always shutdown data stream as a fd-style stream.
3057 * src/dns.c (_resolve_ipstr): First argument is const
3058 (resolve_ipstr,resolve_hostname): First argument is const
3059 * src/dnscache.c (parse_value,dns_make_key)
3060 (dns_cache_get,dns_cache_put): keystr is const
3061 * src/gram.y (optimize_node): Fix typo that caused correct
3062 `matches' conditions to be rejected (e.g. strip_domain_part.mf)
3063 * src/mailfrom.h (resolve_ipstr,resolve_hostname): First argument
3064 is const
3065 (dns_cache_get,dns_cache_put): keystr is const
3066 * src/snarf.m4 (MF_BEGIN_TEMP_SPACE): Do not terminate with a
3067 semicolon, since the statement is supposed to be used in argument
3068 declarations.
3069
3070 2006-12-13 Sergey Poznyakoff <gray@gnu.org.ua>
3071
3072 * NEWS: Update
3073 * doc/mailfromd.texi: Fix typo
3074 * src/bi_sa.m4 (spamd_send_stream): Assume captured stream already
3075 has \r in front of each \n
3076 (clamav): always shutdown data stream as a fd-style stream.
3077 * src/dns.c (_resolve_ipstr): First argument is const
3078 (resolve_ipstr,resolve_hostname): First argument is const
3079 * src/dnscache.c (parse_value,dns_make_key)
3080 (dns_cache_get,dns_cache_put): keystr is const
3081 * src/gram.y (optimize_node): Fix typo that caused correct
3082 `matches' conditions to be rejected (e.g. strip_domain_part.mf)
3083 * src/mailfrom.h (resolve_ipstr,resolve_hostname): First argument
3084 is const
3085 (dns_cache_get,dns_cache_put): keystr is const
3086 * src/snarf.m4 (MF_BEGIN_TEMP_SPACE): Do not terminate with a
3087 semicolon, since the statement is supposed to be used in argument
3088 declarations.
3089
3090 2006-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
3091
3092 * src/Makefile.am (install-data-local): Rename leftover
3093 MAILFROMSTATEDIR
3094 * src/rate.c (get_rate): Bug fix: attempt to free auto storage
3095
3096 2006-12-07 Sergey Poznyakoff <gray@gnu.org.ua>
3097
3098 * NEWS, configure.ac: Version 3.1
3099
3100 2006-12-06 Sergey Poznyakoff <gray@gnu.org.ua>
3101
3102 * NEWS, configure.ac: Update patchlevel
3103 * doc/mailfromd.texi: Finished docs for 3.1
3104
3105 * configure.ac (MAILFROMSTATEDIR): Rename to DEFAULT_STATE_DIR
3106 * src/Makefile.am: Likewise
3107 * src/mailfrom.h: Likewise
3108 * src/main.c: Likewise
3109 * src/bi_dns.m4 (resolve): Return "0" if the argument is not
3110 resolved.
3111 * src/gram.y: Mark comparison operators as nonassoc
3112
3113 * doc/Makefile.am (extract): Handle include dependencies
3114 * doc/extract.awk: Handle @multitable blocks. Print a diagnostic
3115 message if some other function is required
3116 * doc/mailfromd.texi: Almost finished
3117 * doc/fdl.texi: Fix overfull hblock
3118
3119 2006-12-05 Sergey Poznyakoff <gray@gnu.org.ua>
3120
3121 * NEWS: Update
3122 * doc/Makefile.am: Minor change
3123 * doc/mailfromd.texi: Update
3124 * src/gram.y (print_locus): Bugfix
3125 * testsuite/etc/config.in: Remove extra space
3126
3127 * NEWS: Update
3128 * doc/untabify.el: New file
3129 * doc/Makefile.am (EXTRA_DIST): Add untabify.el
3130 (check-format,untabify,final): New targets
3131 * doc/mailfromd.texi: Consistently use `filter script' instead of
3132 `configuration file'. Add some missing information.
3133 * etc/rc.in: Do not use obsolete -c option to mailfromd
3134 * testsuite/lib/mailfromd.exp, testsuite/mailfromd/ack.exp,
3135 testsuite/mailfromd/arg.exp, testsuite/mailfromd/catch.exp,
3136 testsuite/mailfromd/cidr.exp, testsuite/mailfromd/cond.exp,
3137 testsuite/mailfromd/dns.exp, testsuite/mailfromd/hasmx.exp,
3138 testsuite/mailfromd/macros.exp, testsuite/mailfromd/poll.exp,
3139 testsuite/mailfromd/prec.exp, testsuite/mailfromd/relayed.exp,
3140 testsuite/mailfromd/strings.exp, testsuite/mailfromd/switch.exp,
3141 testsuite/mailfromd/var.exp: Likewise
3142
3143 * src/Makefile.am (builtin.h): Depend on M4_FILES
3144
3145 * src/gram.y, src/mailfrom.h, src/main.c: Remove -c option. Remove
3146 the inconsistent usage of `config_' prefix.
3147 * src/lex.l: Allow hex numbers to be prefixed with 0X as well.
3148
3149 2006-12-04 Sergey Poznyakoff <gray@gnu.org.ua>
3150
3151 * NEWS: Update
3152 * src/bi_mail.m4: New file
3153 * src/Makefile.am: Add bi_mail.m4
3154 * src/main.c: Use "mailer" capability
3155
3156 * NEWS: Update
3157 * doc/mailfromd.texi: Update
3158 * src/dns.c (get_mx_records): Use resolve_ipstr to resolve IP
3159 addresses.
3160 * src/gram.y: Implement bitwise operators: &, |, ^, ~
3161 Implicit declarations within functions create automatic
3162 variables.
3163 * src/lex.l: Accept C-like notations for hex and octal numbers.
3164 * src/mailfrom.h: Implement bitwise operations
3165 * src/prog.c: Likewise
3166
3167 * NEWS: Update
3168 * configure.ac: There's no use to pass MAILFROMSTATEDIR and
3169 DEFAULT_SOCKET in config.h, revert to the prior scheme
3170 * src/Makefile.am (AM_CPPFLAGS): Likewise
3171 * gacopyz/proc.c (print_status): Log normal child exits at
3172 SMI_LOG_INFO priority
3173 * src/dnscache.c (dns_cache_get): Do not log error message if the
3174 file does not exist.
3175 Make sure rc is meaningful
3176 (dns_cache_put): Free temporary storage
3177 * src/lex.l: Implement search path for include files
3178 * src/mailfrom.h (add_include_dir): New proto.
3179 * src/main.c: New option -I (--include)
3180 * testsuite/etc/greylist.in: Remove
3181 * testsuite/etc/greylist.rc: New file
3182 * testsuite/etc/Makefile.am (RCFILES): Add config.in. Replace
3183 greylist.in with greylist.rc
3184 (noinst_DATA, CLEANFILES): Add config.rc, remove greylist.rc
3185 * testsuite/etc/.cvsignore: Add config.rc, remove greylist.rc
3186 * testsuite/etc/config.in: New file
3187 * testsuite/etc/dns.rc: Include config.rc
3188 * testsuite/etc/hasmx.rc: Likewise
3189 * testsuite/etc/greylist.pat: Remove :RCDIR instruction
3190 * testsuite/lib/mailfromd.exp (start_daemon,mailfromd_exec): Add
3191 -I option
3192 * testsuite/mailfromd/greylist.exp: Remove conditional
3193
3194 * NEWS: Update
3195 * configure.ac: Refuse to build without DBM.
3196 Pass all default values via config.h
3197 Print configuration summary at the end of the run.
3198 * doc/mailfromd.texi: Update
3199 * src/Makefile.am (AM_CPPFLAGS): Remove extra defines. These are
3200 now passed via config.h
3201 * src/bi_db.m4, src/cache.c, src/db.c, src/dnscache.c,
3202 src/mailfrom.h, src/main.c, src/rate.c [!USE_DBM]: Remove. DBM is
3203 now required.
3204
3205 2006-12-03 Sergey Poznyakoff <gray@gnu.org.ua>
3206
3207 * Makefile.am (alpha,alphacheck): New rules
3208 * NEWS: Update
3209 * configure.ac: Define DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL
3210 * doc/mailfromd.texi: Update
3211 * src/Makefile.am (AM_CPPFLAGS): Define
3212 DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL
3213 * src/dns.c (getmx,resolve_ipstr,resolve_hostname): Enable
3214 negative caching
3215 * src/dnscache.c (dns_cache_put): Fix calculation of the
3216 expiration date for negative records.
3217 (dns_cache_format_struct): Use
3218 DEFAULT_DNS_NEGATIVE_EXPIRE_INTERVAL
3219 * src/gram.y (pragma_database): Handle special cases for `database
3220 dns'.
3221 * src/main.c (db_format_enumerator): Likewise
3222 * testsuite/mailfromd/DISTFILES: Add dns.exp
3223
3224 * doc/mailfromd.texi: Document the dns database
3225
3226 * configure.ac: Check for unsigned 32-bit integer type
3227 * gacopyz/Makefile.am (noinst_PROGRAMS): Remove
3228 * gacopyz/gacopyz_priv.h: (MI_TIMEOUT): Rename to GACOPYZ_TIMEOUT
3229 (mi_uint32_t): Rename to gacopyz_uint32_t
3230 Set gacopyz_uint32_t based on the result of a configure check
3231 (MILTER_OPTLEN): Rename to GACOPYZ_OPTLEN
3232 * gacopyz/gacopyz.c: Likewise
3233 * src/dnscache.c: New file
3234 * src/Makefile.am: Add dnscache.c
3235 * src/bi_dns.m4: Rewrite using new dns functions
3236 * src/dns.c: Rewrite using global cache
3237 (resolve_hostname): New function
3238 (resolve_ipstr): Change signature
3239 * src/mailfrom.h (resolve_ipstr): Change prototype
3240 (resolve_hostname): New function
3241 (DEFAULT_DNS_DATABASE): New define
3242 (dns_cache_get,dns_cache_put): New functions
3243 * src/main.c (host_in_relayed_domain_p): Rewrite using new
3244 resolve_ipstr
3245 (db_format_setup): Initialize dns_cache_format
3246 * src/prog.c (struct eval_environ.dict): Remove. All uses updated.
3247 * testsuite/etc/dns.rc: New file
3248 * testsuite/etc/Makefile.am (RCFILES): Add dns.rc
3249 * testsuite/etc/dns.exp: New test case
3250 * testsuite/mailfromd/DISTFILES: Add dns.exp
3251
3252 2006-12-01 Sergey Poznyakoff <gray@gnu.org.ua>
3253
3254 * src/prog.c (env_final_gc): Free temporary storagee before
3255 returning.
3256
3257 2006-11-30 Sergey Poznyakoff <gray@gnu.org.ua>
3258
3259 * src/engine.c (mlfi_envfrom): print entire argument array in
3260 debug level 70
3261 (mlfi_envrcpt): Likewise.
3262
3263 * src/mailfrom.h (debug macros): Rewritten
3264
3265 * configure.ac: Raise patchlevel to 92
3266 * NEWS: Likewise.
3267
3268 2006-11-29 Sergey Poznyakoff <gray@gnu.org.ua>
3269
3270 * bootstrap: Minor change
3271 * doc/mailfromd.texi: Update
3272 * src/gram.y (print_node): Handle nonprintable characters in strings.
3273
3274 * NEWS: Update
3275 * src/engine.c (method_standard): Fix the call to
3276 set_last_poll_result.
3277 * src/gram.y: Implement cross-reference listing.
3278 * src/mailfrom.h (struct variable): New member xref.
3279 (env_final_gc): New proto.
3280 * src/main.c: New option --xref (--dump-xref)
3281 * src/prog.c: Implement simple GC for compacting the heap space.
3282 * src/prog.h (post_parse): New proto
3283
3284 2006-11-28 Sergey Poznyakoff <gray@gnu.org.ua>
3285
3286 * src/bi_poll.m4: Minor indentation fix
3287 * src/prog.c (instr_retcatch): Call env_leave_frame with nargs=1
3288 (env_catch pushes one argument)
3289 (env_init): Remove initialization of toh
3290 (create_environment): Initialize toh here (see the comment).
3291
3292 * src/gram.y (copy_node): New function
3293 (print_node): Print "STRING" for node_type_string
3294 (optimize_arith): Immediate calculations if one of the arguments
3295 is 0 or 1. Side effect: catches all types of division by zero
3296 errors.
3297 (optimize_node): Optimize concatenations with an empty string
3298 (codegen): Do not attempt to generate code if the optimization
3299 resulted in errors.
3300 * src/lex.l (parse_error_locus): Bugfix
3301 * src/prog.c (optab): Add missing entry (NEG)
3302
3303 * src/prog.c (eval_environment): Prevent coredumps on invalid
3304 PC values.
3305
3306 * src/bi_other.m4 (disable_program_trace): Rename to
3307 cancel_program_trace.
3308 * NEWS: Update
3309
3310 * src/bi_system.m4 (bi_strftime): Call MF_RETURN_TEMP_SPACE with
3311 an argument.
3312 * src/snarf.m4 (MF_RETURN_TEMP_SPACE): Bugfix - call
3313 heap_fix_tempspace.
3314 Take an optional argument specifying the size of the data stored
3315 in the temporary memory.
3316
3317 2006-11-27 Sergey Poznyakoff <gray@gnu.org.ua>
3318
3319 * src/builtin.def: New file
3320 * src/init.m4: New file
3321 * src/Makefile.am (noinst_HEADERS,EXTRA_DIST,BUILT_SOURCES): Add
3322 builtin.h, builtin.def, init.m4
3323 (.def.h): New rule
3324 * src/bi_db.m4, src/bi_dns.m4, src/bi_io.m4, src/bi_other.m4,
3325 src/bi_poll.m4, src/bi_sa.m4, src/bi_string.m4, src/bi_system.m4,
3326 src/bi_vars.m4: Use MF_INIT without arguments
3327 * src/mailfrom.h (__DBG): Change definition
3328 (enable_module_trace,disable_module_trace,enable_prog_trace)
3329 (disable_prog_trace,debug_level_p,enable_debug)
3330 (enable_debug_list,disable_debug_list): New functions
3331 (prog_trace_option): Remove declaration
3332 * src/main.c (disable_prog_trace,debug_level_p,enable_debug)
3333 (enable_debug_list,disable_debug_list): New functions
3334 The option --debug can take a comma-separated list of debug
3335 specifications.
3336 The option --trace-program takes as an optional argument a
3337 comma-separated list of modules to trace
3338 * src/prog.c, src/prog.h: Change to new tracing scheme
3339 * src/snarf.m4: Assume C comments
3340 (MF_MODULE_NAME,MF_MODULE_MASK): New defines
3341 (mf_prog_trace): New define
3342 (MF_DEFUN): Change to new tracing scheme
3343 (MF_INIT): Do not take a mandatory argument. Deduce the module
3344 name from the file name.
3345
3346 2006-11-25 Sergey Poznyakoff <gray@gnu.org.ua>
3347
3348 * src/prog.c (instr_symbol): Return the value using pushs, not
3349 push.
3350
3351 * NEWS: Update
3352 * doc/mailfromd.texi: Update
3353 * src/bi_db.m4 (dbput): Throw exception after closing the db
3354 (dbdel): New function
3355 * src/bi_system.m4 (system): Return exit code of the executed
3356 command.
3357 * src/gram.y: Allow constant expressions in top-level set
3358 statements.
3359
3360 2006-11-24 Sergey Poznyakoff <gray@gnu.org.ua>
3361
3362 * src/bi_system.m4 (strftime): New function
3363 * src/lex.l: Fix handling of escape sequences at the beginning of
3364 a string and before the beginning of an interpreted sequence
3365 within the string.
3366 * src/prog.c (heap_max_tempspace, heap_fix_tempspace): New
3367 functions.
3368 * src/prog.h: Likewise
3369 * src/snarf.m4 (MF_BEGIN_TEMP_SPACE,MF_END_TEMP_SPACE)
3370 (MF_RETURN_TEMP_SPACE): New macros
3371
3372 * src/gram.y: Various fixes
3373
3374 * src/bi_db.m4 (dbmap_lookup): Defval can be NULL
3375 Make sure returned string is null-terminated
3376 (dbput): New built-in function
3377 * src/bi_system.m4 (time): New built-in
3378 * src/gram.y (codegen): Two more arguments
3379 (forget_autos): Take number of parameters as an argument.
3380 Clear auto_list
3381 (BUILTIN_P): Renamed to BUILTIN_PROC
3382 (FUNCTION_P): Renamed to FUNCTION_PROC
3383 (BUILTIN_P,FUNCTION_P): New tokens. Lowest precedence
3384 Fix code generation for function arguments and the precedence of
3385 function or built-in calls without parens
3386 * src/lex.l (BUILTIN_P,FUNCTION_P): New tokens
3387 (IDENT}/"("): New rule
3388 * src/snarf.m4: Fix handling of zero argument count
3389 * src/symtab.c (remove_symbol): Fix assertion
3390 * testsuite/etc/farg.rc: New file
3391 * testsuite/etc/prec.rc: New file
3392 * testsuite/etc/Makefile.am (RCFILES): Add farg.rc and prec.rc
3393 * testsuite/mailfromd/DISTFILES: Add prec.exp
3394 * testsuite/mailfromd/arg.exp: Add new test (farg.rc)
3395
3396 2006-11-23 Sergey Poznyakoff <gray@gnu.org.ua>
3397
3398 * src/bi_io.m4: New file
3399 * src/bi_system.m4: New file
3400 * src/Makefile.am (RCFILES): Add bi_io.m4 and bi_system.m4
3401 * src/gram.y: Modify error handling and proccall production.
3402 Get rid of svalidate.
3403 * src/lex.l: New tokens FUNCTION_P and BUILTIN_P
3404 (parse_error,parse_error_locus): Increment error_count unless fmt
3405 begins with `warning:'.
3406 * src/mailfrom.h (mf_ioerr): New exception
3407 * src/prog.c: Keep builtin-specific private data in struct
3408 eval_environ.
3409 (builtin_priv_register,env_get_builtin_priv): New functions
3410 (builtin_setup): Call system_init_builtin and io_init_builtin
3411 * src/prog.h (env_get_builtin_priv)
3412 (builtin_priv_register, error_count): New declaration
3413 * src/snarf.m4 (MF_DECLARE_DATA,MF_GET_DATA): New macros
3414 * src/symtab.c (va_builtin_install_ex): Bugfix
3415 (variable_install, function_install): Init all members
3416
3417 2006-11-21 Sergey Poznyakoff <gray@gnu.org.ua>
3418
3419 * doc/mailfromd.texi: Document pragma stacksize
3420 * doc/values.texi: Update
3421 * src/gram.y: svalidate is not needed any more (I hope)
3422 * src/prog.c: Likewise
3423
3424 * src/gram.y: Fix the precedence of function calls and boolean
3425 negation.
3426 * doc/mailfromd.texi
3427
3428 2006-11-20 Sergey Poznyakoff <gray@gnu.org.ua>
3429
3430 * doc/mailfromd.texi: Document string and db functions
3431 * src/bi_db.m4 (dbmap_lookup): Avoid needless memory allocation
3432 * src/bi_string.m4 (toupper, tolower): Fix return type
3433 declarations
3434 (substr,rindex): Fix bugs
3435 * src/gram.y: Rewrite expression rules to properly handle
3436 concatenations and to reduce the number of conflicts.
3437 Compute automatic and parameter offsets locally
3438 Rewrite optimizer.
3439 * src/mailfrom.h (node_type_auto): Remove, node_type_variable does
3440 the job
3441 (VAR_VOLATILE,VAR_EXTERN): New defines (for future use)
3442 (struct variable): New member flags.
3443 * src/prog.c (dump_asgn): Bugfix
3444 * src/snarf.m4 (MF_VAR): Set VAR_VOLATILE by default
3445 * testsuite/etc/Makefile.am (RCFILES): Add strings.rc
3446 * testsuite/etc/strings.rc: New file
3447 * testsuite/mailfromd/strings.exp: New file
3448 * testsuite/mailfromd/DISTFILES: Add strings.exp
3449
3450 2006-11-18 Sergey Poznyakoff <gray@gnu.org.ua>
3451
3452 * bootstrap: New file
3453 * NEWS: Update
3454 * doc/values.texi (INITIAL-RESPONSE-TIMEOUT): Update.
3455 * doc/mailfromd.texi: Update
3456 * src/Makefile.am: Create MAILFROMSTATEDIR with the right
3457 privileges.
3458 * src/bi_db.m4 (dbmap): Take an optional third argument.
3459 (dbget): New built-in
3460 * src/bi_string.m4 (substr): New function
3461 * src/db.c: Use xmalloc instead of emalloc
3462 * src/lex.l: Likewise
3463 * src/main.c: Likewise
3464 (xalloc_die): New function
3465 * src/gram.y: Hanlde optional arguments to built-ins
3466 Use xmalloc instead of emalloc
3467 * src/mailfrom.h: Include xalloc.h
3468 (struct builtin): New member optcount
3469 (va_builtin_install_ex): take 8 mandatory arguments
3470 (emalloc): Remove
3471 (heap_tempspace): New function
3472 * src/prog.c (heap_tempspace): New function
3473 Use xmalloc instead of emalloc
3474 * src/prog.h (heap_tempspace): New function
3475 * src/snarf.m4: Handle OPTIONAL keyword
3476 (MF_ALLOC_HEAP_TEMP): New macro
3477 * src/symtab.c: Use xmalloc instead of emalloc
3478 (emalloc): Remove
3479 (find_and_remove): Fix coredump
3480
3481 2006-11-14 Sergey Poznyakoff <gray@gnu.org.ua>
3482
3483 * src/gram.y: Bug fixes
3484
3485 * NEWS: Update
3486 * configure.ac: Raise version to 3.0.91
3487 * doc/mailfromd.texi: Document -O option
3488 * src/gram.y: Implement code optimization
3489 * src/lex.l: Export string functions
3490 * src/mailfrom.h: Export string functions from lex.l
3491 * src/main.c: New option -O (--optimize)
3492
3493 * NEWS: Update
3494 * configure.ac: Define split version
3495 * doc/mailfromd.texi: Document built-in macros
3496 * src/lex.l: New built-in macros
3497 * src/mailfrom.h (function_name): New function
3498 * testsuite/etc/macros.rc: New file
3499 * testsuite/etc/Makefile.am (RCFILES): Add macros.rc
3500 * testsuite/etc/ack.rc: Use full type names
3501 * testsuite/mailfromd/macros.exp: New test case
3502 * testsuite/mailfromd/DISTFILES: Add macros.exp
3503
3504 2006-11-13 Sergey Poznyakoff <gray@gnu.org.ua>
3505
3506 * NEWS: Update
3507 * doc/mailfromd.texi: Document `echo' statement
3508 * src/gram.y: Remove legacy handling for `rate'
3509 (function_name): New function
3510 * src/lex.l: Remove legacy handling for `rate'
3511 New keywords __file__, __line__ and __function__
3512 * src/main.c (decode_debug): Remove legacy handling of `cdyl'
3513 flags.
3514 * etc/sendmail-8.13.7.diff: Removed
3515
3516 * NEWS: Update
3517 * README-alpha: Update
3518 * doc/mailfromd.texi: Update
3519 * src/bi_vars.m4 (numrcpt): Removed
3520
3521 2006-11-12 Sergey Poznyakoff <gray@gnu.org.ua>
3522
3523 * NEWS: Update
3524 * doc/mailfromd.texi: Rewrite function examples using the new
3525 style
3526 * src/gram.y: Allow for auto variables in handlers
3527 (print_node): Print variable offset with SET
3528 (forget_autos): Use find_and_remove to remove the variable from
3529 the symtab
3530 * src/symtab.c: Make sure symbol table entries do not change their
3531 address during rehashing
3532
3533 2006-11-11 Sergey Poznyakoff <gray@gnu.org.ua>
3534
3535 * src/gram.y, src/mailfrom.h, src/prog.c: Implement automatic
3536 variables
3537 * src/lex.l: Make sure N in $N is positive
3538
3539 * src/gram.y: Implement named function parameters and
3540 the framework for automatic variables.
3541 * src/mailfrom.h (storage_class_t): New type
3542 (struct variable): New members: storage_class, locus, shadowed
3543 (variable_remove): New function
3544 * src/symtab.c (remove_symbol): Split in two functions.
3545 (variable_remove): New function
3546
3547 2006-11-10 Sergey Poznyakoff <gray@gnu.org.ua>
3548
3549 * configure.ac: Remove the legacy section
3550 * gacopyz/Makefile.am: Inconditionally build the targets
3551 * src/bi_vars.m4: New file
3552 * src/ml.c: Remove
3553 * src/Makefile.am (M4_FILES): Add bi_vars.m4
3554 (mailfromd_SOURCES): Remove ml.c
3555 * src/bi_db.m4: Use MF_RETURN, MF_RETURN_STRING, MF_VAR_REF
3556 * src/bi_dns.m4: Likewise
3557 * src/bi_other.m4: Likewise
3558 * src/bi_poll.m4: Likewise
3559 * src/bi_sa.m4: Likewise
3560 * src/bi_sa.m4: Likewise
3561 * src/engine.c (ctx_getsym): use gacopyz_setreply
3562 * src/gram.y: Replace calls to declare_string_variable and
3563 declare_numeric_variable with declare_variable
3564 (code_node): Fix coredump if node==NULL
3565 * src/mailfrom.h (declare_numeric_variable)
3566 (declare_string_variable): Remove
3567 * src/prog.c (env_var_inc): New function
3568 (struct declvar): Replace var with name and off. It is not safe
3569 to keep the address of the variable as it can change during
3570 rehashing of the symtable
3571 (find_declared_variable): Replace with variable_declared_p
3572 (rcpt_count_loc,ehlo_domain_var,mailfrom_address_var): Remove
3573 (get_rcpt_count,clear_rcpt_count,incr_rcpt_count)
3574 (bi_numrcpt,builtin_post_setup): Move to bi_vars.m4
3575 * src/prog.h (env_var_inc, variable_declared_p)
3576 (declare_variable): New decls
3577 * src/snarf.m4 (MF_RETURN, MF_RETURN_STRING, MF_ALLOC_HEAP, MF_VAR_INC)
3578 (MF_COPY_STRING,MF_VAR_REF): New defines
3579 (MF_VAR): Declare offset as static
3580 * src/symtab.c (remove_symbol): New function
3581
3582 * testsuite/etc/accept.pat: Make sure the test works offline
3583 * testsuite/etc/ml.pat: Likewise
3584 * testsuite/etc/numrcpt.pat: Likewise
3585 * testsuite/etc/reject.pat: Likewise
3586 * testsuite/etc/tempfail.pat: Likewise
3587 * testsuite/mailfromd/poll.exp: Likewise
3588
3589 * src/snarf.m4 (MF_VAR): New macro
3590 (__mf_argtype,mf_typelist): Change expansion according to mailfrom.h
3591 * src/bi_db.m4, src/bi_poll.m4, src/bi_sa.m4: Use the new way of
3592 declaring MF variables.
3593
3594 * src/gram.y: Control types during tree generation
3595 Start implementing strict type checking and the new way of
3596 declaring function parameters and return types. Implement
3597 functions without return value (procedures).
3598 * src/lex.l: New rules for returning TYPE
3599 * src/prog.c: Update to match recent changes
3600 * src/symtab.c: Update to match recent changes
3601 * testsuite/etc/var.rc: Update to match recent changes (string is
3602 a keyword)
3603
3604 Incorporate changes from 3.0 branch:
3605
3606 * NEWS: Update
3607
3608 * src/cache.c: Update invocations of mu_dbm_open, remove calls to
3609 mu_dbm_lock/mu_dbm_unlock.
3610 * src/db.c: Likewise.
3611 * src/mu_dbm.c: Likewise.
3612 * src/mu_dbm.h: Likewise.
3613
3614 * doc/Makefile.am (mailfromd_TEXINFOS): Add values.texi.
3615 * doc/values.texi: New file
3616 * doc/mailfromd.texi: Include values.texi. Document SMTP
3617 timeouts.
3618 * src/engine.c (smtp_stream_wait,smtp_wait,smtp_recvline)
3619 (check_on_host,listens_on): Implement new timeout control scheme.
3620 (smtp_recv_tm): New function
3621 * src/mailfrom.h (io_attempts,connect_attempts): Remove
3622 (io_timeout,connect_timeout): Change the type to time_t
3623 (response_timeout): New declaration
3624
3625 (instr_rettype): Rename to data_type_t
3626 (rettype_string,rettype_number,rettype_unspecified): Rename to
3627 dtype_.*
3628 (struct un_node.result_type): New field
3629 (struct cast_node, positional_arg): New data types
3630 (enum node_type, node_type_cast): New value
3631
3632
3633 * src/main.c (io_attempts,connect_attempts): Remove
3634 (io_timeout,connect_timeout): Change the type to time_t
3635 (response_timeout): New variable
3636 (option_cache): Deprecate options connect-retry and
3637 io-retry
3638 (process_options): Additionally check if p->set is not NULL.
3639
3640
3641 2006-11-08 Sergey Poznyakoff <gray@gnu.org.ua>
3642
3643 * configure.ac, NEWS: Fix version: 3.0.90 (3.0.1 is moved to
3644 bug-fixing branch)
3645
3646 * configure.ac: Raise version number to 3.0.1
3647 * NEWS: Update
3648 * etc/rc.in (mailfromd_stop): Fix arithmetical expression syntax
3649 * gacopyz/gacopyz.c (parse_state_arg): Bugfix: do not reuse
3650 parsing buffer!
3651 * src/gram.y (function_call): New function
3652 Allow functions returning unspecified (procedures) to be used as
3653 statements
3654 * src/lex.l: New token type PROCEDURE
3655 * src/mailfrom.h (struct function): Remove misleading comment
3656
3657 * src/snarf.m4 (MF_CATCH, MF_CATCH_VAL, MF_ASSERT): New macros
3658 * src/bi_db.m4: Use catch/assert macros.
3659 * src/bi_dns.m4: Likewise.
3660 * src/bi_other.m4: Likewise.
3661 * src/bi_poll.m4: Likewise.
3662 * src/bi_sa.m4: Likewise.
3663 * src/bi_string.m4: Likewise.
3664
3665 2006-11-07 Sergey Poznyakoff <gray@gnu.org.ua>
3666
3667 * src/gram.y: Update FIXME-xref.
3668 * src/mu_dbm.c (mu_dbm_open) [WITH_GDBM]: Use GDBM_NOLOCK, as we
3669 do the locking ourselves
3670
3671 2006-11-06 Sergey Poznyakoff <gray@gnu.org.ua>
3672
3673 * src/engine.c: Fix multiple from address handling
3674 * src/gram.y: Put back the changes, only make sure the leading
3675 white space is properly stripped off the argument.c
3676
3677 * src/gram.y (pragma_option): Undo the change from 2006-10-30.
3678 * src/main.c (opton_ehlo): Adjust for changes in option mailfrom
3679 syntax.
3680
3681 2006-11-06 Sergey Poznyakoff <gray@gnu.org.ua>
3682
3683 Release 3.0
3684
3685 * doc/mailfromd.texi: Update
3686 * etc/rc.in: Update
3687
3688 2006-11-05 Sergey Poznyakoff <gray@gnu.org.ua>
3689
3690 * NEWS, configure.ac: Set the version number to 3.0
3691 (dropping libmilter support calls for raising the major number).
3692 * TODO: Update
3693
3694 * src/Makefile.am: Install mailfromd in sbin
3695 * etc/Makefile.am (.in.mailfromd): Likewise
3696 * gacopyz/gacopyz.c (gacopyz_handle_connection): Reset SIGTERM and
3697 SIGHUP in child.
3698 * gacopyz/proc.c (gacopyz_cleanup_conn): Ignore SIGTERM while
3699 stopping children.
3700
3701 * doc/gacopyz.texi: New file
3702 * doc/Makefile.am (mailfromd_TEXINFOS): Add gacopyz.texi
3703 (EXTRA_DIST): Add extract.awk
3704 (extract): New rule
3705 * doc/macros.texi (function-begin, function-end): Remove macros
3706 (example-output): New macro
3707 * doc/mailfromd.texi: Finish changes for 3.0
3708
3709 2006-11-04 Sergey Poznyakoff <gray@gnu.org.ua>
3710
3711 * NEWS: Update
3712 * TODO: Update
3713 * doc/Makefile.am (check-pragmas): Minor change
3714 * doc/macros.texi (function-begin,function-end): New macros
3715 * doc/mailfromd.texi: Add missing documentation
3716 * etc/rc.in: New option `macros'.
3717 * gacopyz/gacopyz.c (ctx_read,ctx_write): Return immediately on
3718 timeout and eof.
3719
3720 2006-11-03 Sergey Poznyakoff <gray@gnu.org.ua>
3721
3722 * etc/rc.in: New command 'configtest' (proposed by Jan)
3723 * gacopyz/gacopyz.c (gacopyz_run): Update invocation of
3724 gacopyz_cleanup_children.
3725 * gacopyz/gacopyz.h (gacopyz_cleanup_children): Change signature
3726 * gacopyz/proc.c: Do not keep the list of
3727 children. gacopyz_cleanup_children now does the housekeeping job.
3728 * src/engine.c (check_portspec): Minor fix: no use to make sp
3729 static.
3730 (mailfromd_daemon): Stop on SIGTERM, SIGQUIT, SIGHUP and SIGINT.
3731 Finally!
3732
3733
3734 * src/engine.c (smfilter): Set child start handler
3735
3736 * NEWS: Update
3737 * configure.ac: Warn if libmilter is requested
3738 * doc/mailfromd.texi: Remove any references to libmilter
3739 * src/mailfrom.h: Fix conditionals for definition of res_n*
3740 wrappers.
3741
3742 * configure.ac: Autodetect the presence of res_n* functions
3743 Define HAVE_PTHREAD if we need to use libpthread
3744 * gacopyz/gacopyz.c (macro_assoc_free): Initialize macro_assoc_t
3745 fields to NULL
3746 * src/bi_poll.m4: Fix trace output (AS part)
3747 * src/dns.c: Replace pthread-specific calls with macro wrappers
3748 * src/gram.y (on pollstmt do branches): Fix passing of arguments
3749 to the built-in poller
3750 * src/mailfrom.h: Define wrappers for phread and res_n* functions,
3751 if necessary
3752
3753 * libmilter: Removed. Everything moved to /gacopyz
3754 * gacopyz: New directory. See libmilter for the previous history
3755 * Makefile.am (SUBDIRS): Replace libmilter with gacopyz
3756 * NEWS: Update
3757 * configure.ac: Raise version number to 2.0.4
3758 Default to using libgacopyz. If the user really calls for trouble,
3759 allow him to use libmilter (possibly forked), instead.
3760 * src/Makefile.am (INCLUDES): Add MILTER_INCLUDES
3761 * src/engine.c: Remove include mfapi.h
3762 (priv_get): Special provision for test mode
3763 * src/mailfrom.h: Include mfapi.h without leading directory. -I
3764 should take care of it.
3765 (MAILFROMD_DAEMON,MAILFROMD_TEST,MAILFROMD_DELETE,MAILFROMD_LIST)
3766 (MAILFROMD_EXPIRE,MAILFROMD_COMPACT)
3767 (MAILFROMD_SHOW_DEFAULTS): Moved from main.c
3768 (mode): New global
3769 * src/main.c: Do not include mfapi
3770 (MAILFROMD_DAEMON,MAILFROMD_TEST,MAILFROMD_DELETE,MAILFROMD_LIST)
3771 (MAILFROMD_EXPIRE,MAILFROMD_COMPACT)
3772 (MAILFROMD_SHOW_DEFAULTS): Move defines to mailfrom.h
3773 * src/ml.c: Include mfapi.h without leading directory. -I
3774 should take care of it.
3775 [GACOPYZ_VERSION_MAJOR]: Provide wrapper for gacopyz_setreply
3776 * gacopyz/smfi.c (smfi_main): Remove debugging hook
3777
3778 * libmilter/dummy.c: Update
3779 * libmilter/milter.c, libmilter/milter.h, libmilter/smfi.c:
3780 Finished libmilter implementation.
3781 * testsuite/mail.null: Skip -f option and its argument.
3782
3783 * libmilter/context.c, libmilter/milter.h, libmilter/smfi.c:
3784 (g_milter_setmlreply_v, smfi_setmlreply): Improved implementation.
3785 (g_milter_setmlreply_va): New function
3786
3787 2006-11-02 Sergey Poznyakoff <gray@gnu.org.ua>
3788
3789 * libmilter/context.c, libmilter/milter.c, libmilter/milter.h
3790 libmilter/milter_priv.h, libmilter/smfi.c: Implement sending reply
3791 strings to sendmail.
3792
3793 * src/gram.y: Fix type casting of arguments.
3794
3795 * libmilter/milter.c, libmilter/milter.h,
3796 libmilter/milter_priv.h: Finish context loop implementation.
3797 * libmilter/dummy.c: Add to the repository
3798
3799 * libmilter/milter.c (trans_ok, get_command): Change signature
3800 (send_reply): Remove translation of the command.
3801 (union state_arg): Change contents.
3802 (state_ret_type): New data type
3803 (state_handler_fn): Change type and signature.
3804 (state_disp): New field `name'.
3805 (shan_abort,shan_macro,shan_optneg): Implemented
3806 (find_disp): New function
3807 (parse_state_arg): New function
3808 (g_milter_context_loop): Initial loop implementation.
3809 (g_milter_getsymval): New function
3810 * libmilter/milter.h (SMFI_V1_ACTS,SMFI_V2_ACTS): New defines
3811 (smfi_getsymval): Define to g_milter_getsymval
3812 (g_milter_getsymval): New prototype
3813 * libmilter/milter_priv.h (macro_assoc_t): New data type
3814 (struct smfi_str.macros): Change type to macro_assoc_t
3815 * libmilter/trans.awk: Define state_name array
3816
3817 2006-11-01 Sergey Poznyakoff <gray@gnu.org.ua>
3818
3819 * configure.ac (BUILD_DUMMY): New var
3820 * libmilter/Makefile.am: Build dummy - a test program for
3821 libmilter
3822 * libmilter/log.c (g_smfi_logdump): New function
3823 * libmilter/milter.c: Lots of fixes. Start implementing the read
3824 and eval loop.
3825 * libmilter/milter.h (smfi_register): Fix prototype
3826 (g_smfi_logdump): New function
3827 * libmilter/milter_priv.h (enum macro_index)
3828 (milter_sockaddr_t,mi_uint32_t): New data type
3829 (struct smfi_str.macros): Change type
3830 * libmilter/smfi.c (smfi_register): Fix declaration
3831 (smfi_main): Temporarly force foreground mode
3832 * libmilter/trans.awk (END): Emit st_none
3833
3834 * Makefile.am (SUBDIRS): Add libmilter
3835 * configure.ac: Add testing framework for libmilter
3836 Raise version number to 2.0.3
3837 * libmilter/Makefile.am: Conditionally build libmilter.a
3838
3839 * libmilter/: Initial commit
3840 * context.c: Initial commit
3841 * log.c: Initial commit
3842 * milter.c: Initial commit
3843 * milter.h: Initial commit
3844 * milter_priv.h: Initial commit
3845 * proc.c: Initial commit
3846 * smfi.c: Initial commit
3847 * trans.awk: Initial commit
3848 * trans.tab: Initial commit
3849 * libmilter/.cvsignore: Initial commit
3850
3851 * src/prog.c (instr_ston): Fix runtime error diagnostic message
3852
3853 2006-10-30 Sergey Poznyakoff <gray@gnu.org.ua>
3854
3855 * src/engine.c (check_on_host): Iterate over addresses from
3856 `mailfrom' until either the list is exhausted or the remote server
3857 replies 2xx. Generalization of Jan's idea.
3858 * src/main.c (set_mailfrom): Check if value is a valid mail
3859 address (or a list thereof)
3860 * testsuite/etc/poll-1.rc: New file
3861 * testsuite/etc/Makefile.am (RCFILES): Add poll-1.rc
3862 * testsuite/mailfromd/poll.exp: Test multiple from addresses.
3863 * NEWS: Update
3864 * doc/Makefile.am (check-exceptions): New goal
3865 (all-check-docs): Depend on check-exceptions
3866 * doc/mailfromd.texi: Document multiple from addresses.
3867 * src/gram.y (pragma_option): Return the rest of the line as the
3868 option argument for `pragma option mailfromd'
3869
3870 * NEWS, TODO: Update
3871 * src/bi_poll.m4 (_pollmx): Update invocation of check_mx_records
3872 * src/engine.c (check_mx_records): Return actual number of MXs in
3873 the location given by the last argument. All callers updated
3874 (method_standard): Do the last-resort poll (i.e. querying the
3875 domain part of the sender email, treated as an MX) only if the
3876 domain has no MX records.
3877 * src/mailfrom.h (check_mx_records): Update declaration
3878
3879 2006-10-29 Sergey Poznyakoff <gray@gnu.org.ua>
3880
3881 * src/bi_dns.m4 (ismx): New built-in function
3882
3883 Implement connect-timeout and connect-retry options proposed by
3884 Jan:
3885
3886 * src/engine.c (smtp_stream_wait, smpt_wait)
3887 (check_on_host, listens_on): Use connect_wait/connect_timeout for
3888 the initial connection and io_wait/io_timeout for the I/O
3889 operations.
3890 * src/mailfrom.h (connect_timeout, connect_attempts): New
3891 variables.
3892 * src/main.c: Likewise.
3893
3894 * src/prog.c (struct eval_environ): Fix setheader prototype.
3895 * TODO, NEWS: Update
3896
3897 2006-10-28 Sergey Poznyakoff <gray@gnu.org.ua>
3898
3899 * NEWS, configure.ac: Version 2.0.2
3900 * src/bi_sa.m4 (clamav): New built-in function
3901 * src/snarf.m4: Minor comment fixes
3902
3903 * src/snarf.m4 (env_get_stream): New macro. Make sure
3904 env_get_stream is used only within capturing function
3905 definitions.
3906
3907 * doc/Makefile.am (check-pragmas, check-options)
3908 (check-builtins): Use new check-docs.sh invocation syntax
3909 * doc/check-docs.sh: Allow to take any number of "source"
3910 arguments.
3911 * doc/mailfromd.texi: Remove ignored deftypefn of numrcpt
3912
3913 2006-10-27 Sergey Poznyakoff <gray@gnu.org.ua>
3914
3915 * NEWS: Update
3916 * src/bi_db.m4 (MF_INIT): Install greylist_seconds_left variable
3917 * src/engine.c (ctx_setheader,priv_store_header_command): Change
3918 type of the second argument to struct old_header_node.
3919 * src/gram.y: Rules for header modification changed to allow an
3920 expression as the second argument.
3921 (register_macro,print_used_macros): New functions
3922 (dbg_setheader): Change type of the second argument to struct
3923 old_header_node.
3924 (print_node,code_node): Change handling of node_type_header
3925 * src/mailfrom.h (struct old_header_node): Renamed from header_node
3926 (struct header_node): New structure.
3927 (print_config_macros): New function
3928 (create_environment): Change type of the 4th argument
3929 (priv_store_header_command): Remove declaration
3930 (compare_string): New declaration
3931 * src/main.c: New option --dump-macros
3932 * src/prog.c (instr_header): The value for the header is obtained
3933 as the 1st argument.
3934 (struct optab): Change instr_header description
3935 (create_environment) Change type of the 4th argument
3936
3937 * configure.ac: Check for SIGRETTYPE
3938 * src/Makefile.am (M4_FILES): Add bi_sa.m4
3939 * src/bi_db.m4, src/bi_dns.m4, src/bi_string.m4: Remove unneded
3940 quoting
3941 * src/engine.c (mlfi_envfrom,mlfi_header,mlfi_eoh)
3942 (mlfi_body, mlfi_eom): Capture support
3943 (mlfi_eom): Bugfix: mlfi_eval called with wrong state tag
3944 * src/gram.y: Check if builtin invocations are allowed in the
3945 current state.
3946 (status_tab): Add mf_url
3947 * src/lex.l (parse_include): Remove unused variable
3948 * src/mailfrom.h (mf_status): New status mf_url
3949 (struct builtin): New fields rettype, statemask, capture.
3950 (va_builtin_install_ex): New function
3951 (env_get_stream,env_capture_start,env_capture_write,
3952 env_capture_write_args): New functions
3953 * src/prog.c: Include stdarg.h
3954 (struct eval_environ): New member `stream'
3955 (env_get_stream,env_capture_start,env_capture_write)
3956 (env_capture_write_args): New functions
3957 (destroy_environment): Destroy the capture stream
3958 (builtin_setup): Call sa_init_builtin.
3959 * src/prog.h (sa_init_builtin): New function
3960 * src/snarf.m4: Change quoting symbols to [<,>]
3961 (MF_STATE, MF_CAPTURE): New defines
3962 (MF_DEFUN): use va_builtin_install_ex
3963 * src/symtab.c (va_builtin_install_ex): New function
3964 * src/bi_sa.m4: New file. Spam-Assassin interface.
3965
3966 * src/Makefile.am (mailfromd_SOURCES): Add engine.c
3967 * src/bi_string.m4 (substring): Fix swapping of start and end
3968 offsets.
3969 * src/mailfrom.h: Add external declarations, necessary for
3970 engine.c
3971 * src/main.c: Move all milter-related stuff to engine.c
3972 * src/engine.c: New file
3973 * src/prog.h (other_init_builtin): New extern
3974 * src/rate.c (rate_print_item): Remove unused variables
3975
3976 2006-10-23 Sergey Poznyakoff <gray@gnu.org.ua>
3977
3978 * src/prog.c: Minor indentation changes
3979 * src/snarf.m4: Add comments
3980
3981 2006-10-22 Sergey Poznyakoff <gray@gnu.org.ua>
3982
3983 * src/lex.l: Use familiar \N notation for back references. Expand
3984 \0ooo and \xhh notations in double-quoted strings.
3985
3986 2006-10-21 Sergey Poznyakoff <gray@gnu.org.ua>
3987
3988 * src/lex.l: Allow variable and macro interpretation and backreference
3989 substitution in "" strings.
3990
3991 * src/gram.y: Implement regexp back-references
3992 * src/lex.l: Likewise
3993 * src/mailfrom.h: Likewise
3994 * src/prog.c: Likewise
3995
3996 2006-10-20 Sergey Poznyakoff <gray@gnu.org.ua>
3997
3998 Implement new framework for builtin functions, which allows for
3999 easy addition of new functions and provides basic sanity checks.
4000
4001 * TODO: Update
4002 * NEWS: Update
4003 * src/.cvsignore: Update
4004 * src/bi_db.m4: New file
4005 * src/bi_dns.m4: New file
4006 * src/bi_other.m4: New file
4007 * src/bi_poll.m4: New file
4008 * src/bi_string.m4: New file
4009 * src/snarf.m4: New file
4010 * src/prog.h: New file
4011 * src/Makefile.am: Add rules for generating builtin implementation
4012 files from m4 sources
4013 * src/gram.y (status_tab): New status mf_range
4014 * src/mailfrom.h: New status mf_range
4015 * src/main.c (check_on_host): Return mf_temp_failure if
4016 stream_open fails.
4017 * src/prog.c: Include prog.h
4018 Remove implementations of builtin functions. They all go into the
4019 corresponding m4 files.
4020 (advance_pc,adjust_stack): Functions, instead of macros
4021 (env_var_ref,env_dict_getsym,env_dict_install,env_get_locus): New
4022 functions.
4023
4024 2006-10-18 Sergey Poznyakoff <gray@gnu.org.ua>
4025
4026 * src/prog.c (set_last_poll_result): Allow NULL arguments
4027
4028 * configure.ac: Check for mu_get_auth (MU >= 1.0.1)
4029 * src/prog.c (bi_hostname, bi_resolve): Cache negative results
4030 (valid_user_p): Use mu_get_auth if available and throw appropriate
4031 exceptions if the user validity cannot be confirmed.
4032
4033 2006-10-13 Sergey Poznyakoff <gray@gnu.org.ua>
4034
4035 * TODO: Update
4036 * doc/mailfromd.texi: Apply some fixes, proposed by Jan
4037
4038 2006-10-11 Sergey Poznyakoff <gray@gnu.org.ua>
4039
4040 * src/main.c (method_standard, method_strict): Initialize
4041 last_poll_sent, last_poll_recv to empty strings if cache was used.
4042
4043 2006-10-09 Sergey Poznyakoff <gray@gnu.org.ua>
4044
4045 * src/lex.l: Allow interpretation of variables and macros within
4046 here-documents.
4047 Special form to remove all leading whitespace from the here-
4048 document lines.
4049 * src/ml.c (ml_split): Fix counting of lines in the reply. The
4050 last line was not taken into account unless it ended with a
4051 newline.
4052 * NEWS: Update.
4053 * doc/mailfromd.texi: Document here-documents.
4054
4055 2006-10-07 Sergey Poznyakoff <gray@gnu.org.ua>
4056
4057 * doc/mailfromd.texi: Provide example of cached_data usage.
4058
4059 * configure.ac: Fix Berkeley DB autodetection
4060 * src/Makefile.am (INCLUDES): Add MU_COMMON_INCLUDES
4061 * src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Use DB_VERSION_MAJOR to
4062 select the version-dependent code.
4063
4064 2006-10-06 Sergey Poznyakoff <gray@gnu.org.ua>
4065
4066 * NEWS: Update
4067 * TODO: Update
4068 * doc/mailfromd.texi: Document cache_used variable
4069 * src/mailfrom.h (set_cache_used): New function
4070 * src/main.c (method_strict, method_standard): Set cache_used to 1
4071 or 0 depending on whether the cached data were used or not.
4072 * src/prog.c (set_cache_used): New function
4073
4074 * configure.ac: Add explicit support for Berkeley DB 4. Raise
4075 version number to 2.0.1
4076 * src/mailfrom.h (set_last_poll_result): New function.
4077 (env_get_context): New function.
4078 (check_on_host,check_mx_records,method_strict)
4079 (method_standard): Change first argument type to eval_environ_t
4080 * src/main.c (smtp_send): Clear reply before proceeding
4081 (smtp_last_sent,smtp_last_received): Return literal "nothing" if
4082 nothing was sent/received.
4083 (check_mx_records,method_strict)
4084 (method_standard): Change first argument type to eval_environ_t
4085 (check_on_host): Change first argument type to eval_environ_t.
4086 Return last polled host, sent command and received reply in
4087 variables last_poll_host, last_poll_send and last_poll_recv.
4088 * src/mu_dbm.c [WITH_BDB] (mu_dbm_open): Support Berkeley DB 4
4089 * src/prog.c (env_get_context, env_get_context): New function
4090 (greylist_expire_item): New function
4091 (greylist_format_struct): Add expire field.
4092 (greylist_format_struct): Declare last_poll_host, last_poll_send,
4093 last_poll_recv
4094 * src/rate.c (rate_expire_item): Compute the interval relative
4095 to the current time.
4096
4097 * doc/mailfromd.texi: Document new variables
4098 * NEWS: Update
4099
4100 2006-09-15 Sergey Poznyakoff <gray@gnu.org.ua>
4101
4102 -= Release 2.0 =-
4103
4104 * configure.ac: Raise version number to 2.0
4105 * NEWS: Likewise
4106 * doc/mailfromd.texi: Finished
4107 * src/main.c (filter_cleanup): Free md->helostr
4108 (mlfi_helo): Allocate md->helostr.
4109
4110 * src/main.c (main): Enclose PACKAGE_BUGREPORT in angle brackets
4111
4112 2006-09-14 Sergey Poznyakoff <gray@gnu.org.ua>
4113
4114 * doc/mailfromd.texi: Update
4115 * src/gram.y: Warn about unquoted strings
4116 * src/main.c: Do not enclose dbm-related variables in #ifdef
4117 USE_DBM.
4118
4119 * configure.ac: Define program_name
4120 * doc/mailfromd.texi: Update
4121 * src/gram.y: Fix coredump if "rate" is not defined
4122 * src/prog.c: Include sys/types.h
4123
4124 * doc/mailfromd.texi: Update
4125 * etc/mailfromd.rc: Update
4126 * src/lex.l: Fix counting of the input lines
4127 * src/main.c: New option -l (--lint)
4128 * NEWS: Update
4129
4130 2006-09-13 Sergey Poznyakoff <gray@gnu.org.ua>
4131
4132 * doc/mailfromd.texi: Update
4133 * doc/strftime.texi: New file
4134 * doc/mastermenu.el: New file
4135 * doc/Makefile.am (mailfromd_TEXINFOS): Add strftime.texi
4136 (check-builtins): Update rule
4137 (check-refs,check-fixmes): New rules
4138 (all-check-docs): New rule
4139 (check-docs): Rewrite via all-check-docs
4140 * README-alpha: Update (fprintftime gnulib module is required).
4141 * src/Makefile.am (INCLUDES): Add lib (for fprintftime.h)
4142 * src/cache.c (cache_print_item): Use format_time_str
4143 * src/db.c (format_time_str): New function
4144 * src/gram.y (convert_rate): allow a separator ("per" or a
4145 punctuation) between the message count and the interval spec.
4146 * src/mailfrom.h (format_time_str): New function
4147 (time_format_string): New global
4148 * src/main.c (time_format_string): New global
4149 New option --time-format
4150 (db_format_enumerator): Protect by #ifdef USE_DBM. Print negative
4151 expiration for cache.
4152 * src/prog.c (greylist_print_item): Use format_time_str.
4153 * src/rate.c (rate_print_item): Use format_time_str.
4154
4155 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
4156
4157 * doc/mailfromd.texi: Update
4158 * src/prog.c (env_catch): Reset the exception handler.
4159
4160 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
4161
4162 * TODO: Update
4163 * configure.ac: Set doc hints depending on the version (alpha
4164 vs. stable).
4165 * doc/Makefile.am (check-pragmas): Modify
4166 (check-docs): Add check-builtins to the lst of prerequisites.
4167 (check-builtins): New rule
4168 (RENDITION): Remove variable assignment
4169 * doc/macros.texi (xprindex): Not used now
4170 * doc/mailfromd.texi: Update
4171 * src/gram.y: Set the precedence of MATCHES and FNMATCHES to
4172 that of EQ
4173 (print_bin_op): Add missing opcodes
4174 (print_node): Fix printing of NEG argument
4175 * src/main.c (options): Fix wrongly placed N_()s.
4176
4177 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
4178
4179 * README-alpha: Add texinfo to the prerequisites
4180 * doc/macros.texi: New file
4181 * doc/Makefile.am (mailfromd_TEXINFOS): Add macros.texi
4182 (check-pragmas,check-options): New rules
4183 (EXTRA_DIST): Add check-docs.sh
4184 * doc/mailfromd.texi: Update
4185 * src/main.c: Use ifdef USE_DBM where appropriate
4186 * src/prog.c (valid_user_p): Do not suppose argument is an email
4187 address.
4188
4189 2006-09-07 Sergey Poznyakoff <gray@gnu.org.ua>
4190
4191 * NEWS: Update
4192 * doc/mailfromd.texi: Almost finished Tutorial chapter
4193 * src/prog.c (bi_domainpart, bi_localpart): New function
4194 (dbmap): Signal dbfailure exception if the database cannot be
4195 opened. Do not suppose the argument is an email address.
4196
4197 2006-09-05 Sergey Poznyakoff <gray@gnu.org.ua>
4198
4199 * NEWS: Update
4200 * doc/mailfromd.texi: Update
4201 * src/prog.c (bi_toupper, bi_tolower): New built-ins.
4202 (bi_stdpoll, bi_strictpoll, bi__pollhost, bi__pollmx): Signal
4203 runtime error on unhandled exceptions.
4204
4205 * Makefile.am: Update
4206 * NEWS: Update
4207 * src/db.c (db_compact): Print debugging info at the beginning
4208 * src/lex.l (parse_error): Do not output locus is locus.file is
4209 not set.
4210 * src/main.c: New option --all
4211 (stderr_error_printer): Use program_invocation_short_name
4212 (main): Set stderr_error_printer early, before parsing command
4213 line.
4214
4215 * README-alpha: New file
4216 * Makefile.am (SUBDIRS): Add lib
4217 * NEWS: Update
4218 * configure.ac: Switch to using gnulib
4219 * src/Makefile.am: Likewise
4220 * src/main.c: New options --lock-retry-count and
4221 --lock-retry-timeout
4222 * src/obstack.c, src/obstack.h, src/snprintf.c, src/snprintf.h,
4223 src/strtok_r.c: Remove files.
4224
4225 2006-09-03 Sergey Poznyakoff <gray@gnu.org.ua>
4226
4227 * NEWS: Update
4228 * doc/mailfromd.texi: Update
4229 * src/lex.l: Implement #include directive
4230 (pop_source): Do not free locus.file. It has already been
4231 referenced by now.
4232
4233 * src/main.c (log_status): Avoid logging SMFIS_CONTINUE actions.
4234
4235 2006-09-02 Sergey Poznyakoff <gray@gnu.org.ua>
4236
4237 * NEWS, configure.ac: Raise version number to 1.9.93.
4238
4239 * THANKS: Updated Jan's record
4240 * src/cache.c: Print status code and time stamps in human-readable
4241 form.
4242 * src/gram.y (ECHO): Rename to KW_ECHO to avoid clashes with the lex
4243 macro name.
4244 * src/lex.l: Likewise
4245 * src/mailfrom.h (debug macros): Print source location only if
4246 source_info_option is set
4247 (source_info_option): New extern
4248 (builtin_post_setup,print_code,yylex,yyerror,onblock,string_to_stat)
4249 (mailfromd_msgid,mailfromd_timestr,logmsg):
4250 (xeval,check_on_host,check_mx_records,get_rate): Add missing
4251 declarations
4252 * src/main.c (source_info_option): New option
4253 (struct message_data.msgid): New member
4254 (priv_get): Init msgid
4255 (mailfromd_msgid,mailfromd_timestr): New functions
4256 (trace, transcript): Use mailfromd_msgid()
4257 (check_on_host): Print exit code on debug level 1
4258 * src/mu_dbm.c: Include mailutils/error.h
4259 * src/mu_dbm.h (mu_dbm_unlock): Return void
4260 * src/prog.c: Minor changes
4261 * testsuite/etc/poll.rc: New file
4262
4263 * NEWS: Update
4264 * etc/mailfromd.rc: Use RFC-compliant reply codes.
4265 * testsuite/etc/arg.pat: Likewise.
4266 * testsuite/etc/arg.rc: Likewise.
4267 * testsuite/etc/cidr.rc: Likewise.
4268 * testsuite/etc/cond.rc: Likewise.
4269 * testsuite/etc/numrcpt.pat: Likewise.
4270 * testsuite/etc/numrcpt.rc: Likewise.
4271 * testsuite/etc/reject.pat: Likewise.
4272 * testsuite/etc/reject.rc: Likewise.
4273 * testsuite/etc/relayed.rc: Likewise.
4274 * testsuite/etc/tempfail.pat: Likewise.
4275 * testsuite/etc/tempfail.rc: Likewise.
4276 * testsuite/mailfromd/cidr.exp: Likewise.
4277 * testsuite/mailfromd/cond.exp: Likewise.
4278 * testsuite/mailfromd/relayed.exp: Likewise.
4279
4280 * src/gram.y (on_cond): Use the values of %ehlo_domain and
4281 %mailfrom_address variables as default values for ehlo domain and
4282 sender address.
4283 * src/mailfrom.h (smtp_domain): New extern
4284 (get_smtp_domain): Remove function
4285 * src/main.c (get_smtp_domain): Remove function
4286 (main): Call builtin_post_setup after configuration
4287 * src/prog.c (builtin_post_setup): New function
4288 (builtin_setup): Install ehlo_domain and mailfrom_address vars
4289 (bi_strictpoll): Fix parameter order
4290 (bi__pollhost, bi__pollmx): New functions
4291 (bi_match_cidr): Fix coredump
4292
4293 * testsuite/etc/catch01.rc: New file
4294 * testsuite/etc/hasmx.rc: New file
4295 * testsuite/etc/Makefile.am: Add catch01.rc and hasmx.rc
4296
4297 * testsuite/etc/catch.rc: Rewrite
4298 * testsuite/mailfromd/catch.exp: Rewrite
4299
4300 * testsuite/mailfromd/hasmx.exp: New file
4301 * testsuite/mailfromd/poll.exp: New file
4302 * testsuite/mailfromd/DISTFILES: Add hasmx.exp and poll.exp
4303
4304 * src/codegen.awk: Remove
4305 * src/onwrap_std.cin: Remove
4306 * src/onwrap_std.rc: Remove
4307 * src/onwrap_strict.cin: Remove
4308 * src/onwrap_strict.rc: Remove
4309 * Makefile.am, src/Makefile.am: Remove bootstrap. Not needed any
4310 more.
4311 * src/gram.y: Allow to specify catches for all exceptions
4312 (catch *).
4313 Allow to use any function as a selector to `on' statement.
4314 Get rid of poll_node.
4315 * src/mailfrom.h (struct poll_node): Remove
4316 (struct poll_data): New data type
4317 (struct catch_node): Replace mf_status *values with unsigned
4318 exmask
4319 (enum node_type): Remove poll_node
4320 (std_on_wrapper_func,strict_on_wrapper_func): Remove
4321 * src/prog.c (instr_catch, dump_catch): Update for the new catch
4322 calling convention.
4323 Remove includes of onwrap_std.c and onwrap_strict.c.
4324 * src/.cvsignore: Update
4325
4326 * Makefile.am, src/Makefile.am (bootstrap): New goal
4327
4328 * src/Makefile.am: Add rules for generation of onwrap_std.c and
4329 onwrap_strict.c
4330 * src/codegen.awk: New file
4331 * src/onwrap_std.cin: New file
4332 * src/onwrap_std.rc: New file
4333 * src/onwrap_strict.cin: New file
4334 * src/onwrap_strict.rc: New file
4335
4336 * src/gram.y: Change catch semantics: a catch handler always
4337 causes exit from the function or prog it was called from. The
4338 scope of a catch handler installed in a function ends with the
4339 end of that function.
4340 Rewrite ON statement using CATCH + wrappers over stdpoll or
4341 strictpoll functions.
4342 * src/lex.l: The sequences poll, host, for, as and from are valid
4343 keywords only if used in ONBLOCK state.
4344 (onblock): New function
4345 * src/mailfrom.h (mf_status): Add new status codes (it'd be better
4346 to call them exception codes, perhaps).
4347 (EXMASK): New macro
4348 (prog_trace_option): New global
4349 (struct poll_action): Removed
4350 (struct poll_node): Change type of `actions' to struct case_stmt
4351 (struct function.exmask): New member
4352 (std_on_wrapper_func, strict_on_wrapper_func): New globals
4353 (instr_callout): Removed
4354 (instr_retcatch, instr_saveex, instr_restex): New instructions
4355 (env_catch): Return an error code
4356 * src/main.c: New option --trace-prog
4357 * src/prog.c (prog_trace): New function. Used in all instructions
4358 and builtins instead of debugN(100...).
4359 (instr_callout): Removed
4360 (instr_retcatch, instr_saveex, instr_restex): New instructions
4361 (env_catch): Return an error code
4362 (bi_stdpoll, bi_strictpoll): New builtins
4363 * src/.cvsignore: Update
4364
4365 * testsuite/etc/catch.rc: Update catch syntax
4366
4367 2006-08-30 Sergey Poznyakoff <gray@gnu.org.ua>
4368
4369 * NEWS: Update
4370 * etc/mailfromd.rc: Rewrite using 2.x syntax
4371 * src/gram.y: Simplify case syntax: do not require do .. done
4372 around statement lists
4373 * src/prog.c (instr_ntos): Remove unused variable
4374 * testsuite/etc/switch.rc: Rewrite using new syntax
4375
4376 * NEWS: Update
4377 * src/gram.y: Use NUMERIC_BUFSIZE_BOUND to declare buffers for
4378 numeric conversion
4379 * src/prog.c: Likewise
4380 * src/lex.l: New notation &word (for future use)
4381 * src/mailfrom.h (NUMERIC_BUFSIZE_BOUND): New macro
4382 * src/main.c: Set log_to_stderr=1 for some working modes
4383 (e.g. --test, --compact, --expire)
4384 (mailfromd_show_defaults): Remove NDBM/DBM leftovers
4385 * testsuite/etc/switch.rc: Minor fix
4386
4387 * NEWS: Document switch statement, database pragma and the new
4388 greylist syntax
4389 * TODO: Update
4390 * src/cache.c: Use cache_format
4391 * src/rate.c: Use rate_format
4392 * src/gram.y: Implement switch statement
4393 * src/lex.l: Likewise
4394 * src/mailfrom.h (DEFAULT_GREYLIST_DATABASE): New define
4395 (positive_expire_interval,rates_expire_interval): Remove globals
4396 (struct value,struct valist,struct case_stmt)
4397 (struct switch_stmt): New data types
4398 (node_type_switch): New node type
4399 (struct node.v.switch_stmt): New member
4400 (instr_xlat,instr_xlats,instr_jreg): New instructions
4401 (code_peek,code_reserve): New functions
4402 (struct db_format.expire_interval): New member
4403 (db_format_install): Return struct db_format *
4404 * src/main.c (positive_expire_interval,rates_expire_interval):
4405 Remove globals. Use corresponding db_format fields instead. All
4406 references updated.
4407 (db_format_setup): Protect by #ifdef USE_DBM
4408 (mailfromd_show_defaults): Use symbol_enumerate to dump available
4409 database information.
4410 * src/prog.c (instr_xlat,instr_xlats,instr_jreg): New instructions
4411 (code_peek,code_reserve): New functions
4412 * src/symtab.c (db_format_install): Return struct db_format *
4413 * testsuite/etc/Makefile.am (RCFILES): Add switch.rc
4414 * testsuite/etc/greylist.in: Rewrite to use new greylist syntax
4415 * testsuite/mailfromd/DISTFILES: Add switch.exp
4416 * testsuite/etc/switch.rc: New testcase
4417 * testsuite/mailfromd/switch.exp: New testcase
4418
4419 2006-08-23 Sergey Poznyakoff <gray@gnu.org.ua>
4420
4421 * src/main.c (stderr_error_printer): New function
4422 (main): Set stderr_error_printer as the default error printer if
4423 log_to_stderr is true.
4424 Bail out if extra arguments are given in daemon mode.
4425
4426 * NEWS: Update
4427 * src/dns.c (getmx): Do not recurse to parent domains
4428 * src/gram.y: Remove rate statement, use the built-in function
4429 instead.
4430 (pragma_option): Several pragmas take time interval specification
4431 as their argument.
4432 (time_multiplier): Analize the part of the first argument up to
4433 the first space characrer. Allow for abbreviated time units.
4434 (parse_time_interval): New function
4435 (convert_rate): Rewrite unsing parse_time_interval
4436 * src/lex.l: Allow to use multi-letter sendmail variables without
4437 surrounding cury braces.
4438 * src/mailfrom.h (node_type_rate): Remove type
4439 (instr_rate): Remove function
4440 * src/main.c: Options ending in "timeout" and "expire-interval"
4441 take time interval specification as their argument.
4442 * src/prog.c (instr_rate): Remove
4443 (bi_interval,bi_rate): New functions
4444 * src/rate.c (rate_print_item): Improved output
4445
4446 2006-08-22 Sergey Poznyakoff <gray@gnu.org.ua>
4447
4448 * src/main.c: Switch to user privileges before compacting the
4449 database
4450
4451 * NEWS: Update
4452 * src/gram.y: The legacy syntax (statement list without any prog
4453 declaration) is no longer supported
4454 SET statements are allowed between declarations, they declare
4455 global variables and assign initial values to them.
4456 * src/lex.l (parse_error_locus): Locus pointer is const
4457 * src/mailfrom.h (parse_error_locus,function_install): Locus
4458 pointer is const
4459 (declare_numeric_variable,declare_string_variable): New function
4460 * src/prog.c (declare_numeric_variable)
4461 (declare_string_variable): New function
4462 (env_decl_vars): New function
4463 (create_environment): Call env_decl_vars
4464 * src/symtab.c (variable_install): Do not overwrite existing
4465 variables.
4466 (function_install): Locus pointer is const
4467 * testsuite/etc/Makefile.am: Add var.rc
4468 * testsuite/etc/var.rc: New file
4469 * testsuite/etc/accept.rc: Rewrite using the new syntax
4470 * testsuite/etc/ml.rc: Likewise
4471 * testsuite/etc/reject.rc: Likewise
4472 * testsuite/etc/tempfail.rc: Likewise
4473 * testsuite/etc/ack.rc: Update the comment
4474 * testsuite/mailfromd/DISTFILES: Add var.exp
4475 * testsuite/mailfromd/var.exp: New testcase
4476
4477 * src/gram.y (FUNC declaration): Assign the entry point early to
4478 properly handle recursive functions
4479 (variable): Throw error if the variable is not defined
4480 * src/prog.c (instr_add,instr_sub,instr_mul,instr_div): Adjust
4481 stack
4482 (instr_result): Fix the debug diagnostics
4483 (instr_builtin): Advance pc before calling the handler, so it can
4484 use env_catch
4485 (instr_variable,instr_asgn,instr_svalidate,instr_arg)
4486 (instr_return,instr_adjust,instr_popreg,instr_pushreg): Provide
4487 appropriate debug diagnostics
4488 (bi_hasmx): Call freemx only if getmx returned success.
4489 Call env_catch otherwise
4490 * testsuite/etc/Makefile.am: New files ack.rc and catch.rc
4491 * testsuite/etc/ack.rc: New file
4492 * testsuite/etc/catch.rc: New file
4493 * testsuite/mailfromd/DISTFILES: New files ack.exp and catch.exp
4494 * testsuite/mailfromd/ack.exp: New file
4495 * testsuite/mailfromd/catch.exp: New file
4496
4497 * src/gram.y: Implement user-defined functions
4498 * src/lex.l: Likewise
4499 * src/mailfrom.h: Likewise
4500 * src/prog.c: Likewise
4501 * src/symtab.c: Likewise
4502 * TODO: Update
4503
4504 2006-08-21 Sergey Poznyakoff <gray@gnu.org.ua>
4505
4506 * src/gram.y (echo): New statement.
4507 Begin implementing user-defined functions
4508 * src/lex.l: Likewise
4509 * src/mailfrom.h (node_type_echo): New node type
4510 (symbol_enumerator_t): New data type
4511 (symbol_enumerate): New function)
4512 (instr_echo): New instruction
4513 (env_make_frame,env_leave_frame,function_install): New functions
4514 * src/main.c (mlfi_helo, mlfi_envfrom, mlfi_envrcpt, mlfi_header)
4515 (mlfi_eoh, mlfi_body, mlfi_eom): Create normal stack frame before
4516 calling the handler.
4517 (main): Use print_code to handle --dump-code option
4518 * src/prog.c (struct eval_environ): New member `base'
4519 (pop): Return popped value
4520 (instr_ston): Fix format spec
4521 (instr_echo): New instruction
4522 (env_make_frame, env_leave_frame): New functions
4523 (env_catch): Create normal stack frame for the catch handler. Pass
4524 it the exception code as its argument.
4525 (print_code): New function.
4526 * src/symtab.c (SYM_.*): Move defines to mailfrom.h
4527 (symbol_enumerate): new function
4528 (function_install): New function
4529
4530 * src/gram.y: Implement catch statement
4531 * src/lex.l: Likewise
4532 * src/mailfrom.h (mf_status_count): New value
4533 (struct catch_node): New data type
4534 (node_type_catch): New node type
4535 (instr_catch): New function
4536 * src/prog.c (struct eval_environ): New member `catch'
4537 (instr_catch): New function
4538 (env_catch): New function
4539 (dump_locus,dump_push_immediate,dump_symbol,dump_branch,dump_return)
4540 (dump_header,dump_builtin,dump_variable,mx_match): Change
4541 signature. All callers updated
4542 (instr_catch,dump_catch): New function
4543 (env_init): Initialize catch array
4544
4545 2006-08-20 Sergey Poznyakoff <gray@gnu.org.ua>
4546
4547 * src/gram.y: Implement MX MATCHES and MX FNMATCHES.
4548 Change handling of compiled regular expressions.
4549 (%union): New member matchtype
4550 (MXMATCHES,MXFNMATCHES): New tokens
4551 (optimize,optimize_node): New function
4552 (codegen): Call optimize
4553 * src/lex.l (MXMATCHES,MXFNMATCHES): New tokens
4554 * src/mailfrom.h (bin_regex,struct regex_node): Remove
4555 (struct bin_node): New member qualifier
4556 (node_type_push,node_type_regcomp): New node types
4557 (struct node.v.re): Removed
4558 (instr_fnmatch_mx,instr_regex_mx): New functions
4559 * src/prog.c (instr_fnmatch_mx,instr_regex_mx): New functions
4560 (instr_regex,instr_regcomp): Rewritten
4561
4562 * NEWS: Update
4563 * src/gram.y: Add arithmetical operations. Fix the implicit type
4564 conversion rules.
4565 (test_program): Removed
4566 (mailfromd_test): New function
4567 * src/mailfrom.h (bin_add,bin_sub,bin_mul,bin_div): New binary
4568 opcodes
4569 (unary_minus): New unary opcode
4570 (instr_add,instr_sub,instr_mul,instr_div,instr_neg): New functions
4571 (env_init,env_push_string,env_push_number,env_set_variable): New
4572 declarations.
4573 (test_program): Removed
4574 (mailfromd_test): New declaration
4575 * src/main.c: The --test option takes an optional argument
4576 specifying which state handler to test. Only one handler can be
4577 tested per invocation. Command line interface allows to define all
4578 types of variables (sendmail, mailfromd and positional arguments).
4579 * src/prog.c (instr_add,instr_sub,instr_mul,instr_div)
4580 (instr_neg,env_set_variable): New functions.
4581 * testsuite/mailfromd/cidr.exp: Update for new --test semantics
4582 * testsuite/mailfromd/cond.exp: Likewise
4583 * testsuite/mailfromd/relayed.exp: Likewise
4584
4585 2006-08-19 Sergey Poznyakoff <gray@gnu.org.ua>
4586
4587 * NEWS: Update
4588 * configure.ac: Update to 1.9.92
4589 * src/dns.c (freemx): New function
4590 * src/gram.y: Use verbose error diagnostics.
4591 (NUMBER): New token
4592 * src/lex.l: Return CODE only for strings consisting of three
4593 digits. Other number of digits form NUMBER token.
4594 Allow to split strings among multiple lines using \ as the last
4595 character on the line
4596 * src/mailfrom.h: Rearrange and add comments
4597 * src/main.c (check_mx_records): Use freemx
4598 * src/mu_dbm.c: Update copyright year
4599 * src/prog.c (bi_hasmx): use freemx
4600 * src/rate.c: Update copyright year
4601
4602 2006-08-18 Sergey Poznyakoff <gray@gnu.org.ua>
4603
4604 * src/gram.y: Bugfixes
4605 * testsuite/etc/Makefile.am: Add arg.rc, arg.pat
4606 * testsuite/etc/arg.rc: New file
4607 * testsuite/etc/arg.pat: New file
4608 * testsuite/mailfromd/DISTFILES: Add arg.exp
4609 * testsuite/mailfromd/arg.exp: New file
4610
4611 * src/cache.c (format_status): Remove function. Use mf_status_str
4612 instead.
4613 * src/gram.y: Handle positional arguments
4614 (state_tag,state_args): New variables
4615 (action: ACT_CONTINUE, ACT_DISCARD): Initialize $$->v.ret to all
4616 zeros.
4617 (parse_config): Fix return value
4618 (mf_status_str): extern
4619 (test_program): Call env_init
4620 (builtin_variable_install): Change return value
4621 * src/lex.l: $N notation (positional parameter)
4622 Fix IDENTIFIER rule to accept single-character identifiers
4623 * src/mailfrom.h (node_type_arg): New node type
4624 (define_numeric_var): Removed
4625 (get_rcpt_count,clear_rcpt_count,incr_rcpt_count): New functions
4626 (mf_status_str): New declaration
4627 (builtin_variable_install): Change return value
4628 * src/main.c (struct message_data): Remove numrcpt
4629 (mlfi_helo,mlfi_envfrom,mlfi_envrcpt,mlfi_header,mlfi_eoh)
4630 (mlfi_body,mlfi_eom): Init env and pass positional parameters.
4631 (mlfi_envrcpt): Update rcpt_count variable using incr_rcpt_count
4632 (mlfi_eom): Clear %rcpt_count
4633 * src/prog.c (env_init,env_push_string,env_push_number): New
4634 functions.
4635 (get_rcpt_count,clear_rcpt_count,incr_rcpt_count): New functions
4636 (define_numeric_var): Remove function
4637 (bi_numrcpt): Directly update %rcpt_count cell.
4638 (bi_greylist): Directly update %greylist_seconds_left cell
4639 (builtin_setup): Initialize offsets of the internal variables
4640 * src/symtab.c: Indentation fix
4641
4642 * TODO: Update
4643
4644 * src/cache.c, src/rate.c: Include trailing nul to the
4645 key size.
4646 * src/db.c (db_list_item,db_delete): Include trailing nul to the
4647 key size
4648 (db_expire): Do not return error on failed reads if
4649 ignore_failed_reads_option is set.
4650 (db_compact): Add trailing zero to the keys missing it.
4651 * src/dns.c: Debug level 100 is reserved for instruction traces
4652 * src/mailfrom.h (DEFAULT_RATE_DATABASE): Include suffix
4653 (ignore_failed_reads_option): New variable
4654 * src/main.c (ignore_failed_reads_option): New variable
4655 Do not use debug level 100, it is reserved for instruction
4656 traces.
4657 (--ignore-failed-reads): New option
4658
4659 * configure.ac: Remove NDBM and DBM support.
4660 * src/cache.c: Lock the database before writing to it.
4661 * src/prog.c: Likewise
4662 * src/rate.c: Likewise
4663 * src/db.c (db_compact): Implement locking. Improve error
4664 checking.
4665 * src/mailfrom.h (DEFAULT_DATABASE): File name with suffix.
4666 * src/main.c (db_format_setup): Initialize locking parameters.
4667 * src/mu_dbm.c: Remove NDBM and DBM support. Implement locking
4668 functions.
4669 * src/mu_dbm.h: Likewise
4670
4671 Handle multiple DB formats by keeping a symbol table, describing
4672 main primitives for each of them. When a database management
4673 action is required (by using --list, --delete, --expire or
4674 --compact), the DB format can be given via --format option. The
4675 database file name can be given using --file option.
4676
4677 * src/cache.c: Rewritten using new DB format handling primitives.
4678 * src/prog.c: Likewise
4679 * src/rate.c: Likewise
4680 * src/db.c (all functions): Change data types to int. Improve
4681 error checking
4682 (db_compact): New function (Note: no locking so far!)
4683 * src/symtab.c (SYM_DB_FORMAT): New symbol state
4684 (struct symtab.v): New member db
4685 (db_format_install,db_format_lookup): New functions
4686 * src/mailfrom.h (struct db_format): New data type
4687 (db_format_install,db_format_lookup): New functions
4688 * src/main.c (options --expire,--list,--delete): Do not take
4689 argument. --format and/or --file should be used instead
4690 (--format, --file): New options
4691 * src/mu_dbm.c (mu_dbm_file_name): New function
4692 (mu_dbm_stat): Rewrite using mu_dbm_file_name.
4693 * src/mu_dbm.h (mu_dbm_file_name): New function
4694 Remove obsolete __P() declaration wrappers.
4695
4696 2006-08-17 Sergey Poznyakoff <gray@gnu.org.ua>
4697
4698 * src/Makefile.am (mailfromd_SOURCES): Add ml.c
4699 * src/ml.c: New file.
4700 * src/db.c: Rewrite db_expire to avoid skipping some keys using
4701 broken backends (namely, GDBM)
4702 * src/gram.y: Bugfixes
4703 * src/lex.l: Implement multy-line strings.
4704 * src/mailfrom.h (sendmail_mlreply): New function.
4705 * src/main.c (ctx_setreply): Implement multy-line responses.
4706 * src/prog.c (bi_greylist): Define greylist_seconds_left in both
4707 branches of the conditional.
4708 * testsuite/etc/Makefile.am: Add ml.rc, ml.pat
4709 * testsuite/etc/ml.rc: New file.
4710 * testsuite/etc/ml.pat: New file.
4711 * testsuite/mailfromd/DISTFILES: Add ml.exp
4712 * testsuite/mailfromd/ml.exp: New testcase
4713
4714 2006-08-16 Sergey Poznyakoff <gray@gnu.org.ua>
4715
4716 * src/gram.y: Add comparison operators (<,<=,>,>=)
4717 * src/lex.l: Likewise.
4718 * src/mailfrom.h: Likewise.
4719 (define_numeric_var): New function
4720 * src/prog.c: Add comparison operators (<,<=,>,>=)
4721 (struct eval_environ): Remove mailpool. Use heap to keep string
4722 values.
4723 Remove numrcpt. The number of recipients is kept in the variable
4724 %rcpt_count
4725 (pushs): New function
4726 (instr_arg): New function (for future use)
4727 (env_set_numrcpt,env_alloc,free_meme): Removed
4728 (define_numeric_var): New function
4729 * src/main.c (mlfi_envrcpt): Define %rcpt_count
4730
4731 * testsuite/etc/Makefile.am (RCFILES,PATFILES): Add numrcpt test
4732 * testsuite/etc/numrcpt.pat: New file.
4733 * testsuite/etc/numrcpt.rc: New file.
4734 * testsuite/mailfromd/numrcpt.exp: New file
4735
4736 * NEWS: Update
4737 * doc/mailfromd.texi: Start rewriting
4738 * src/gram.y: Implement concatenation of expressions and internal
4739 variables.
4740 * src/lex.l: Implement internal variables (%name notation)
4741 * src/mailfrom.h (stack_size, variable_count): New variables.
4742 (struct return_node.message): Change type to NODE
4743 (struct concat_node, asgn_node): New data types
4744 (node_type_concat,node_type_asgn,node_type_variable): New node
4745 types.
4746 (struct node.v): add new structures.
4747 (instr_concat,instr_variable,instr_asgn,instr_svalidate): New
4748 instructions.
4749 (struct function): New member `name'
4750 (struct varuable): New structure
4751 (variable_install,variable_lookup,builtin_variable_install): New
4752 functions.
4753 * src/prog.c (stack_size): new variable
4754 (struct eval_environ): Remove stacksize. New members: toh, var
4755 (struct environ_state): Remove
4756 (push): Do not realloc stack. Take into account heap top when
4757 computing stack space left.
4758 (heap_reserve): New function
4759 (instr_return): Remove third immediate argument (message). Take it
4760 from the stack instead
4761 (dump_return): Likewise
4762 (instr_concat,instr_variable,instr_asgn,instr_svalidate): New
4763 instructions.
4764 (struct optab): Add new instructions
4765 (eval_environment): Initialize tos and toh
4766 (create_environment): stack_size gives the total size of the
4767 stack+heap.
4768 Allocate memory for the variable array.
4769 (bi_greylist): Do not prolong greylisting period if the function
4770 is called within a greylisting interval.
4771 Variable greylist_seconds_left keeps the number of seconds left to
4772 the end of the greylisting period.
4773 (builtin_setup): Install greylist_seconds_left variable.
4774 * src/symtab.c (SYM_VARIABLE): New entry state.
4775 (struct symtab.name): Move to the union. All references updated.
4776 (variable_install,variable_lookup): New functions.
4777
4778 2006-08-14 Sergey Poznyakoff <gray@gnu.org.ua>
4779
4780 * src/gram.y (MARK_LOCUS): Optimize insertion of instr_locus codes.
4781 * TODO: New file.
4782
4783 2006-08-13 Sergey Poznyakoff <gray@gnu.org.ua>
4784
4785 * src/prog.c (instr_header): Allocate header_node.
4786
4787 2006-08-12 Sergey Poznyakoff <gray@gnu.org.ua>
4788
4789 * src/main.c: Call umask in child process. Set default umask to
4790 0117.
4791 * testsuite/.cvsignore: Update
4792 * testsuite/etc/.cvsignore: Update
4793 * testsuite/etc/cond.rc: Update
4794
4795 * configure.ac: Remove stray AC_DEFINE
4796 * src/lex.l (line_finish): Extra debug
4797 * src/main.c (mailfromd_show_defaults): Print version instead of
4798 the method.
4799 * src/prog.c (eval_environment): Initialize status to
4800 SMFIS_CONTINUE.
4801 * testsuite/Makefile.am (SUBDIRS): Remove .
4802 * testsuite/etc/Makefile.am (RCFILES): Add cidr.rc, cond.rc,
4803 greylist.in, relayed.list, relayed.rc
4804 (PATFILES): Add greylist.pat
4805 (CLEANFILES, noinst_DATA): Add greylist.rc
4806 (.in.rc): New implicit rule
4807 * testsuite/etc/cidr.rc: New file
4808 * testsuite/etc/cond.rc: New file
4809 * testsuite/etc/greylist.in: New file
4810 * testsuite/etc/greylist.pat: New file
4811 * testsuite/etc/relayed.list: New file
4812 * testsuite/etc/relayed.rc: New file
4813
4814 * testsuite/lib/mailfromd.exp (start_daemon): Prefix config name
4815 with MAILFROMD_ETC_DIR only if it does not already begin with /
4816 (mailfromd_init): Initialize MAILFROMD_STATE_DIR instead of doing
4817 it in (default_mailfromd_start)
4818 (default_mailfromd_version, mailfromd_version)
4819 (mailfromd_check_capability,mailfromd_exec): New functions
4820 (mailfromd_pat): New keyword :RCDIR
4821 * testsuite/mailfromd/DISTFILES: Add new files
4822 * testsuite/mailfromd/cidr.exp: New file
4823 * testsuite/mailfromd/cond.exp: New file
4824 * testsuite/mailfromd/greylist.exp: New file
4825 * testsuite/mailfromd/relayed.exp: New file
4826
4827 * Makefile.am (SUBDIRS): Add testsuite
4828 * configure.ac (AC_CONFIG_FILES): Add testsuite/* Makefiles
4829 * .cvsignore: Update
4830 * src/main.c (option_pidfile): Assign *pval
4831 (mailfromd_daemon): Bail out if daemon fails
4832 * testsuite: New directory
4833 * testsuite/Makefile.am: Initial import
4834 * testsuite/.cvsignore: Likewise
4835 * testsuite/mail.null: Likewise
4836 * testsuite/etc: New directory
4837 * testsuite/etc/Makefile.am: Initial import
4838 * testsuite/etc/.cvsignore: Likewise
4839 * testsuite/etc/accept.pat: Likewise
4840 * testsuite/etc/accept.rc: Likewise
4841 * testsuite/etc/reject.pat: Likewise
4842 * testsuite/etc/reject.rc: Likewise
4843 * testsuite/etc/sendmail.cin: Likewise
4844 * testsuite/etc/sendmail.m4: Likewise
4845 * testsuite/etc/tempfail.pat: Likewise
4846 * testsuite/etc/tempfail.rc: Likewise
4847 * testsuite/lib: New directory
4848 * testsuite/lib/DISTFILES: Initial import
4849 * testsuite/lib/mailfromd.exp: Likewise
4850 * testsuite/mailfromd: New directory
4851 * testsuite/mailfromd/DISTFILES: Initial import
4852 * testsuite/mailfromd/actions.exp: Likewise
4853
4854 2006-08-11 Sergey Poznyakoff <gray@gnu.org.ua>
4855
4856 * src/gram.y: Warn if accept is used with arguments.
4857 Check codes and xcodes for reject and tmpfail actions.
4858 * src/main.c: New option --log-tag (-L) sets syslog tag.
4859 * src/prog.c: New test greylist.
4860
4861 2006-08-10 Sergey Poznyakoff <gray@gnu.org.ua>
4862
4863 * THANKS: Add Jan Rafaj
4864 * NEWS, configure.ac: Raise version number to 1.9.91
4865 * doc/mailfromd.texi: Update
4866 * src/db.c (db_expire): Rewritten the loop after the proposal of
4867 Jan Rafaj.
4868 * src/dns.c (_getmx,cnameloop): Use res_n* functions to assure
4869 thread safety.
4870
4871 * src/gram.y: Major change in confguration language. By default
4872 all code will be executed in envfrom SMTP state. The parts of code
4873 enclosed in 'PROG <state> DO ... DONE' will be executed when the
4874 requested <state> is handled. Deferred evaluation is considered a
4875 failed experiment and is removed. ITER statement is removed as
4876 well, since it is no longer needed.
4877 * src/lex.l (iter): Remove keyword
4878 (prog): New keyword
4879 * src/mailfrom.h (enum smtp_state): smtp_state_first marks first
4880 executable SMTP state, smtp_state_count gives the number of
4881 available states.
4882 (struct iter_node,node_type_iter,instr_iter,instr_pushenv)
4883 (instr_suspend): Removed.
4884 (entry_point): New global data
4885 (environment_get_null_symbol): Return locus in the location
4886 pointed to by the second argument.
4887 (codegen): Remove declaration
4888 (dump_code): Accepts two arguments.
4889 * src/main.c (check_on_host): Be more liberal. Return
4890 mf_temp_failure if any transport error occurs
4891 Send QUIT after exiting the loop, so that we close the transaction
4892 correctly even if we get a negative reply.
4893 (xeval,mlfi_eval): New functions.
4894 (mlfi_helo,mlfi_envfrom,mlfi_envrcpt,mlfi_header,mlfi_eoh)
4895 (mlfi_eom,mlfi_body): Use mlfi_eval to evaluate the response.
4896 (smfilter,milter_enable_state): Set all handlers on request, when
4897 a specified PROG is available to avoid useless milter calls.
4898 (main): Rewritten handling of --dump-code
4899 * src/prog.c (struct eval_environ) Remove statepool and
4900 smtp_state.
4901 (environ_save_state,environ_restore_state,environ_state_free):
4902 Remove.
4903 (instr_symbol): Fix debug diagnostic corresponding to previous
4904 cases of deferred evaluation.
4905 (instr_pushenv,instr_iter,dump_iter,instr_suspend): Remove
4906 (dump_code): Take two arguments.
4907 (eval_environment): Check second argument type (prog_counter_t).
4908 (environment_get_null_symbol): Return location where the undefined
4909 symbol occurs in the memory location pointed to by the second
4910 variable.
4911 (bi_numrcpt): Remove non-local jump
4912
4913 2006-08-08 Sergey Poznyakoff <gray@gnu.org.ua>
4914
4915 * doc/mailfromd.texi: Update
4916 * src/gram.y (code_node): Optimize code generation for `ON POLL'
4917 statements, avoiding multiple generation of action code for `or'
4918 branches.
4919 * src/main.c: Exit immediately if any of the --dump options was
4920 given.
4921
4922 2006-08-06 Sergey Poznyakoff <gray@gnu.org.ua>
4923
4924 * src/main.c (mlfi_helo): Do not clear md->helostr after
4925 processing. We don't rely on sendmail setting $s any more.
4926 * src/prog.c (instr_symbol): Improve debugging messages
4927 (bi_match_cidr): New builtin.
4928
4929 2006-08-01 Sergey Poznyakoff <gray@gnu.org.ua>
4930
4931 * configure.ac (AC_ARG_WITH([berkeley-db])): Fix the help string
4932 * README, doc/mailfromd.texi, doc/rendition.texi: Update
4933
4934 * src/gram.y (%union): const struct builtin
4935 (iter): Call milter_enable_state
4936 * src/mailfrom.h (struct builtin_node) const struct builtin
4937 (code_instr,code_immediate): Take const argument
4938 (milter_enable_state): New function
4939 * src/main.c (mlfi_header,mlfi_header,mlfi_eoh): Initial
4940 implementation.
4941 (milter_enable_state): New function
4942 (set_milter_header,set_milter_body): Removed
4943 Removed "API control" options (--milter-body and --milter-header).
4944 * src/prog.c (code_instr,code_immediate): Take const argument
4945 (bi_resolve): Fix inet_ntoa usage
4946 (dbmap_lookup_p): Change first argument
4947
4948 2006-07-31 Sergey Poznyakoff <gray@gnu.org.ua>
4949
4950 * src/gram.y: Use get_smtp_domain() instead of smtp_domain
4951 * src/mailfrom.h (smtp_domain): Removed declaration;
4952 (get_smtp_domain): New function
4953 * src/main.c (get_smtp_domain): New function
4954 (main): Remove initialization of smtp_domain.
4955 * src/prog.c (dbmap_lookup_p): Protect the text by ifdef USE_DBM
4956 (builtin_setup): Do not install bi_dbmap if DBM is not used.
4957
4958 * NEWS: Update
4959 * src/mailfrom.h (string_to_state,state_to_string): New functions
4960 (instr_iter,instr_pushenv,instr_suspend): New functions
4961 (struct iter_node): New data type
4962 * src/gram.y: Support ITER construct
4963 (string_to_state,state_to_string): New functions
4964 * src/lex.l: Support ITER construct
4965 * src/prog.c: Support ITER construct
4966 (struct eval_environ): New member statepool
4967 (struct environ_state): New member next
4968 (environ_save_state): Create the state in the internal environment
4969 memory pool
4970 (destroy_environment): Free states from the pool
4971 (instr_pushenv,instr_iter,dump_iter,instr_suspend): New functions
4972 * src/main.c (mlfi_envrcpt): Remove implicit looping in envrcpt state.
4973 (struct message_data): Remove envstate. All references updated
4974
4975 2006-07-30 Sergey Poznyakoff <gray@gnu.org.ua>
4976
4977 * src/gram.y: Use direct boolean arithmetics: 1 means true, 0 means
4978 false.
4979 * src/prog.c: Likewise
4980 (bi_resolve,bi_hasmx): New builtins
4981
4982 * etc/sendmail-8.13.7.diff: Added to the repository
4983
4984 * configure.ac: Update version number to 1.9.90
4985 * NEWS: Update for 1.9.90
4986 * src/main.c (struct option_cache): New option cumulative (sync
4987 with 1.x)
4988 Mark relay as cumulative
4989 (set_option): Ignore override for cumulative options
4990 * src/prog.c (instr_rate): Bugfix
4991
4992 * configure.ac: Change DB options to those used by MU configure.
4993 * src/main.c: New option --group (pragrma group)
4994 (switch_to_privs): Retain groups specified with --group options
4995 (mailfromd_show_defaults): Show DB version in use.
4996 (main): Call MU_AUTH_REGISTER_ALL_MODULES
4997 * src/mu_dbm.c (mu_dbm_open): Fix for DB 3.x
4998 * src/mu_dbm.h: Likewise
4999 * src/prog.c (environ_state_free): State can be NULL
5000 (bi_dbmap): Fix order of arguments
5001
5002 * configure.ac (MAILUTILS_LIBS): Link with MU Auth
5003 * src/gram.y: Allow numeric constants in the program
5004 * src/mailfrom.h (enum node_type): New type node_type_number
5005 (enum smtp_state, environ_state_t): new data type
5006 (eval_environment): Takes 2nd argument: smtp_state. All callers
5007 updated.
5008 (environ_save_state,environ_restore_state,environ_state_free): New
5009 functions.
5010 (emalloc): New prototype
5011 * src/main.c (struct message_data): New member envstate
5012 (priv_get,filter_cleanup): Handle envstate
5013 (mlfi_helo,mlfi_envfrom): Update call to eval_environment
5014 (mlfi_envrcpt): Save environment state on the first call, restore
5015 it on subsequent ones.
5016 Keep track of the number of recipients.
5017 (mlfi_header): Call eval_environment
5018 (mlfi_eom): Call eval_environment. Return tempfail if the
5019 configuration program did not finish.
5020 (capa): Use "auth" capability
5021 * src/prog.c (struct eval_environ): New fields numrcpt, smtp_state
5022 (struct environ_state): New data type
5023 (environ_save_state,environ_restore_state,environ_state_free): New
5024 functions.
5025 (instr_ston,instr_ntos): Bugfix: do not advance pc
5026 (instr_symbol): Do not set env->status before longjump
5027 (env_set_numrcpt): New function
5028 (eval_environment): Take 2nd argument: the smtp state
5029 (bi_numrcpt,bi_validuser,bi_dbmap): New builtins
5030 (builtin_setup): Register new builtins
5031
5032 2006-07-29 Sergey Poznyakoff <gray@gnu.org.ua>
5033
5034 * src/symtab.c: New file
5035 * src/Makefile.am (mailfromd_SOURCES): Add symtab.c
5036 * src/gram.y: Introduce builtin functions. Remove rules for
5037 HOSTNAME and RELAYED: they are builtins now.
5038 * src/lex.l: Likewise
5039 * src/prog.c: Likewise
5040 * src/mailfrom.h: Add missing prototypes. Make debug macros safe
5041 to use within if blocks
5042 (struct builtin, struct function): New data types
5043 * src/main.c (check_mx_records): Add default case
5044 (listens_on): New function (for compatibility with 1.x branch)
5045 (mlfi_eom): Clear numrcpt
5046 (main): Call builtin_setup. Check return value of codegen
5047 * src/rate.c (get_rate): Remove unused variable
5048
5049 2006-07-26 Sergey Poznyakoff <gray@gnu.org.ua>
5050
5051 * configure.ac: Implement --with-forks option from 1.x branch.
5052 * src/Makefile.am (LDADD): Use MILTER variable instead of
5053 hardcoding -lmilter
5054 * src/main.c (struct message_data): New members env, helostr and
5055 numrcpt
5056 (priv_get): Initialize new message_data members
5057 (ctx_getsym): Special handling for $s - sendmail does not set it
5058 when calling xxfi_helo
5059 (filter_cleanup): Use priv_get instead of MLFIPRIV
5060 Destroy the environment
5061 (mlfi_helo): Use priv_get instead of MLFIPRIV
5062 Set md->helostr
5063 (mlfi_envfrom): Use priv_get instead of MLFIPRIV
5064 Use md->env instead of creating new environment
5065 (mlfi_envrcpt): Increase numrcpt
5066 (mlfi_eom): Use priv_get instead of MLFIPRIV
5067 * src/prog.c (get_immediate): Compensate for changes in
5068 eval_environment
5069 (eval_environment): Fix reenterability: increase env->pc only when
5070 the instruction returns successfully.
5071
5072 2006-06-14 Sergey Poznyakoff <gray@gnu.org.ua>
5073
5074 * src/Makefile.am: Remove MU_COMPAT. We need the latest mailutils
5075 (pre 1.0)
5076 * src/gram.y: Adopt new MU namespace
5077 (code_node): Fix generation of 'and' and 'or' code
5078 * src/lex.l: Adopt new MU namespace
5079 * src/mailfrom.h (instr_and,instr_or): Remove
5080 Adopt new MU namespace
5081 * src/main.c: Adopt new MU namespace
5082 New option --source
5083 * src/prog.c: Adopt new MU namespace
5084 (instr_and,instr_or): Remove
5085 * doc/mailfromd.texi: Update
5086
5087 2006-01-17 Sergey Poznyakoff <gray@gnu.org.ua> (Sync with v_1_0)
5088
5089 * src/main.c (check_portspec): Fix eventual coredump and add more
5090 checks.
5091
5092 2006-01-10 Sergey Poznyakoff <gray@gnu.org.ua>
5093
5094 * src/gram.y (code_node): Use BNZ for branching.
5095 [poll]: bugfix
5096 * src/main.c (config_dump): Renamed to config_dump_tree.
5097 (code_dump): Renamed to config_dump_code.
5098 New opions --dump-tree (eq. --debug=d), --dump-grammar-trace
5099 (eq. --debug=y), --dump-lex-trace (eq. --debug=l), --dump-code
5100 (eq. --debug=c).
5101 * src/prog.c (adjust_stack): Fix typo (reverted sign)
5102 (get_immediate): pc is already advanced by 1 by the time the
5103 function is called.
5104 (instr_bz, instr_bnz, instr_jmp): Fix 2nd. argument to advance_pc
5105 (instr_callout): Fix typo: adjust_stack instead of advance_pc.
5106
5107 2006-01-10 Sergey Poznyakoff <gray@gnu.org.ua>
5108
5109 Started major rewrite. The final aim is to make the internal
5110 program reentrant and to make it stop when it is trying to
5111 reference a non-existend sendmail variable. Then, the milter
5112 handler should return SMFIS_CONTINUE to pass control over to the
5113 next handler. That, in turn, should restart program execution in
5114 the hope that Sendmail has provided the variable on this stage. If
5115 it does not the process continues.
5116
5117 * src/Makefile.am (mailfromd_SOURCES): Add prog.c
5118 * src/prog.c: New file
5119 * src/gram.y (codegen): Add code generation functions.
5120 (name_comp,name_destroy,dict_init,dict_install,dict_destroy)
5121 (dict_getsym): Move to prog.c
5122 (eval_poll,eval_hostname,eval_rate,eval_node)
5123 (eval_node_list,run_program): Remove runtime evaluation functions
5124 (ctx_getsym,ctx_setreply,ctx_setheader): Moved to main.c
5125 (test_program): Rewritten using new functions
5126 * src/lex.l: Return EQ and NE as keywords.
5127 (parse_error_locus): New function.
5128 * src/mailfrom.h (regex_flags): Extern declaration
5129 (eval_environ_t,instr_t,prog_counter_t): New types.
5130 (instr_xchg,instr_ston,instr_ntos,instr_locus,instr_push_immediate)
5131 (instr_symbol,instr_bz,instr_bnz,instr_jmp,instr_callout,instr_dup)
5132 (instr_cmp,instr_pop,instr_and,instr_or,instr_regex,instr_regcomp)
5133 (instr_fnmatch,instr_not,instr_next,instr_return,instr_header)
5134 (instr_resolve,instr_relayed_domain,instr_rate,instr_eqn,instr_eqs)
5135 (instr_nen,instr_nen,create_environment,destroy_environment)
5136 (eval_environment,environment_get_status,codegen)
5137 (parse_error_locus): New functions
5138 * src/main.c (code_dump): New variable (--debug=c option)
5139 (ctx_getsym,ctx_setreply,ctx_setheader): Moved from gram.y
5140 (mlfi_envfrom): Rewritten using new functions
5141 (decode_debug): Handle [cC]
5142 (main): Generate code and, if required, print it on stdout
5143
5144 2006-01-06 Sergey Poznyakoff <gray@gnu.org.ua>
5145
5146 -= Release 1.3 =-
5147
5148 2006-01-06 Sergey Poznyakoff <gray@gnu.org.ua>
5149
5150 * src/lex.l: Remove leftover argc_unquote_char
5151
5152 2006-01-05 Sergey Poznyakoff <gray@gnu.org.ua>
5153
5154 * configure.ac: Raise version number to 1.3
5155 * NEWS: Updated
5156 * README: Mention BROKEN_PTHREAD_SLEEP Sendmail variable
5157 * doc/mailfromd.texi: Likewise
5158 * src/main.c (check_portspec): New function.
5159
5160 2005-11-24 Sergey Poznyakoff <gray@gnu.org.ua>
5161
5162 * src/Makefile.am (AM_CPPFLAGS): Define MU_COMPAT, needed for
5163 latest mailutils.
5164
5165 2005-09-20 Sergey Poznyakoff <gray@gnu.org.ua>
5166
5167 * src/dns.c (resolve_ipstr): New implementation, taking into
5168 account cnames.
5169 * src/main.c (resolve_ipstr): Removed in favor of the new
5170 implementation.
5171
5172 2005-08-17 Sergey Poznyakoff <gray@gnu.org.ua>
5173
5174 * THANKS: New file
5175 * Makefile.am (AUTOMAKE_OPTIONS): New variable
5176 * configure.ac: Raised version number to 1.2
5177 * NEWS: Likewise.
5178
5179 * doc/gendocs_template: Updated
5180 * doc/mailfromd.texi: Updated
5181
5182 * src/cache.c (cache_delete): Rewritten using db_delete
5183 * src/db.c (db_delete): New function
5184 * src/mailfrom.h: Likewise
5185 * src/main.c: Option --delete takes an optional argument, as
5186 --list and --expire
5187 * src/rate.c (rate_delete): New function
5188
5189 * src/lex.l (line_add_unescape): Use argcv_unquote_char
5190 * src/cache.c: Use separate expiration times for negative and
5191 positive entries.
5192 * src/mailfrom.h: Likewise.
5193 * src/main.c: Likewise.
5194 * src/dns.c (getmx): Return immediately in mf_temp_failure.
5195
5196 2005-08-09 Sergey Poznyakoff <gray@gnu.org.ua>
5197
5198 * src/main.c: New option --syslog (cancels --stderr).
5199 (parse_opt) Make sure the errors are reported on stderr wherever
5200 it is connected to a tty (unless in daemon mode or otherwise
5201 directed by --syslog option).
5202
5203 2005-08-08 Sergey Poznyakoff <gray@gnu.org.ua>
5204
5205 * src/gram.y (stmtlist): Bugfix
5206 (NEXT): New token
5207 * src/lex.l (NEXT): New token
5208 * src/mailfrom.h (node_type_continue): Renamed to node_type_next
5209
5210 * src/gram.y (ACT_CONTINUE): Continue execution of the program
5211 * src/mailfrom.h (node_type_continue): New node type
5212
5213 * configure.ac (DEFAULT_EXPIRE_RATES_INTERVAL): New variable
5214 * src/db.c: New file
5215 * src/Makefile.am (mailfromd_SOURCES): Add db.c
5216 (AM_CPPFLAGS): Define DEFAULT_EXPIRE_RATES_INTERVAL
5217 * src/mailfrom.h (db_item_printer_t,db_expire_t): New types
5218 (rate_expire_db,db_list_item,db_list,db_expire): New functions
5219 * src/cache.c (cache_list_item,cache_list_db,cache_expire_db):
5220 Rewritten using functions from db.c
5221 * src/main.c (MAILFROMD_EXPIRE_RATEDB): New mode
5222 (parse_opt): Removed --list-rates option. Both --list and --expire
5223 now take an optional argument, specifying which database to
5224 operate upon.
5225 (set_rates_expire): New function. Handles rates-expire-interval
5226 pragma.
5227 * src/rate.c (get_rate): Optimized expiration logic.
5228 (rate_list_item,rate_list_db): Rewritten using functions from db.c
5229 (rate_expire_db): New function
5230
5231 2005-08-07 Sergey Poznyakoff <gray@gnu.org.ua>
5232
5233 * configure.ac: Complain if a DB support is required but not
5234 found.
5235 * src/rate.c: New file
5236 * src/Makefile.am: Add rate.c
5237 * src/gram.y: Add support for rate statement
5238 * src/lex.l: Likewise.
5239 * src/main.c: Likewise.
5240 * src/mailfrom.h: Rename getmx_status to mf_status
5241 * src/cache.c: Likewise.
5242 * src/dns.c: Likewise.
5243
5244 * doc/mailfromd.texi: Documented rate statement
5245 * etc/mailfromd.rc: Likewise
5246
5247 2005-07-31 Sergey Poznyakoff <gray@gnu.org.ua>
5248
5249 * src/main.c (check_on_host): Destroy IO data only if these have
5250 been initialized.
5251 * src/dns.c (_getmx): Fix eventual buffer overflow.
5252
5253 2005-07-28 Sergey Poznyakoff <gray@gnu.org.ua>
5254
5255 * src/gram.y: Do not include gram.h
5256 (eval_hostname): Return with unmodified val if resolve_ipstr
5257 fails.
5258
5259 * configure.ac: Raised version number to 1.1
5260 Check for argcv_unescape_char vs. argcv_unquote_char (CVS
5261 mailutils declares the latter).
5262 * src/Makefile.am: Bugfix: place LIBOBJS into LDADD
5263 * src/dns.c: Include resolv.h after netinet/in.h
5264
5265 2005-06-30 Sergey Poznyakoff <gray@Noldor.runasimi.org>
5266
5267 * doc/mailfromd.texi: Fixed usage of @email{} and @url{}.
5268
5269 2005-06-17 Sergey Poznyakoff <mail@sun.farlep.net>
5270
5271 * src/cache.c (cache_expire_db): Check for res==NULL.
5272 * src/main.c (method_strict): Give precedence to temporary
5273 failure, if it occurs in any poll.
5274 (method_standard): Check the client host unless mx check gives
5275 success. Give precedence to temporary failure, if it occurs in any
5276 poll.
5277
5278 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5279
5280 * src/main.c (smtp_send2,smtp_send3): Send fully formed command,
5281 along with final CRLF, in one go.
5282 (method_standard): Check MXs first, and only if they fail, check the
5283 client host.
5284 * src/gram.y (eval_poll): Fix wording of trace message
5285
5286 2005-06-12 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5287
5288 * configure.ac: Raised version number to 1.0.
5289 * Makefile.am (distuninstallcheck_listfiles): New variable. The
5290 install-data-local rule in etc/Makefile.am breaks distuninstall
5291 checks, hence the need to fix it.
5292 * doc/mailfromd.texi: Finished
5293
5294 2005-06-12 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5295
5296 * configure.ac: Warn if DBM support is not configured
5297 * doc/mailfromd.texi: Updated to match recent changes.
5298 * etc/Makefile.am: Install mailfromd.rc
5299 * src/gram.y: Allow two additional arguments to poll: as and from.
5300 * src/lex.l: Handle new keywords: not, as, from.
5301 * src/mailfrom.h (smtp_domain,postmaster_email): External
5302 declarations.
5303 * src/main.c (check_on_host,check_mx_records)
5304 (method_strict,method_standard): Accept two additional arguments.
5305
5306 2005-06-10 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5307
5308 * Makefile.am (SUBDIRS): Add etc
5309 * configure.ac: New subst variable MAILFROMSTATEDIR
5310 * etc: New directory
5311 * etc/Makefile.am: New file
5312 * etc/mailfromd.rc: New file
5313 * etc/rc.in: New file
5314 * etc/.cvsignore: New file
5315 * src/Makefile.am (MAILFROMSTATEDIR): Remove definition
5316 * src/dns.c: Add missing includes.
5317 (free_mx_buffer): Removed
5318 * src/gram.y: Add configurable regcomp flags.
5319 (parse_pragma): New function
5320 * src/lex.l: Parse pragma directives
5321 * src/mailfrom.h: Add new declarations
5322 * src/main.c: Changed option handling
5323
5324 2005-06-09 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5325
5326 * src/gram.y: Implement new keyword 'relayed'
5327 * src/lex.l: Likewise
5328 * src/mailfrom.h: Likewise
5329 * src/main.c (relayed_domain_p): Verify full hostname as well
5330 (method_strict,method_standard): Return success on empty email.
5331
5332 * configure.ac: Raised version number to 0.9.9
5333 * src/Makefile.am (EXTRA_DIST): Added gram.h
5334 * src/gram.y: Improved tracing and debugging output.
5335 * src/lex.l: Return locus along with the keyword
5336 * src/mailfrom.h (debug4,debug5,debug6): New macros
5337 (struct locus): new data type
5338 (struct poll_action, struct node): Include locus
5339 (get_locus, trace): New functions
5340 * src/main.c (do_trace): New variable (option --trace)
5341 (vlogmsg,logmsg,transcript): Fixed signature (const char *fmt).
5342 (trace): New function.
5343 (parse_opt): Handle --trace option.
5344
5345 2005-06-09 Sergey Poznyakoff <gray@Noldor.runasimi.org>
5346
5347 * src/mailfrom.h: New debug macros.
5348 (node_type_hostname): New node type
5349 * src/cache.c: Use new debug macros
5350 * src/dns.c: Likewise
5351 * src/gram.y: Likewise
5352 * src/lex.l: New keyword HOSTNAME.
5353 * src/main.c: Implement header operations
5354
5355 2005-06-08 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5356
5357 * configure.ac: Check for yacc and lex
5358 * src/gram.y: New file. Configuration file grammar and run-time
5359 support.
5360 * src/lex.l: New file. Configuration file lexical analyzer.
5361 * src/Makefile.am (mailfromd_SOURCES): Add gram.y lex.l
5362 (AM_CPPFLAGS): Define SYSCONFDIR
5363 (AM_YFLAGS,AM_LFLAGS): New vars
5364 * src/dns.c: mailutils/mailutils.h are now included from
5365 mailfrom.h
5366 * src/mailfrom.h: Add new includes
5367 (DEFAULT_CONFIG_FILE): New define
5368 Add parse tree-related data types
5369 (parse_error,yyparse,source,parse_config): New declarations
5370 * src/main.c: Major rewrite: removed predefined and configurable
5371 actions, get *the program* to be executed from the configuration
5372 file.
5373 * src/.cvsignore: Updated
5374
5375 2005-06-08 Sergey Poznyakoff <gray@sun.farlep.net>
5376
5377 * src/main.c (smtp_stream_wait): Take an additional
5378 argument: number of attempts. Loop until the stream is ready or
5379 the number of attempts is exhausted. All callers updated.
5380
5381 2005-06-07 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5382
5383 * src/main.c (method_fp,method_standard,method_strict): Changed
5384 return type. All callers updated.
5385 (check_on_host): Issue EHLO if remote party refuses HELO.
5386
5387 2005-06-06 Sergey Poznyakoff <gray@Noldor.runasimi.org>
5388
5389 * src/main.c (method_standard): Check the host first, only if it
5390 does not answer, check MXs.
5391
5392 2005-06-06 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5393
5394 * NEWS: Updated
5395 * README: Updated
5396 * src/main.c (action_failure_default): Changed to return:reject
5397 (SMTP_MAJOR): New macro
5398 (check_on_host): Use SMTP_MAJOR
5399 * doc/.cvsignore: Updated
5400
5401 2005-06-05 Sergey Poznyakoff <gray@Noldor.runasimi.org>
5402
5403 * doc/mailfromd.texi: More documentation
5404 * src/Makefile.am (install-data-local): Create MAILFROMSTATEDIR
5405 * src/cache.c (cache_expire_db): New function
5406 * src/mailfrom.h: Likewise
5407 * src/main.c (add_header): Removed. Use per-message private data
5408 to keep it. All referers updated.
5409 (--delete): New mode
5410 (--expire): New mode
5411
5412 * doc/Makefile.am: Bugfixes
5413 * doc/mailfromd.texi: Created documentation framework
5414 * src/cache.c (cache_get): Do not update timestamps on each
5415 retrieval.
5416 * src/main.c (capa): Add license capability.
5417
5418 * configure.ac (DEFAULT_SOCKET): Change default
5419 * src/Makefile.am (AM_CPPFLAGS): Define MAILFROMSTATEDIR instead
5420 of LOCALSTATEDIR
5421 (LDADD): Get rid of static linkage with libresolv
5422 * src/mailfrom.h (DEFAULT_PIDFILE,DEFAULT_DATABASE): Use
5423 MAILFROMSTATEDIR instead of LOCALSTATEDIR.
5424 * src/dns.c (_getmx): Rewritten using BIND-4-style interface. See
5425 comment to this function for the reasons of this regress.
5426 * src/main.c (check_mx_records): Bugfix. Provide default return
5427 value in case no MX records are found.
5428 (mailfromd_show_defaults): Show MAILFROMSTATEDIR
5429
5430 2005-06-04 Sergey Poznyakoff <gray@Noldor.runasimi.org>
5431
5432 * Makefile.am (SUBDIRS): Add doc
5433 * configure.ac (AC_CONFIG_FILES): Add doc/Makefile
5434 * src/main.c (postmaster_email): New variable
5435 (check_on_host): Use postmaster_email instead of hardcoding <>
5436 address.
5437 (options): New option --postmaster-email; Fixed several bugs.
5438 (parse_opt): Handle --postmaster-email option. Minor fixes.
5439 * doc: New directory
5440 * doc/Makefile.am, doc/fdl.texi, doc/gendocs_template,
5441 doc/mailfromd.texi, doc/rendition.texi, doc/.cvsignore: New files.
5442
5443 * Makefile.am: Updated for deep directory structure
5444 * configure.ac: Updated for deep directory structure. Detect
5445 DBM/NDBM/GDBM, define variables for caching. Raised
5446 version number to 0.2
5447 * src: New directory
5448 * dns.c, daemon.c, obstack.c, obstack.h, snprintf.c,
5449 snprintf.h, mailfrom.h: Moved to ...
5450 * src/dns.c, src/daemon.c, obstack.c, src/obstack.h,
5451 src/snprintf.c, src/snprintf.h, src/mailfrom.h: here
5452 * src/Makefile.am: New file
5453 * main.c: Moved to src/
5454 * src/main.c: Moved from ../. Added result caching and new
5455 operating modes.
5456 * src/mu_dbm.c, src/mu_dbm.h, src/strtok_r.c: New files. Exported
5457 from mailutils
5458 * src/cache.c: New file. Caching support.
5459 * .cvsignore: New file
5460 * src/.cvsignore: New file
5461
5462 * dns.c (getmx): Do not skip hostname when checking. Handle both
5463 IP address and FQDN as input.
5464 * main.c: Implemented two methods: standard (the default) and
5465 strict (the one that was implemented initially).
5466
5467 2005-06-04 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5468
5469 * main.c: Rewritten action system. Documented the code.
5470
5471 2005-06-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5472
5473 * main.c (parse_opt): Ordered switch cases.
5474 (main): Switch to user's privileges only if started as root.
5475
5476 2005-06-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5477
5478 * Initial release.
5479
5480
5481 Local Variables:
5482 mode: change-log
5483 version-control: never
5484 End:
5485

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

Send suggestions and bug reports to Sergey Poznyakoff
ViewVC Help
Powered by ViewVC 1.1.20