95 Commits

Author SHA1 Message Date
Alberto Bertogli
78df715a02 docs: v1.6 release notes 2020-11-22 09:35:08 +00:00
Alberto Bertogli
e79586a014 Implement HAProxy protocol support
This patch implements support for incoming connections wrapped in the
HAProxy protocol v1.

This is useful when running chasquid behind a HAProxy server, as it
needs the original source IP to perform SPF checks.

This patch is a reimplementation of one originally provided by Denys
Vitali in pull request #15, except the logic for the protocol handling
is moved to a new package, and the smtpsrv.Conn handling of the source
IP is simplified.

It is marked as experimental for now, since we want to give it a bit
more exposure just in case the option/api needs adjustment.

Thanks a lot to Denys Vitali (@denysvitali in github) for sending the
original patch for this, and helping test it!
2020-11-13 20:49:42 +00:00
Alberto Bertogli
1cc7b9a864 smtpsrv: Pass EHLO/HELO domain to the post-data hook
Some utilities might want to access the EHLO/HELO domain in the
post-data hook (for example, to do additional SPF validations).

This patch implements that support, including sanitizing the EHLO domain
on the environment variable to reduce the risk of problems.
2020-09-17 01:29:49 +01:00
Alberto Bertogli
4c26713f40 docs: Add details about the hook variables
This patch adds some wording to explain each of the hook variables.
2020-09-17 01:29:49 +01:00
Alberto Bertogli
7914590cfa docs: Update and extend links to distribution packages
This patch updates and extends the links to the distribution packages,
referencing them from the README (it's more likely to be what the reader
wants to see), and also extending the Arch packaging with binary package
information.
2020-09-13 11:31:31 +01:00
Alberto Bertogli
9e3c102f34 docs: v1.5 release notes 2020-09-12 12:03:25 +01:00
Alberto Bertogli
a2ce7c7323 docs: Minor style changes to the monitoring documentation
This patch contains minor style and formatting changes to the Monitoring
documentation, to (hopefully) improve readability and consistency.
2020-08-21 12:07:33 +01:00
Alberto Bertogli
7fe42a368a monitoring: Add OpenMetrics exporter
This patch makes chasquid's monitoring server expose an OpenMetrics
metrics endpoint.

It adds a new package "expvarom" which implements an HTTP handler that
exports expvar variables in the OpenMetrics text format.

Then, the handler is registered by the monitoring server at /metrics
(where most things expect it to be).

The existing exported variables are also extended with descriptions,
which is optional, but improves the readability of the metrics.
2020-08-21 12:07:33 +01:00
Alberto Bertogli
d9d56552f3 maillog: Support logging to stdout and stderr
This patch adds support for writing maillog to stdout and stderr, which
can be desirable in certain environments.

Thanks to Denys Vitali <denys@denv.it> who sent an alternative patch for
this functionality.
2020-05-24 02:26:18 +01:00
Alberto Bertogli
bee7a9f193 docs: v1.4 release notes 2020-05-22 12:59:29 +01:00
Alberto Bertogli
4c28efcb20 config: Allow overrides from the command line
This patch allows the configuration values to be overridden from the
command-line, with a new -config_overrides flag.

There is a fairly specific use case for this, when editing the
configuration file is not feasible or convenient (e.g. running an
user-supplied configuration in a managed environment).
2020-05-17 00:10:06 +01:00
Alberto Bertogli
70387207f2 man: Update generated versions
This patch just re-runs the pod generator using a newer version of it,
going from 4.09 to 4.11.

There are no content changes.
2020-05-13 20:42:09 +01:00
Alberto Bertogli
13ee3ba482 courier: Use the hostname in SMTP HELO
The SMTP courier, which handles outgoing connections, uses the domain of
the envelope's from as the domain in the HELO/EHLO greeting.

This works fine in practice, but ideally the domain used in the greeting
should match the reverse DNS record. This used to be more relevant but
nowadays it is not really enforced; however, it sometimes comes up in
self checks, and might cause some confusion when troubleshooting.

So this patch makes it use the configured hostname instead, which is
under the users' control and more likely to be compliant. It also
simplifies the code.

The documentation of the hostname configuration option is also updated
to mention this behaviour.

Thanks to Jonas Seydel (thor77) for bringing this up.
2020-05-13 20:27:17 +01:00
Alberto Bertogli
2b9c2df9d3 docs: v1.3 release notes 2020-04-12 11:42:00 +01:00
Alberto Bertogli
6815cf1d5c docs: Add Arch installation instructions
There is an AUR package for chasquid, so this patch adds references to
it in the documentation.

