14 Commits

Author SHA1 Message Date
Alberto Bertogli
76a72367ae dkim: Implement internal dkim signing and verification
This patch implements internal DKIM signing and verification.
2024-03-12 20:43:21 +00:00
Alberto Bertogli
9c6661eca2 nettrace: Add a new tracing library
This commit introduces a new tracing library, that replaces
golang.org/x/net/trace, and supports (amongts other thing) nested
traces.

This is a minimal change, future patches will make use of the new
functionality.
2022-11-13 11:09:19 +00:00
Alberto Bertogli
f137702f23 trace: Remove restriction on tracing pages
By default, golang.org/x/net/trace currently only allows the tracing
pages to be seen from localhost.

This restriction can be confusing for people accessing the monitoring
server remotely, and adds no value in our environment.

The monitoring server already exports very sensitive information, and
must be enabled with care, and is not on by default. This is well
documented.

This patch removes the restriction, making all the monitoring pages
equally accessible.
2021-06-11 23:29:52 +01:00
Alberto Bertogli
f3b01cb493 docs: Add missing docstrings, adjust wording to match standard style
This patch adds a missing docstrings for exported identifiers, and
adjust some of the existing ones to match the standard style.

In some cases, the identifiers were un-exported after noticing they had
no external users.

Besides improving documentation, it also reduces the linter noise
significantly.
2018-03-04 16:00:06 +00:00
Alberto Bertogli
f629ffefa4 trace: Remove unused SetError function 2018-03-02 19:37:37 +00:00
Alberto Bertogli
033a5d657b Use the external log, spf and systemd packages
The log, spf and systemd packages have been externalized; use them
instead of the internal version to avoid having two versions of the same
thing.
2017-09-17 22:17:14 +01:00
Alberto Bertogli
60a7932bd3 log: Replace glog with a new logging module
glog works fine and has great features, but it does not play along well
with systemd or standard log rotators (as it does the rotation itself).

So this patch replaces glog with a new logging module "log", which by
default logs to stderr, in a systemd-friendly manner.

Logging to files or syslog is still supported.
2016-11-01 23:56:04 +00:00
Alberto Bertogli
a5e6e197a6 trace: Quote errors before logging them
Errors can contain newlines, in particular this is common in messages
returned by remote SMTP servers.

This patch quotes them before logging, they don't interfere with the
log. Note the tracer itself can handle this just fine.
2016-10-21 22:13:39 +01:00
Alberto Bertogli
cf36003e3a trace: Add an EventLog
This patch adds an EventLog wrapper to the trace module, which will be
used in the future to track long-lived objects.
2016-10-10 00:51:05 +01:00
Alberto Bertogli
220b5d20ff trace: Set max events to 30 by default
The default for max events is 10, which is a bit short for a normal SMTP
exchange. Expand it to 30 which should be large enough to keep most of
the traces.
2016-10-10 00:51:05 +01:00
Alberto Bertogli
2b46f300ca trace: Include debug messages in the traces
We don't want to write debug messages to the log, but having them in
traces is always useful.

The traces are volatile and self-cleaning so the additional volume
should not cause any problems, and helps troubleshooting.

While at it, fix the depth constant when logging.
2016-10-10 00:51:05 +01:00
Alberto Bertogli
3e6dd12d06 Improve debugging and tracing information
This patch reviews various debug and informational messages, making more
uniform use of tracing, and extends the monitoring http server with
useful information like an index and a queue dump.
2016-10-10 00:51:05 +01:00
Alberto Bertogli
77d547288f Implement couriers
This patch introduces the couriers, which the queue uses to deliver mail.

We have a local courier (using procmail), a remote courier (uses SMTP), and a
router courier that decides which of the two to use based on a list of local
domains.

There are still a few things pending, but they all have their basic
functionality working and tested.
2015-11-13 03:41:06 +00:00
Alberto Bertogli
fbf1060b71 Introduce a trace wrapper
This patch introduces a wrapper to golang.org/x/net/trace with a new method
that will be useful later on, making logging and tracing less verbose.
2015-11-06 10:27:11 +00:00