22 Commits

Author SHA1 Message Date
Alberto Bertogli
f2e1524a13 docs: Regenerate man pages with a newer version of pod2man
The manpages are generated from pod files using pod2man, but it has been
a long time since we last re-generated them, and the new versions of
pod2man generate significantly different (and simpler) pages.

So this patch just regenerates the man pages, to make future changes
easier and more self contained to review.
2025-06-07 11:01:28 +01:00
Alberto Bertogli
2d228f726d docs: HAProxy support is no longer experimental
HAProxy integration has been unchanged for a long time, so this patch
removes the references that it is experimental from the documentation.
2025-06-07 11:01:28 +01:00
Alberto Bertogli
24c2c4f5fd Make the max queue size and give up time configurable
Today, the maximum number of items in the queue, as well as how long we
keep attempting to send each item, is hard-coded and not changed by end
users.

While they are totally adequate for chasquid's main use cases, it can
still be useful for some users to change them.

So this patch adds two new configuration options for those settings.
They're marked experimental for now, so we can adjust them if needed
after they get more exposure.

Thanks to Lewis Ross-Jones <lewis_r_j@hotmail.com> for suggesting this
improvement, and help with testing it.
2025-06-07 11:00:00 +01:00
Albert ARIBAUD
fa074ec16c chasquid-util: switch --configdir into --config_dir and deprecate --configdir
There's an inconsistency between chasquid (which uses `--config_dir`) and
chasquid-util (which uses `--configdir`).

That is prone to cause confusion, so this patch renames chasquid-util's
flag, leaving the old one as deprecated with a warning message.

Closes https://github.com/albertito/chasquid/pull/60.

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Added test case for the deprecated option, adjusted commit message.
2025-03-31 09:19:45 +01:00
Alberto Bertogli
83ae4c3478 userdb: Add support for receive-only users
Some use cases, like receive-only MTAs, need domain users for receiving
emails, but have no real need for passwords since they will never use
submission.

Today, that is not supported, and those use-cases require the
administrator to come up with a password unnecessarily, adding
complexity and possibly risk.

This patch implements "receive-only users", which don't have a valid
password, thus exist for the purposes of delivering mail, but always
fail authentication.

See https://github.com/albertito/chasquid/issues/44 for more details and
rationale.

Thanks to xavierg who suggested this feature on IRC.
2023-12-03 11:59:26 +00:00
Alberto Bertogli
a80051657a docs/man: Auto-generate markdown manpages
This patch adds auto-generation of markdown manpages, for ease of
reference in other documents and links.
2023-10-04 00:31:14 +01:00
Alberto Bertogli
e6c6df457d chasquid-util: Use server for aliases-resolve and domaininfo-remove
This patch makes chasquid-util's aliases-resolve and domaininfo-remove
commands talk to the chasquid server (via the new localrpc server).

For aliases-resolve, currently has fairly hacky logic which reimplements
a bunch of the servers', and is also incomplete because it does not
support hooks.

In this patch we fix that by having it talk to the server, where we get
authoritative responses and have no issues with aliases hooks. This
resolves https://github.com/albertito/chasquid/issues/18.

For domaininfo-remove, currently its implementation is also very hacky
since it manipulates files behind the servers' back and without even
using the internal library.

In this patch we fix that by doing the operation through the server,
avoiding the need for those hacks, and also remove the need to manually
reload the server afterwards.
2023-07-30 13:21:07 +01:00
znerol
ad0dbb9cda smtp-check: Add flag to specify local name
Some MTAs reject client connections unless the local name (used in the
HELO/EHLO command) looks like an FQDN. Currently, smtp-check always uses
`localhost`, which does not look like an FQDN.

This patch adds a command line flag to smtp-check to specify the
local name to be used.

Fixes https://github.com/albertito/chasquid/issues/37.

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Minor edits to the commit message, adjust flag name, go fmt.
2023-07-16 10:03:50 +01:00
Alberto Bertogli
948cee1ce1 Improve bash quoting, and other similar best practices
This patch updates the shell scripts with some of the common best
practices, which should make them more resilient to unusual failures and
unexpected environments (in particular, directories with spaces).

Most of these were identified by shellcheck.
2022-11-13 11:09:19 +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
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
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
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
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
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
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