Thanks to Max Mazurov (fox.cpp@disroot.org) for adding the package.
2020-03-28 17:59:46 +00:00
Alberto Bertogli
fcbd20cd74 docs: Add a section on dovecot auth troubleshooting
This patch adds a section on dovecot authentication troubleshooting,
with common suggestions that can help identify what is going on when
the chasquid-dovecot interaction isn't working as expected.
2020-03-21 16:54:39 +00:00
Alberto Bertogli
65afb02cd5 docs: Document the use of SRS when doing alias forwarding
When an alias has a remote destination, chasquid uses sender rewriting
(also known as SRS [1]) to forward the email without risking being in
violation of SPF policies.

See https://en.wikipedia.org/wiki/Sender_Rewriting_Scheme for more
details.

This, however, wasn't documented anywhere, as noted in
https://github.com/albertito/chasquid/issues/6.

This patch adds a paragraph to the alias documentation explaining this
behaviour.
2020-03-21 14:15:47 +00:00
Alberto Bertogli
0df2e325ed docs: v1.2 release notes 2019-12-06 15:33:07 +00:00
Alberto Bertogli
8f2eba5795 docs: Add release notes, replacing the upgrading notes
This patch replaces the upgrading notes, which focused only on
backwards-incompatible changes, with more detailed release notes.
2019-12-06 15:19:50 +00:00
Alberto Bertogli
0c92fb4937 docs: Add section about monitoring with Prometheus
This patch adds a section to the monitoring docs with an example of how
to use the prometheus-expvar-exporter to monitor chasquid with
Prometheus.
2019-10-31 21:38:34 +00:00
Alberto Bertogli
8b80e9fc2e docs: Add missing monitoring expvar, correct minor wording 2019-10-31 21:36:58 +00:00
Alberto Bertogli
e8511e3f55 docs: Update install/build documentation
This patch updates the installation guide to try to make the
installation section more readable.

It also assumes a modern Go environment is installed, which
simplifies the process of building from source.
2019-10-25 16:00:15 +01:00
Alberto Bertogli
f399fe3e84 aliases: Implement aliases hooks
This patch implements two new hooks: alias-resolve and alias-exists.

They are called during the aliases resolution process, to allow for more
complex integration with other systems, such as storing the aliases in a
database.

