7.1.5 Logging and Debugging Options

Mention column number in error messages. See section location-column.

-d string
--debug=string

Set debugging level. Overrides ‘#pragma option debug’. See section Logging and Debugging.

--dump-code

Parse and compile the script file and dump the disassembled listing of the produced code to the terminal. See section Logging and Debugging.

--dump-grammar-trace

Enable debugging the script file parser. While parsing the file, the detailed dump of the parser states and tokens seen will be output.

--dump-lex-trace

Enable debugging the lexical analyzer. While parsing the script file, the detailed dump of the lexer states and matched rules will be output.

--dump-macros

Show Sendmail macros used in the script file. The macro names are displayed as comma-separated lists, grouped by handler names. See section Using mailfromd with Sendmail., for a detailed description of this option and its usage.

--dump-tree

Parse and compile the script file and dump the parse tree in a printable form to the terminal.

--dump-xref

Print a cross-reference of variables used in the filter script. See section Testing Filter Scripts.

-E

Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output. See section MFL Preprocessor.

--lint

Check script file syntax and exit. If the file is OK, return 0 to the shell, otherwise print appropriate messages to stderr and exit with code 78 (‘configuration error’).

--single-process

Do not fork sub-processes to serve requests. This option is meant to assist in debugging mailfromd. Don't use it for anything else but for debugging, as it terribly degrades performance!

--stack-trace

Add MFL stack trace information to runtime error output. Overrides stack-trace configuration statement, which you are advised to use instead (see section stack-trace). See tracing runtime errors, for more information on this feature.

--gacopyz-log=level

Set desired logging level for gacopyz library (see section Gacopyz). There are five logging levels. The following table lists them in order of decreasing priority:

fatal

Log fatal errors.

err

Log error messages.

warn

Log warning messages.

info

Log informational messages. In particular, this enables printing messages on each subprocess startup and termination, which look like that:

 
Apr 28 09:00:11 host mailfromd[9411]: connect
    from 192.168.10.1:50398
Apr 28 09:00:11 host mailfromd[9411]: finishing
    connection

This level can be useful for debugging your scripts.

debug

Log debugging information.

proto

Log Milter protocol interactions. This level prints huge amounts of information, in particular it displays dumps of each Milter packet sent and received.

Although it is possible to set these levels independently of each other, it is seldom practical. Therefore, the option ‘--gacopyz-log=level’ enables all logging levels from level up. For example, ‘--gacopyz-log=warn’ enables log levels ‘warn’, ‘err’ and ‘fatal’. It is the default. If you need to trace each subprocess startup and shutdown, set ‘--gacopyz-log=info’. Setting the logging level to ‘proto’ can be needed only for Gacopyz developers, to debug the protocol.

See section Testing Filter Scripts.

--log-facility=facility

Output logs to syslog facility.

--log-tag=string

Tag syslog entries with the given string, instead of the program name.

--no-syslog-async

Use system libc syslog implementation. See section Logging and Debugging, for more information about two syslog flavors. See section syslog-async, for the corresponding configuration statement. See Using non-blocking syslog, for information on how to set default syslog implementation at compile time.

To inspect the default syslog implementation, use the ‘--show-defaults’ command line option (see section show-defaults).

-s
--stderr

Log to stderr (by default logging goes to syslog). See section Logging and Debugging.

This option is turned on implicitly by any of the following options: ‘--compact’, ‘--delete’, ‘--expire’, ‘--test’, and ‘--list’.

--source-info

Include C source information in debugging messages. You do not need this option, unless you are developing and debugging mailfromd.

--syntax-check

Synonym for ‘--lint’.

--trace

Enable action tracing. With this option mailfromd will log all executed actions. See section Logging and Debugging.

--trace-program[=string]

Enable program instruction tracing. With this option mailfromd will log execution of every instruction in the compiled filter program. The optional arguments allows to specify a comma-separated list of source code modules for which the tracing is to be enabled, for example --trace-program=bi_io,bi_db enables tracing for functions from modules ‘bi_io.c’ and ‘bi_db.c’ (notice, that you need not give file suffixes in string).

This option is useful for debugging mailfromd, but is not advised to use otherwise, since it is very time-costly.

-X
--transcript

Enable transcript of the SMTP sessions to the log channel. See section Logging and Debugging.

--syslog

Output logs to syslog. This is the default, unless any of the following options is used: ‘--compact’, ‘--delete’, ‘--expire’, ‘--test’, and ‘--list’.

--syslog-async

Use asynchronous syslog implementation. See section Logging and Debugging, for more information about two syslog flavors. See section syslog-async, for the corresponding configuration statement. See Using non-blocking syslog, for information on how to set default syslog implementation at compile time.

To inspect the default syslog implementation, use the ‘--show-defaults’ command line option (see section show-defaults).

--xref

Same as ‘--dump-xref’. See section Logging and Debugging.