summaryrefslogtreecommitdiffabout
path: root/src/main.c
AgeCommit message (Collapse)AuthorFiles
2019-09-07Minor fixesHEADmasterSergey Poznyakoff1
* src/main.c (mf_cfg_param): Remove the surplus "database" section: it is already included in srvcfg.c * src/prog.c (env_register_auto): Use mu_diag_cont_printf to continue diagnostic message without inserting unnecessary <> directives (perhaps should be fixed in mailutils).
2019-01-03Update copyright yearsSergey Poznyakoff1
2018-11-08mtasim: don't clobber existing callout socket when used with -XautoSergey Poznyakoff1
* doc/mailfromd.texi: Document the --callout-socket option. * mtasim/mtasim.c (start_mailfromd): Supply the --callout-socket option. * src/main.c: New option --callout-socket
2018-11-07Fix the functionality of the mailfromd --mtasim optionSergey Poznyakoff1
This option must discard the effect of the server.listen statement This also fixes mtasim -Xauto * src/main.c (mailfromd_options): Process the --mtasim option immediately.
2018-07-24Update copyright yearsSergey Poznyakoff1
2017-10-23Improve DNS API; rewrite DNS testsuite.Sergey Poznyakoff1
* lib/dns.c (dnsbase_real_init): Take configuration text as argument (can be NULL). Enable adns debugging on trace9 (dnsbase_file_init): New function. (dns_reply_init): New function. (dns_reply_push): New function. (soa_check): New function. Rewrite all functions using dns_reply_init+dns_reply_push, as appropriate. * lib/dns.h (dns_reply) <maxcount, data.ptr>: New members. (dnsbase_real_init, dnsbase_file_init) (dns_reply_init, soa_check): New protos. * src/builtin/dns.bi (resolve_host): Rewrite to return all A records. (dns_replies_intersect): New static function. (primitive_ismx): Rewrite taking into account all A records. * src/main.c: New option --resolv-conf-file (mostly for checking. * tests/resolv.c: Change option handling, implement new options. * tests/atlocal.in (MF_TOPDOMAIN,MF_NAMESERVER): New variables. (at_resolv_conf): New function. * tests/Makefile.am: Add new tests. * tests/testsuite.at: Include new tests. * tests/hasmx.at: Use dedicated MF test domains, * tests/hostname.at: Likewise. * tests/ismx.at: Likewise. * tests/rescname.at: Likewise. * tests/resolve.at: Likewise. * tests/resolv_a.at: New test. * tests/resolv_mx.at: Likewise. * tests/resolv_ptr.at: Likewise. * tests/resolv_ptr_val.at: Likewise. * tests/resolv_spf.at: Likewise. * tests/resolv_txt.at: Likewise.
2017-10-19Improve DNS resolver APISergey Poznyakoff1
Remove arbitrary size limits. * NEWS: Version 8.2.90 * configure.ac: Likewise. Require Mailutils 3.3 * doc/calloutd.texi: Update. * doc/functions.texi: Update. * doc/mailfromd.texi: Update. * doc/upgrade.texi: Update. * lib/dns.c: Rewrite. * lib/dns.h (MAXMXCOUNT, MXF_MAX): Remove. (mxbuf_init,dns_resolve_ipstr) (a_lookup,ptr_lookup,txt_lookup) (spf_lookup): Change protos. (dns_reply): New struct. (dns_reply_free,dns_reply_ip): New functions. * lib/libmf.h (getmxip): Change proto. * src/builtin/dns.bi: Remove runtime configuration statements: max-dns-reply-a, max-dns-reply-ptr, and max-dns-reply-mx. Rewrite using the new DNS API. * src/callout.c: Update. * src/mailfromd.h: Update. * src/main.c: Remove the max-match-mx configuration statement. * src/prog.c: Update. * src/spf.c: Update. * src/spf.h: Update. * src/srvcfg.c: Remove the max-callout-mx configuration statement.
2017-06-18Switch to detailed source locations from Mailutils 3.2.92Sergey Poznyakoff1
* configure.ac: Version 8.1.92 * NEWS: Update. * src/builtin/debug.bi (debug): Use mu_locus_range * src/builtin/from.bi: Likewise. * src/builtin/header.bi: Likewise. * src/builtin/progress.bi: Likewise. * src/builtin/qrnt.bi: Likewise. * src/builtin/rcpt.bi: Likewise. * src/exclist.c: Likewise. * src/builtin/sieve.bi: Use mu_locus_range (sieve): Accept new optional argument "col". * src/drivers.c: Use mu_locus_range (MARK_LOCUS): Rewrite as inline function. * src/gram.y: Use mu_locus_range and location macros from mailutils/yyloc.h Improve error diagnostics (parse_program): Prepare mu_strerr for locus-aware diagnostics. * src/lex.l: Use mu_linetrack_t to track locations. * src/mailfromd.h: Use mu_locus_range * src/main.c: Likewise. * src/pp.c: Likewise. * src/prog.c: Likewise. * src/prog.h: Likewise. * src/symbols.c: Likewise. * tests/ashadow.at: Expect detailed error locations. * tests/bctx00.at: Likewise. * tests/fctx00.at: Likewise. * tests/invcidr.at: Likewise. * tests/invcidr2.at: Likewise. * tests/module04.at: Likewise. * tests/module06.at: Likewise. * tests/poll04.at: Likewise. * tests/setvar.at: Likewise. * tests/shadow.at: Likewise. * tests/static02.at: Likewise.
2017-01-02Happy GNU YearSergey Poznyakoff1
2016-12-08Fix typoSergey Poznyakoff1
2016-12-08Ensure proper type conversion when coding immediate values.Sergey Poznyakoff1
* src/prog.h (mf_c_cast): New define. (code_put, code_immediate): New macros. * src/prog.c (code_immediate): Rename to code_immediat_stkval. (code_put): Rename to code_put_stkval. * src/drivers.c: Use typed calls to code_immediate and code_put * src/gram.y: Likewise. * src/main.c: Allocate mu_log_tag.
2016-11-08Use single configuration file.Sergey Poznyakoff1
* lib/libmf.h (MF_GETOPT_DEFAULT) (MF_GETOPT_IN_ORDER,MF_GETOPT_NO_CONFIG): New flags. (mf_getopt): Change signature. * lib/mfgetopt.c (mf_getopt): Remove the cfile parameter. Change semantics of the 5th parameter (inorder -> flags). * mtasim/mtasim.c: Change call to mf_getopt. * pmult/pmult.c: Likewise. * src/calloutd.c: Likewise. * src/main.c: Likewise. * src/mfdbtool.c: Likewise.
2016-11-02Follow Mailutils commit dc62b399Sergey Poznyakoff1
2016-10-29Minor fixesSergey Poznyakoff1
2016-10-28Finish conversion. Version 7.99.96Sergey Poznyakoff1
2016-10-24Convert mailfromd to new interface.Sergey Poznyakoff1
2016-10-24Start transition to mu_cli interfaceSergey Poznyakoff1
* configure.ac: Require mailutils 2.99.991 * src/main.c: Start transition to mu_cli * lib/optcache.c: Remove file. * lib/Makefile.am (optcache.c): Remove. * lib/libmf.h: Remove optcache prototypes. * lib/dbcfg.c: Convert to mu_option. * lib/utils.c: Likewise. * src/builtin/dns.bi: Likewise. * src/builtin/io.bi: Likewise. * src/builtin/mbox.bi: Likewise. * src/builtin/msg.bi: Likewise. * src/mfdbtool.c: Likewise. * src/savsrv.c: Likewise. * src/srvcfg.c: Likewise. * src/srvcfg.h: Likewise.
2016-10-24Minor fixesSergey Poznyakoff1
* lib/dns.c (mf_to_dns_status): New function. * lib/libmf.h (mf_to_dns_status): New proto. * lib/cache.c: Fix conversions. * lib/rate.c: Fix conversions. * lib/vercmp.c: Fix conversions. * src/builtin/dns.bi: Fix conversions. * src/builtin/string.bi: Fix conversions. * src/drivers.c: Fix conversions. * src/exclist.c: Fix conversions. * src/main.c: Fix conversions. * src/prog.c: Fix conversions. * tests/trycatch05.at: Print first field of wc output. * tests/trycatch06.at: Likewise. * tests/trycatch07.at: Likewise. * tests/trycatch08.at: Likewise. * tests/trycatch09.at: Likewise. * tests/trycatch10.at: Likewise. * tests/trycatch11.at: Likewise. * tests/trycatch12.at: Likewise. * tests/trycatch13.at: Likewise. * tests/trycatch14.at: Likewise. * tests/trycatch15.at: Likewise. * tests/trycatch16.at: Likewise. * tests/version.at: Compatibility fix in sed expression.
2016-08-09Minor changes (mostly po-related)Sergey Poznyakoff1
2016-02-17Update copyright yearsSergey Poznyakoff1
2015-04-27Update copyright yearsSergey Poznyakoff1
2015-04-27Avoid casts between pointers and integers (optcache)Sergey Poznyakoff1
* lib/libmf.h (mf_option_value): Union. (mf_option_cache): Rearrange members. (handler,set): Change signature. (isset): New member. (mf_optcache_set_option): Change signature. (mf_option_string,mf_option_boolean): Likewise. (mf_option_time_t,mf_option_size_t): Remove. (mf_option_timeout,mf_option_size): New prototypes. * lib/optcache.c (optcache_dup): Clear isset member for each element. (mf_optcache_set_option): Rewrite. (mf_option_string, mf_option_boolean): Rewrite. (mf_option_time_t,mf_option_size_t): Remove. (mf_option_timeout,mf_option_size): New functions. * lib/utils.c: Change the use of mf_optcache functions. * src/main.c: Likewise. * src/mfdbtool.c: Likewise. * src/srvcfg.c: Likewise.
2013-08-08Get rid of gnulib.Sergey Poznyakoff1
* .gitmodules: Remove gnulib. * gnulib: Remove. * gnulib.modules: Remove. * Makefile.am: Remove gnulib. Use git2chg.awk to create ChangeLog. * bootstrap: Rewrite. * bootstrap.conf: Remove. * configure.ac: Update. * gacopyz/Makefile.am (AM_CPPFLAGS): Update. * git2chg.awk: New file. * lib/Makefile.am: Remove dependencies on gnulib. * mtasim/Makefile.am: Likewise. * pmult/Makefile.am: Likewise. * src/Makefile.am: Likewise. * src/builtin/Makefile.am: Likewise. * lib/gettext.h: New file. * lib/.gitignore: New file. * lib/obstack.c: New file. * lib/obstack.h_: New file. * lib/ftimestr.c (format_time_str): Rewrite using strftime and statically allocated buffer. * lib/libmf.h (transform_error_string): Change return type (const char *). * lib/proctitle.c: Rewrite using statically allocated buffer. * lib/transform.c: Use mu_ allocation and ctype functions. (transform_error_string): Use statically allocated buffer. Return a pointer to its content. * mtasim/mtasim.c Use mu_ allocation and ctype functions. (save_cwd, restore_cwd): New functions * lib/db.c: Use mu_ allocation and ctype functions. * lib/dbcfg.c: Likewise. * lib/dict.c: Likewise. * lib/dns.c: Likewise. * lib/namefixup.c: Likewise. * lib/optcache.c: Likewise. * lib/parsetime.c: Likewise. * lib/server.c: Likewise. * lib/srvman.c: Likewise. * lib/userprivs.c: Likewise. * lib/utils.c: Likewise. * pmult/pmult.c: Likewise. * src/bitmask.h: Likewise. * src/builtin/burst.bi: Likewise. * src/builtin/ctype.bi: Likewise. * src/builtin/db.bi: Likewise. * src/builtin/dns.bi: Likewise. * src/builtin/dspam.bi: Likewise. * src/builtin/getopt.bi: Likewise. * src/builtin/getpw.bi: Likewise. * src/builtin/mbox.bi: Likewise. * src/builtin/msg.bi: Likewise. * src/builtin/sprintf.bi: Likewise. * src/callout.h: Likewise. * src/calloutd.c: Likewise. * src/deprecation.c: Likewise. * src/engine.c: Likewise. * src/exclist.c: Likewise. * src/gram.y: Likewise. * src/lex.l: Likewise. * src/mailfromd.h: Likewise. * src/main.c: Likewise. * src/mfdbtool.c: Likewise. * src/pp.c: Likewise. * src/pragma.c: Likewise. * src/prog.c: Likewise. * src/srvcfg.c: Likewise. * src/stack.c: Likewise. * src/symbols.c: Likewise. * src/callout.c: Likewise. * po/.gitignore: Update. * po/Makevars: New file. * src/builtin/io.bi: Use mu_ allocation and ctype functions. (stderr_to_log): Use fgets instead of getline. * src/builtin/system.bi (strftime): Use statically allocated buffer and strftime. * src/savsrv.c: Use mu_ allocation and ctype functions. (trimcrlf): Return 0 if theCR(LF) has been removed and 1 otherwise. (callout_session_server): Use statically allocated buffer. Reject input lines that are longer than allowed by its capacity. * src/spf.c: Use mu_ allocation and ctype functions. (scanback): New function. (spf_reverse,spf_truncate): Use scanback instead of memrchr.
2013-07-28Provide built-ins for effective handling of large message bodies.Sergey Poznyakoff1
* src/mailfromd.h (body_repl_fd): New opcode. * src/engine.c (run_msgmod): Handle body_repl_fd. * src/gram.y (msgmod_opcode_str): Handle body_repl_fd. * gacopyz/gacopyz.c (gacopyz_replace_body_fn) (gacopyz_replace_body_fd): New functions. (gacopyz_replace_body): Rewrite using gacopyz_replace_body_fn. * gacopyz/gacopyz.h (gacopyz_replace_body_fn) (gacopyz_replace_body_fd): New protos. * src/builtin/body.bi (replbody_fd): New built-in function. * src/builtin/io.bi (open_program_stream_ioe): New static. (open_program_stream): Rewrite via open_program_stream_ioe. (spawn, write_body): New built-in functions. * src/builtin/system.bi (unlink): New built-in function. * NEWS: Update. * doc/functions.texi: Document the new functions.
2012-08-04Fix trace output.Sergey Poznyakoff1
The c-escape filter used by the trace output stream suppresses newlines in output. This is harmless when the output goes to syslog, but when it goes to stderr, all trace lines get concatenated into a single one on output. To fix this, newline has to be sent directly to the underlying stream, bypassing the filter. * src/main.c (trace): Send newline bypassing the c-escape filter (which would have converted it to the "\n" sequence). This requires MU commit 1cbbd572.
2012-02-26Restore legacy lock-* configuration statements.Sergey Poznyakoff1
* lib/libmf.h (config_cb_lock_retry_count) (config_cb_lock_retry_timeout) (mf_option_size_t,mf_init_lock_options): New prototypes. * lib/optcache.c (mf_option_size_t): New function. * lib/utils.c (config_cb_lock_retry_count) (config_cb_lock_retry_timeout) (mf_init_lock_options): New functions. * src/main.c (mf_cfg_param): Restore lock-retry-count and lock-retry-timeout for backward compatibility. (main): Call mf_init_lock_options. * src/mfdbtool.c (mfdbtool_cfg_param): Restore lock-retry-count and lock-retry-timeout for backward compatibility. (main): Call mf_init_lock_options. * src/calloutd.c: Likewise. * lib/close-fds.c (close_fds_except): Don't access FD_SET unless i is less than FD_SETSIZE.
2011-11-21More fixes. Use mu_list_foreach instead of mu_list_do.Sergey Poznyakoff1
* Makefile.am (SUBDIRS): Use mflib after src, so that make check uses the freshly built version of mailfromd. * lib/userprivs.c: Use mu_list_foreach instead of mu_list_do * mtasim/mtasim.c: Likewise. * pmult/pmult.c: Likewise. * src/builtin/mbox.bi: Likewise. * src/builtin/msg.bi: Likewise. * src/engine.c: Likewise. * src/gram.y: Likewise. * src/main.c: Likewise. * src/pp.c: Likewise.
2011-11-09Switch to libmu_dbm for DBM support.Sergey Poznyakoff1
* configure.ac (DEFAULT_DB_TYPE): New variable. Use mu info to determine which DBM is supported. * lib/Makefile.am (noinst_LIBRARIES): Remove libdbm.a * lib/mf-dbm.c: remove. * lib/mf-dbm.h: remove. * lib/cache.c: Use libmu_dbm functions. * lib/db.c: Likewise. * lib/dbcfg.c: Likewise. * lib/greylist.c: Likewise. * lib/rate.c: Likewise. * lib/tbf_rate.c: Likewise. * src/builtin/db.bi: Likewise. * src/savsrv.c: Likewise. * src/srvcfg.c (srv_cfg_param) <database-type>: New statement. * lib/libmf.h (config_cb_ignore): New proto. * lib/mfdb.h (db_item_printer_t): Change signature. * lib/utils.c (config_cb_ignore): New function. * po/POTFILES.in: Update. * src/Makefile.am (mailfromd_LDADD) (calloutd_LDADD): Remove libdbm.a. * src/calloutd.c: Update. * src/main.c (mf_cfg_param): lock-retry-count and lock-retry-timeout are no-op now. * src/mfdbtool.c: Likewise.
2011-08-24Improve third-party interfaces to process arbitrary messages (not only ↵Sergey Poznyakoff1
current one). * NEWS: Updated. * doc/functions.texi: Reflect changes in sieve, clamav and sa (spamc) functions. * mflib/Makefile.am: Build sa.h * mflib/sa.mf (SA_SYMBOLS, SA_REPORT) (SA_LEARN_SPAM,SA_LEARN_HAM,SA_FORGET): New constants. (sa): Wrapper over spamc for backward compatibility. * src/builtin/Makefile.am (builtin.h): Depends on builtin.def * src/builtin/body.bi (current_message): Use MF_STREAM_TO_MESSAGE. * src/builtin/builtin.c: Add more includes. (_builtin_stream_cleanup): New function. (_builtin_mu_stream_to_message): New function. * src/builtin/builtin.def (_builtin_stream_cleanup) (_builtin_mu_stream_to_message): New protos. * src/builtin/dspam.bi: Use _builtin_stream_cleanup for stream cleanups. * src/builtin/msg.bi (message_from_stream): Use MF_STREAM_TO_MESSAGE. * src/builtin/sa.bi (open_connection): Register returned stream for cleanup. (sa): Rewrite as spamc function. (clamav): Take message descriptor as the first argument. * src/builtin/sieve.bi (sieve): Take message descriptor as the first argument. Use cleanups. * src/builtin/snarf.m4 (MF_STREAM_TO_MESSAGE): New macro. * src/main.c (options): Remove "debug" option, handled by srvcfg.c * tests/bctx00.at: Use current_message function. * tests/bctx01.at: Likewise. * tests/fctx00.at: Likewise. * tests/fctx01.at: Likewise.
2011-08-20Implement dspam support.Sergey Poznyakoff1
* configure.ac: Check for dspam * mflib/.gitignore: Add dspam.h * mflib/Makefile.am: Build dspam.h Install dspam.mf * mflib/dspam.mf: New file. * src/Makefile.am (mailfromd_LDADD): Add DSPAM_LIBS (INCLUDES): Add DSPAM_CFLAGS * src/builtin/Makefile.am (BI_FILES): Add dspam.bi. (INCLUDES): Add DSPAM_CFLAGS * src/builtin/dspam.bi: New file. * src/main.c (mailfromd_show_defaults): Reflect dspam support.
2011-07-04Improve reporting of startup errors. HUP restarts the program only if syntax ↵Sergey Poznyakoff1
check succeeds. * lib/libmf.h (mf_server_lint_option): New extern. * lib/server.c (mf_server_lint_option): New global variable. (sig_restart): Don't call mfd_srvman_stop. (run_lint,server_idle_hook): New functions. (mf_server_start): Install idle hook. HUP restarts the program only if syntax check succeeds. Close fds above 2 if using stderr for error output, and from 1 if using syslog. * src/calloutd.c (main): Call mu_stdstream_setup. Set mf_server_lint_option. * src/main.c (main): Check whether stderr is open as early as possible. Update call to mu_stdstream_setup (needs MU 5e1d982ec). Set mf_server_lint_option. * src/srvcfg.c (srv_parse_opt): Make sure --syslog takes effect at once.
2011-07-04BugfixSergey Poznyakoff1
* lib/syslog_async.c (find_percent_m): Fix endless loop.
2011-03-22Use C-escape filter (MU b5c66e41) to format trace output.Sergey Poznyakoff1
* src/main.c (mf_trace_stream): New static var. (open_trace_stream): New static function. (trace): Print to mf_trace_stream.
2011-03-19Restore lock-retry-count and lock-retry-timeout configuration statementsSergey Poznyakoff1
* lib/mf-dbm.h (lock_retry_timeout_option): New extern. * lib/libmf.h (mf_option_time_t, config_cb_time_t): New protos. * lib/optcache.c (mf_option_time_t): New function. * lib/utils.c (config_cb_time_t): New function. * src/main.c (mf_cfg_param): Restore lock-retry-count and lock-retry-timeout statements. (cb_timeout): Remove. Use config_cb_timeout instead * mfdbtool.c (options, parse_opt): Enable --lock-retry-count and --lock-retry-timeout options, (option_cache): Define lock-retry-count and lock-retry-timeout caches. * TODO: Update
2011-03-18Rethink the solution to mtasim interaction problem (see c0535e8e).Sergey Poznyakoff1
* src/main.c (parse_opt) <OPTION_MTASIM>: Rollback c0535e8e. (mtasim_option): Move to srvcfg.c. * src/srvcfg.c (server_section_parser) <mu_cfg_section_end>: If mtasim_option is set, ignore the server statements.
2011-03-17Improve interaction with mtasim.Sergey Poznyakoff1
Jan Rafaj reported that the use of mtasim -Xauto may result in the subordinate mailfromd removing the UNIX communication sockets of the main running process. This can happen if: (1) there is a mailfromd process running on the box where mtasim is run and (2) the user does not supply --no-site-config option to the subordinate. * src/main.c (parse_opt) <OPTION_MTASIM>: Inhibit loading of the default configuration files.
2011-03-13Rename .pm:server config section to .mfd:server. Fix check-docs.Sergey Poznyakoff1
2011-03-13Improve docsSergey Poznyakoff1
* NEWS: Update. * doc/functions.texi: Document new built-in and most library functions. * doc/upgrade.texi: Update. * src/builtin/debug.bi (debug_level): Fix the use of modname. (debug_spec): Remove the minlevel parameter. * src/builtin/io.bi: Remove misleading comment. * src/main.c: Restore the --debug option.
2011-03-09More bugfixesSergey Poznyakoff1
* src/main.c (main): Call mf_server_log_setup only for mode==MAILFROMD_DAEMON. (parse_opt): Allocate strings appended to args->trace_modules. * src/prog.c (instr_xmemstk): Adjust stack before pushing to it. (dump_catch): Print exception names.
2011-03-09Cleanup.Sergey Poznyakoff1
* po/POTFILES.in: Remove appinit.c (See e473ab7d). * src/Makefile.am: Restore incdir, needed for AM_CPPFLAGS. Was accidentally removed in 01ad06fca. * src/builtin/sa.bi (sa): Restore initialization of msize. Accidentally removed in bcd64af9. * src/main.c: Call mf_server_log_setup after compiling the sources, so that --lint spits out its diagnostics on stderr (initially placed here in e75c9a39).
2011-03-09Fix deferred variable initialization.Sergey Poznyakoff1
The bug was spotted by Brian Kroth. * src/gram.y (deferred_decl) <locus>: New member. (defer_initialize_variable): Use string_alloc instead of literal_lookup. Take additional argument (ptr to locus). All uses updated. (apply_deferred_init): Pass a ptr to the actual locus to initialize_variable. * src/mailfromd.h (defer_initialize_variable): Change signature. * src/main.c (cb_set_variable): Deduce definition location from mu_strerr. * THANKS: Update. * tests/setvar.at: New testcase. * tests/Makefile.am (TESTSUITE_AT): Add setvar.at. * tests/testsuite.at: Include setvar.at. * tests/invcidr.at: Update experr. * tests/invcidr2.at: Likewise.
2011-03-07Sync with MU commit 4bcd5c9de0cb6ca85bcc3a35b1518739b939b009.Sergey Poznyakoff1
* lib/appinit.c: Remove. * lib/Makefile.am (libmf_a_SOURCES): Remove appinit.c * lib/libmf.h (mu_app_rcfile, mfd_app_init): Remove. * src/calloutd.c (main): Use mu_app_init. Set mu_site_rcfile beforehand. * src/main.c (main): Likewise. * src/mfdbtool.c (main): Likewise.
2011-03-05BugfixSergey Poznyakoff1
* src/main.c (cb_set_variable): Fix argument cast.
2011-03-01Store exception names in the dataseg.Sergey Poznyakoff1
* src/mf-status.c: Remove. * src/exclist.c: New file. * src/Makefile.am (mailfromd_SOURCES): Remove mf-status.c, add exclist.c. * src/gram.y (exdecl): Call define_exception. (dataseg_layout): Create table of exception names in dataseg. * src/mailfromd.h (define_constant): Change return value. (string_to_exception): Remove. (define_exception,enumerate_exceptions) (free_exceptions): New protos. * src/main.c (main): Call free_exceptions. * src/prog.c (exception_count): Move declaration to exclist.c (instr_throw): Add trace print. (dump_throw): Print exception number along with its symbolic value. (env_throw_0): Reword default message. * src/prog.h (EXTABIND): New macro. * src/symbols.c (define_constant): Return pointer to the allocated struct constant. * tests/eof.at: Reflect changes to env_throw_0. * tests/hdr-gete.at: Likewise. * mflib/mfex.awk: Simplify.
2011-01-08Update copyright year.Sergey Poznyakoff1
2010-12-22Reflect recent changes in MU (mu_debug_handle_t/mu_debug_level_t types).Sergey Poznyakoff1
2010-12-21Switch to MU3 API.Sergey Poznyakoff1
* lib/debug.c: Remove. * lib/debug.h: Remove. * lib/Makefile.am (noinst_HEADERS): Remove debug.h (libmf_a_SOURCES): Remove debug.c * lib/appinit.c: Use new mu_stream_* calls. * lib/libmf.h (config_array_to_argv,config_array_to_string): Change signatures. (config_cb_timeout): Likewise. (logger)<log_print>: Remove. <log_open>: Change signature. (logger_open): Change signature. (vlogmsg,logmsg): Rewrite as macros. * lib/logger.c: Rewrite logging support using MU3 streams. * lib/utils.c (config_array_to_argv) (config_array_to_string, config_cb_timeout): Rewrite. * lib/server.c (mf_server_start): Call mu_onexit_run. * lib/version.c (version_etc_copyright): Rename to avoid name clash. * lib/dbcfg.c: Rewrite callbacks. Use MU3 configuration framework. * lib/cache.c: Use mu_debug for debugging. * lib/db.c: Likewise. * lib/dns.c: Likewise. * lib/greylist.c: Likewise. * lib/mf-dbm.c: Likewise. * lib/rate.c: Likewise. * lib/srvman.c: Likewise. * lib/tbf_rate.c: Likewise. * src/builtin/snarf.m4: Likewise. * src/calloutd.c: Likewise. * src/engine.c: Likewise. * src/spf.c: Likewise. * src/Makefile.am (mfd-dbgmod.h): Offset the indices by the value of mfd_debug_handle. * src/builtin/body.bi (current_message): Use mu_stream_to_message. * src/builtin/curhdr.bi: Use MU3 API. * src/builtin/db.bi: Likewise. * src/builtin/io.bi: Likewise. * src/builtin/mail.bi: Likewise. * src/builtin/msg.bi: Likewise. * src/builtin/mudebug.bi: Likewise. * src/builtin/sieve.bi: Likewise. * src/lex.l: Likewise. * src/savsrv.c: Likewise. * src/srvcfg.c: Likewise. * src/builtin/other.bi (debug_level): Rewrite using mu_debug_category_level (debug_spec): Rewrite using mu_debug_format_spec. (debug): Rewrite using mu_debug_parse_spec. * src/callout.c (smtp_io_data) <send_off, recv_off>: Remove. All uses updated. (smtp_io_free, smtp_send, smtp_recvline) (smtp_io_close, callout_host, callout_mx) (libcallout_init): Use new stream and debugging API. * src/mailfromd.h (mfd_debug_handle): New extern. (add_legacy_milter_port): Change signature. * src/main.c (mf_strecho): New global. (mfd_gacopyz_log_printer): Remove. (read_domain_file): Change signature. (cb_milter_timeout, cb_timeout, cb_set_variable) (cb_include_path, cb_trace_program, cb_relayed_domain_file): Rewrite. (mfd_debug_handle): New variable. (open_strecho): New function. (main): Revise logging support initialization. * src/mfdbtool.c: Use new MU API. * src/pp.c: Likewise. * src/pragma.c: Likewise. * src/prog.c: Use new MU API. (instr_echo): Send output to mf_strecho. * src/prog.h (mf_strecho): New extern. * src/builtin/msg.h (mf_message) <mstr, bstr>: New members. * src/builtin/sa.bi: Rewrite using new stream functions. * pmult/.gitignore: Remove pdbg.h. * pmult/pdbg.hm4: Remove. * pmult/debugdef.m4: Remove. * pmult/Makefile.am (EXTRA_DIST): Remove pdbg.hm4 and debugdef.m4 (pmult_SOURCES): Remove pdbg.h * pmult/pmult.c: Redo logging, debugging and configuration support. * tests/hdr-gete.at: Update. * tests/testsuite.at (AT_MTA_TEST): Filter out info prefix from the 'echo' output.
2010-10-05Bugfixes.Sergey Poznyakoff1
* lib/dns.c (_dnsbase_init): Rename to dnsbase_init, now extern. (all functions): Remove calls to _dnsbase_init. * lib/libmf.h (dnsbase_init): New proto. * src/calloutd.c (main): Call dnsbase_init. * src/savsrv.c (cmd_run): Bugfix. (callout_session_server): Bugfix. * src/main.c (main): Call dnsbase_init.
2010-08-23Bugfixes.Sergey Poznyakoff1
* lib/filenames.h (DEFAULT_PIDFILE): Remove. * lib/logger.c (loggertab): Add syslog_async_fdset method for syslog:async. * src/Makefile.am (mfd-dbgmod.h): Kik off libcallout_a_SOURCES. * src/calloutd.c (_log_setup, mf_server_log_setup): Remove. (main): Call mf_srvcfg_log_setup. Update call to mf_srvcfg_init. * src/engine.c (setprocid): New static function. (mfd_callout_session_server): New function. * src/lex.l (lex_new_source_0): Bugfux. * src/mailfromd.h (mfd_callout_session_server): New proto. * src/main.c (mf_diag_syslog_printer, _log_setup) (mf_server_log_setup): Remove. (main): Call mf_srvcfg_log_setup. Update call to mf_srvcfg_init. * src/savsrv.c: Include signal.h (vrfy_state): New enum. (vrfy_queue)<state>: New member. (verify): Use rc and qp->state to decide whether to process the entry. This still needs some more work, though. (addq): Initialize qp->state. (cmd_run): Update qp->state. (callout_session_server): Ignore SIGPIPE and SIGALRM. * src/srvcfg.c (srv_options): Remove 's' option. (srv_parse_opt): Logger options update optcache. (setdefpidfilename): New static function. (mf_srvcfg_init): Take program invocation name as the first argument. Construct pidfile name based on it, unless pidfile has already been initialized. Done update srvman_param.keepfds (see mf_srvcfg_log_setup). Initialize syslog_tag. (mf_diag_syslog_printer, mf_debug_syslog_printer): New functions. (mf_srvcfg_log_setup): New function. * src/srvcfg.h (mf_srvcfg_init): Change signature.
2010-08-22Fix starting of the default callout server. Reflect the actual server URL in ↵Sergey Poznyakoff1
callout_server_url. * mflib/callout.mf4 (callout_server_url): New variable. (begin): Provide a default for callout_server_url. (__callout_open_default): Return the fd. (callout): Use return from __callout_open_default as the first argument to callout_do. * mflib/poll.mf (__make_extra_arg): New static function. (_pollhost, _pollmx, stdpoll, strictpoll): Use return from __callout_open_default as the first argument to callout_do. Construct the rest of arguments using __make_extra_arg. * src/builtin/callout.bi (callout_server_url): Remove. (default_callout_server_url): New function. (MF_INIT): Remove initialization of callout_server_url. * src/mailfromd.h (default_callout_url): Rename to callout_server_url. * src/main.c (default_callout_url): Rename to callout_server_url. (provide_default_callout_server): Rewrite the condition. Don't try to reset the callout_server_url MFL variable: it is useless after compilation is finished. (mf_server_function): Fix the use of mu_list_locate. (main): Fix a typo in the server section label. * src/srvcfg.c (server_section_parser): Move the call to mf_server_function to the mu_cfg_section_end branch.

Return to:

Send suggestions and report system problems to the System administrator.