See the included documentation for more details.
2019-10-24 21:37:09 +01:00
Alberto Bertogli
5782a7705e hooks: Add rspamd integration to the example hook
Rspamd (https://rspamd.com/) is a popular open-source spam filtering
system.

This patch adds integration with it in the example hook, which uses the
rspamc client to get a veredict, similar to what it does for
Spamassassin.
2019-10-21 13:51:58 +01:00
Alberto Bertogli
0bf8f72c73 docs: Add documentation about tests
This patch replaces test/README, which was becoming a bit outdated, with
a more general description of the different tests at a high level, and
includes it in the documentation index.
2019-10-19 13:06:30 +01:00
Alberto Bertogli
5fa756fddc docs: Clarify how users are identified to dovecot
In authentication requests sent to dovecot, chasquid uses the full
addresses, "user@domain". However this wasn't mentioned in the
documentation, and could cause some confusion.

So this patch adds an explicit clarification about this in the dovecot
integration documentation.
2019-10-19 00:45:18 +01:00
Alberto Bertogli
bb97991a24 docs: Add aliases documentation
The processing of aliases wasn't properly documented in an user-visible
way, so this patch adds a new section for it.
2019-10-19 00:45:18 +01:00
Alberto Bertogli
e98464c424 docker: Add Dockerfile for running chasquid+dovecot+letsencrypt
This patch adds a new docker directory, which contains a Dockerfile plus
some additional configuration for creating a container that runs
chasquid+dovecot+letsencrypt.

It also updates the gitlab CI pipeline to automatically build and
publish an image on each commit.

This is experimental and likely to break.
2019-08-12 01:21:41 +01:00
Alberto Bertogli
c6c9866ae1 docs: Add documentation for security level checks
This patch adds documentation for the security level checks, and
references it (the rendered version, for convenience) from the README
file.
2019-08-06 03:05:43 +01:00
Alberto Bertogli
d348477841 docs: Integrate with readthedocs.org
This patch adds configuration to integrate with readthedocs.org, using
mkdocs as rendering engine.

It also does minor documentation updates, to tidy some things up
(clearer titles, move some documentation from the root into docs/, etc).
2019-08-05 14:30:14 +01:00
Alberto Bertogli
e8ccff749e docs: Add documentation for the monitoring facilities
This patch adds a new document, to cover the monitoring facilities
provided by the daemon.
2019-07-16 01:31:57 +01:00
Alberto Bertogli
25624b406d docs: Document submission_over_tls_address option
The submission_over_tls_address configuration option has existed for a
long time, but was not properly documented.

This patch adds it to the manpage, as well as printing it in the
configuration output on startup.
2019-07-15 01:58:55 +01:00
Alberto Bertogli
1a764cb87c docs/howto: Minor updates
This patch contains some minor updates to docs/howto.md for simplicity
and readability.

In particular removing the "testing" qualifier from Debian, since the
guide can be used on Debian stable, and also removing a clarification in
a comment about a very old version of chasquid.
2019-07-13 18:18:28 +01:00
Alberto Bertogli
4ecc5461d3 Add driusan/dkim integration example and tests
This patch adds DKIM signing using https://github.com/driusan/dkim tools
to the example hook.

It also adds an optional integration test to exercise signing and
verification, and corresponding documentation.
2018-11-30 10:03:48 +00:00
Alberto Bertogli
5878fc74f3 docs/man: Make chasquid.1 description match the README file 2018-07-22 11:15:40 +01:00
Alberto Bertogli
a2fa1d07d1 docs/man: Make generate script use git timestamps
When regenerating the manpages, the mtime of the pod files is used.
That mtime can change based on file and repository manipulations,
because git does not preserve mtimes.

This causes unnecessary regenerations which require manual cleanups in
order to avoid cluttering the history unnecessarily.

This patch makes the generate script set the mtime of the pod files to
the time of the last git commit that affected them, if they have not
changed since. This avoids unnecessary changes and makes the script
easier to use.

There's one file that needed adjustment to match its last commit time,
that is also included here.
2018-07-22 11:11:08 +01:00
Alberto Bertogli
770a618c84 docs: Fix "chasquid-util user-add" typo 2018-07-14 10:08:27 +01:00
Alberto Bertogli
a94253ba25 docs: Fix minor typo in chasquid.conf.5.pod 2018-06-06 19:47:09 +01:00
Alberto Bertogli
17b7bbe9c6 dovecot: Remove "experimental" qualifiers
dovecot support has been around for a release, has decent testing and
seems stable enough to remove the "experimental" qualifier.
2018-06-04 23:45:18 +01:00
Alberto Bertogli
4373f56a82 chasquid-util: Add domaininfo-remove
This patch adds a chasquid-util subcommand to remove a domain
information entry.

The main use case is to manually allow a security level downgrade, after
performing manual verification.
2018-05-24 23:02:57 +01:00
Alberto Bertogli
24af22ac35 docs: Add man pages
This patch adds man pages for chasquid's main commands and
configuration. They are generated using pod2man (commonly used for this,
and included with perl in most distributions).

The generated man pages are included to avoid introducing a dependency
for such simple task, similar to how we handle protocol buffer generated
files.
2018-04-04 21:26:02 +01:00
Alberto Bertogli
4abffc9aaa docs: Minor link and wording fixes
Fix a link to letsencrypt in the how-to, and missing wording in the
readme.
2018-03-04 21:01:06 +00:00
Alberto Bertogli
12b856a387 docs: Add a how-to guide
This patch adds a brief how-to guide for setting up an email server with
Debian, dovecot and chasquid.

It is incomplete, but has enough information that it's ok to include it.
2018-03-02 19:55:12 +00:00
Alberto Bertogli
d39d3aaff4 chasquid: Dovecot support (experimental)
This patch adds dovecot support to the chasquid daemon, using the
internal dovecot library added in previous patches.

Dovecot support is still considered EXPERIMENTAL and may be reverted, or
changed in backwards-incompatible ways.

The patch also adds the corresponding integration test, which brings up
a dovecot server with a custom configuration, and tests chasquid's
authentication against it.  If dovecot is not installed, the test is
skipped.
2018-02-10 23:18:31 +00:00
Alberto Bertogli
2da74c1758 docs: Add some documentation and a README 2016-11-03 00:51:59 +00:00