summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2018-11-09 12:38:44 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-11-09 12:40:49 (GMT)
commit67eb1f4c05ec5fafec7ec7745575a8213734f134 (patch) (side-by-side diff)
tree68a490c2d2dae0f9d079fc81a10c203fc01cc5ef
parent08204cb140768a2963a90c6a20ddb9c6da95695f (diff)
downloadmailfromd-67eb1f4c05ec5fafec7ec7745575a8213734f134.tar.gz
mailfromd-67eb1f4c05ec5fafec7ec7745575a8213734f134.tar.bz2
Document debug categories. Fix improper use of decimal constants instead of MU_DEBUG_TRACE identifiers
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--doc/mailfromd.texi55
-rw-r--r--src/builtin/io.bi16
-rw-r--r--src/builtin/mbox.bi2
-rw-r--r--src/builtin/other.bi2
-rw-r--r--src/builtin/sa.bi2
5 files changed, 61 insertions, 16 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi
index 74dedfd..2e07569 100644
--- a/doc/mailfromd.texi
+++ b/doc/mailfromd.texi
@@ -3393,7 +3393,7 @@ do
Depending on its operation mode, @command{mailfromd} tries to guess
whether it is appropriate to print its diagnostics and informational
messages on standard error or to send them to syslog. Standard error
-is assumed if the program is run with any of the following command
+is assumed if the program is run with one of the following command
line options:
@itemize @bullet
@@ -3605,12 +3605,10 @@ List records being removed.
@item dns
@table @asis
-@item trace0
-Verbose information about failed DNS queries.
-@item trace2
-Verbosely list retrieved MXs
@item trace8
Verbose information about attempted DNS queries and their results.
+@item trace9
+Enables @samp{libadns} internal debugging.
@end table
@item srvman
@@ -3704,6 +3702,53 @@ Explicitly list A records obtained when processing the @samp{a} SPF mechanism.
@end table
@end table
+Categories starting with @samp{bi_} debug built-in modules:
+
+@table @asis
+@item bi_db
+Database functions.
+@table @asis
+@item trace5
+List database look-ups.
+@item trace6
+Trace operations on the greylisting database.
+@end table
+
+@item bi_sa
+SpamAssassin and ClamAV API.
+@table @asis
+@item trace1
+Report the findings of the @samp{clamav} function.
+@item trace9
+Trace payload in interactions with @samp{spamd}.
+@end table
+
+@item bi_io
+I/O functions.
+@table @asis
+@item trace1
+Debug the following functions: @code{open}, @code{spawn}, @code{write}.
+@item trace2
+Report stderr redirection.
+@item trace3
+Report external commands being run.
+@end table
+
+@item bi_mbox
+Mailbox functions.
+@table @asis
+@item trace1
+Report opened mailboxes.
+@end table
+
+@item bi_other
+Other built-ins.
+@table @asis
+@item trace1
+Report results of checks for existence of usernames.
+@end table
+@end table
+
For example, the following invocation enables levels up to
@samp{trace2} in category @samp{engine}, all levels in category
@samp{savsrv} and levels up to @samp{trace0} in category
diff --git a/src/builtin/io.bi b/src/builtin/io.bi
index d1512ad..3e84bb5 100644
--- a/src/builtin/io.bi
+++ b/src/builtin/io.bi
@@ -177,7 +177,7 @@ stderr_to_log(char *arg, const char *cmd)
mu_syslog_priority_to_string(pri));
}
}
- MF_DEBUG(10,
+ MF_DEBUG(MU_DEBUG_TRACE2,
("redirecting stderr to syslog %s.%s",
mu_syslog_facility_to_string(fac),
mu_syslog_priority_to_string(pri)));
@@ -231,7 +231,7 @@ stderr_handler(int mode, char *arg, const char *cmd)
close(2);
break;
}
- MF_DEBUG(10, ("redirecting stderr to %s", arg));
+ MF_DEBUG(MU_DEBUG_TRACE2, ("redirecting stderr to %s", arg));
fd = open(arg, O_CREAT|O_WRONLY|append, 0644);
if (fd < 0) {
mu_error(_("cannot open file %s for appending: %s"),
@@ -361,7 +361,7 @@ open_program_stream_ioe(eval_environ_t env,
/* Close unneded descripitors */
close_fds_above(2);
- MF_DEBUG(10, ("running %s", cmdline));
+ MF_DEBUG(MU_DEBUG_TRACE3, ("running %s", cmdline));
if (mu_wordsplit(cmdline, &ws,
MU_WRDSF_DEFFLAGS & ~MU_WRDSF_CESCAPES)) {
mu_error(_("cannot parse command line %s: %s"),
@@ -716,7 +716,7 @@ MF_DEFUN(open, NUMBER, STRING name)
mfe_failure,
_("no more files available"));
- MF_DEBUG(10, ("opening stream %s", name));
+ MF_DEBUG(MU_DEBUG_TRACE1, ("opening stream %s", name));
iotab[i].name = mu_strdup(name);
iotab[i].delim = NULL;
if (*name == '>') {
@@ -754,7 +754,7 @@ MF_DEFUN(open, NUMBER, STRING name)
mfe_failure,
_("cannot open stream %s: %s"), name,
mu_strerror(rc));
- MF_DEBUG(10, ("open(%s) = %d", name, i));
+ MF_DEBUG(MU_DEBUG_TRACE1, ("open(%s) = %d", name, i));
MF_RETURN(i);
}
END
@@ -775,7 +775,7 @@ MF_DEFUN(spawn, NUMBER, STRING name, OPTIONAL,
mfe_failure,
_("no more files available"));
- MF_DEBUG(10, ("spawning %s", name));
+ MF_DEBUG(MU_DEBUG_TRACE1, ("spawning %s", name));
iotab[i].name = mu_strdup(name);
iotab[i].delim = NULL;
@@ -812,7 +812,7 @@ MF_DEFUN(spawn, NUMBER, STRING name, OPTIONAL,
mfe_failure,
_("cannot open stream %s: %s"), name,
mu_strerror(rc));
- MF_DEBUG(10, ("spawn(%s) = %d", name, i));
+ MF_DEBUG(MU_DEBUG_TRACE1, ("spawn(%s) = %d", name, i));
MF_RETURN(i);
}
@@ -922,7 +922,7 @@ MF_DEFUN(write, VOID, NUMBER fd, STRING str, OPTIONAL, NUMBER n)
struct io_stream *iotab = MF_GET_DATA;
int rc;
- MF_DEBUG(10, ("writing %s to %lu", str, fd));
+ MF_DEBUG(MU_DEBUG_TRACE1, ("writing %s to %lu", str, fd));
MF_ASSERT(fd >= 0 && fd < nstreams && OFD(iotab[fd]) != -1,
mfe_range,
_("invalid file descriptor"));
diff --git a/src/builtin/mbox.bi b/src/builtin/mbox.bi
index df4f3ec..27f7462 100644
--- a/src/builtin/mbox.bi
+++ b/src/builtin/mbox.bi
@@ -89,7 +89,7 @@ MF_DEFUN(mailbox_open, NUMBER, STRING url, OPTIONAL, STRING mode, STRING perms)
MF_ASSERT(md >= 0,
mfe_failure,
_("no more mailboxes available"));
- MF_DEBUG(10, ("opening mailbox %s", url));
+ MF_DEBUG(MU_DEBUG_TRACE1, ("opening mailbox %s", url));
mp = mbtab + md;
flags = 0;
diff --git a/src/builtin/other.bi b/src/builtin/other.bi
index 5063885..bdb21b0 100644
--- a/src/builtin/other.bi
+++ b/src/builtin/other.bi
@@ -48,7 +48,7 @@ valid_user_p(eval_environ_t env, const char *name)
break;
}
- MF_DEBUG(10,
+ MF_DEBUG(MU_DEBUG_TRACE1,
("Checking user %s: %s", name, rc ? "true" : "false"));
return rc;
}
diff --git a/src/builtin/sa.bi b/src/builtin/sa.bi
index fd3fa0b..6225829 100644
--- a/src/builtin/sa.bi
+++ b/src/builtin/sa.bi
@@ -574,7 +574,7 @@ MF_DEFUN(clamav, NUMBER, NUMBER nmsg, STRING urlstr)
s++;
MF_VAR_SET_STRING(clamav_virus_name, s);
- MF_DEBUG(2,
+ MF_DEBUG(MU_DEBUG_TRACE1,
("%sclamav found %s",
mailfromd_msgid(env_get_context(env)), s));
rc = 1;

Return to:

Send suggestions and report system problems to the System administrator.