Commit graph

185 commits

Author SHA1 Message Date
fox.cpp
e7d5418b88
storage/imapsql: Rename and clarify docs
See #212.
2020-03-05 22:04:17 +03:00
fox.cpp
9b279735e8
Address several TODO comments
Several comments were removed since they are not worth the trouble.
A few minor issues were addressed.
Most of remaining comments got corresponding GitHub issues assigned.
2020-03-05 02:26:30 +03:00
fox.cpp
46502217ed
Remove config.Map.MatchErr()
Obscure and often misused.
2020-03-05 02:26:29 +03:00
fox.cpp
20233fa4c4
Fix scopelint warning in SASL callbacks 2020-03-05 02:26:29 +03:00
fox.cpp
1579ea10b2
Use config.Node instead of *config.Node everywhere
Closes #197.
2020-03-05 02:26:29 +03:00
fox.cpp
e0c11040e2
auth/pass_table: Fix-up tests 2020-03-03 20:47:32 +03:00
fox.cpp
e3a438a3c7
Rewrite smtpconn SMTPUTF8 tests, fix code duplication in some other tests
Also drop 'dupl' from golangci.yml. It is not very useful for constant
use.
2020-03-01 02:36:54 +03:00
fox.cpp
c8768da05c
Clean unnecessry whitespace 2020-03-01 02:36:54 +03:00
fox.cpp
8b7577697b
table: Fix-up log message about missing file 2020-03-01 02:36:54 +03:00
fox.cpp
cdd01c8e37
Implement table-based authentication provider 2020-03-01 02:36:54 +03:00
fox.cpp
a91d8c2334
table: Fix race in file_table reload test
O_SYNC should be used to make sure other thread running concurrently
will see the change.
2020-02-29 22:44:32 +03:00
fox.cpp
ae36536d93
table: Implement SQL query-based table
Closes #82.
2020-02-29 19:23:28 +03:00
fox.cpp
9012d346ac
table: Fix-up file reload test 2020-02-28 02:35:26 +03:00
fox.cpp
bdd243668b
modify: Refactor alias_file to use generic Table for lookups
*Breaking change for configuration syntax*
2020-02-28 02:11:16 +03:00
fox.cpp
55a91a37b7
Revert authorization/authentication split
Authentication provider module is responsible only for authentication.
Nothing more. Access control (authorization) should be kept separate.
2020-02-28 01:38:40 +03:00
fox.cpp
3092ca0ca5
Lift restrictions on authentication credentials in shadow/pam modules
With new authorization/authentication identities split, it is possible
to have non-email authentication identity while using email authorization
identity.
2020-02-28 00:31:34 +03:00
fox.cpp
744dd3e10d
Implement separate lookups for username and password in authentication
Closes #56.
2020-02-28 00:29:41 +03:00
fox.cpp
eaaadfa6df
Implement & integrate generic SASL authentication support
This should make it possible to implement OAuth and TLS client
certificates authentication.
2020-02-27 21:40:04 +03:00
fox.cpp
0507fb89f4
config: Add helpers allowing multiple directive values
Aka specifying the same directive multiple times, e.g.
auth &one
auth &two
2020-02-27 18:01:20 +03:00
fox.cpp
a45c7090c4
Improve auth. provider interface
The authentication provider can now provide multiple authorization
identities associated with credentials. Protocols that support that
(e.g. JMAP, SASL) can let the client select the wanted identity.
2020-02-27 01:22:47 +03:00
fox.cpp
bd9122d92c
storage/sql: Fix BodyParsed error being ignored. 2020-02-22 23:06:37 +03:00
fox.cpp
353c1edd5e
Move Received header field generation into pipeline code 2020-02-22 23:02:00 +03:00
fox.cpp
d28b4a5dfa
endpoint/smtp: Protect command handlers with a mutex
Makes sure delivery is in consistent state when it is closed due to
shutdown.
2020-02-22 04:32:46 +03:00
fox.cpp
394668e7d1
dns: Fix DNS override not being used in some cases
PreferGo is necessary to force Go resolver to be used. Otherwise it
might use the CGo resolver and never call DefaultResolver.Dial.
2020-02-18 20:55:44 +03:00
fox.cpp
e890b96e81
check/dnsbl: Fix typo in *_threshold directive names 2020-02-18 20:53:04 +03:00
fox.cpp
8249d9a22a
check/spf: Fix the wrong enhanced code used for "permanent error" case 2020-02-18 20:52:26 +03:00
fox.cpp
da9bf22441
address: Implement validMailboxName
Closes #113.
2020-02-16 21:29:36 +03:00
fox.cpp
ff81f74b5b
smtpconn: Rewrite 552 code into 452
Closes #149.
2020-02-16 20:03:56 +03:00
fox.cpp
f559143728
target/queue: Increase the amount of tries, decrease delay scale factor
This makes server more aggressive in retrying delivery. The total
attempts time is approximately the same (around 5 days).

Notably, the increased amount of attempts is needed to handle large
recipient lists where the remote server sometimes rejects subset of them
with "Too Many Recipients" code.

See #149.
2020-02-16 19:56:57 +03:00
fox.cpp
8635a11293
target/queue: Rework error handling to track retries per-recipient
While was not strictly needed before, it is necessary in the presence of
limits and other internal target errors that should cause the delivery
to get rescheduled without increasing retries counter.
2020-02-16 16:28:39 +03:00
fox.cpp
5bf8cb9f03
endpoint/smtp: Limit amount of Received header fields
Closes #79.
2020-02-16 01:31:47 +03:00
fox.cpp
97926c0131
storage/sql: Report serialiation failures as temporary SMTP errors
To make it actually happen instead of hanging forever, go-imap-sql's
naive default for SQLite3's PRAGMA busy_timeout is changed to 5000ms.

Closes #146.
2020-02-16 01:14:05 +03:00
fox.cpp
3c536dd026
internal/remote: Fix-up tests 2020-02-15 23:49:01 +03:00
fox.cpp
3b8c02b998
endpoint/smtp: Add option to use FS as a temporary body store
Closes #76.
2020-02-15 23:49:01 +03:00
fox.cpp
aa2600aa50
msgpipeline: Run per-recipient body modifiers and checks 2020-02-15 17:08:35 +03:00
fox.cpp
4a875e69dc
endpoint/smtp: Move limit enforcement before "incoming message" log record
Avoid the possibility of logs flooding before limits can be applied.
2020-02-15 17:02:48 +03:00
fox.cpp
c3ebbb05a0
Generalize message flow restrictions
Set of flow restrictions is represented as a "limits" module instance
that can be either created inline via "limits" directive in some modules
(including "remote" target and "smtp" endpoint) or defined globally and
referenced in configuration of modules mentioned above.

This permits a variety of use cases, including shared and separate
counters for various endpoints and also "modules group" style sharing
described in #195.
2020-02-15 17:02:48 +03:00
fox.cpp
100ed13784
limiters: Generalize RateSet and rename to BucketSet
Makes it reusable with other limiters e.g. concurrency limiter.
2020-02-15 17:02:47 +03:00
fox.cpp
23a3097591
msgpipeline: Register pipeline as a delivery target module
Allows pipeline routing to be used in places where a regular target is
required. Also allows to share parts of pipeline configurations on the
semantical level (instead of lexical level as it goes with config
snippets), see #195.
2020-02-15 17:02:47 +03:00
fox.cpp
3b888fba61
msgpipeline: Refactor modify{} blocks to work as a "module group" 2020-02-15 00:18:23 +03:00
fox.cpp
708bbd1d20
msgpipeline: Implement same cfg block reuse as mx_auth 2020-02-14 23:32:29 +03:00
fox.cpp
5fa11e8597
target/remote: Allow to share outbound SMTP policies via top-level config blocks
See #195.
2020-02-14 22:33:28 +03:00
fox.cpp
9396e12e89
config/module: Add GroupFromNode utility for use in module groups 2020-02-14 21:59:50 +03:00
fox.cpp
8bdf039d80
Fix linter warnings
cmd/maddyctl: Silence errcheck warning for TcSetAttr.
check/command: Log Process.Interrupt errors.
check/dnsbl: Remove unused listedAction field.
config/lexer: Fix typo in comment.
2020-02-08 03:32:28 +03:00
fox.cpp
e5e2fa1b92
config/lexer: Fix missing 'return nil, err' line 2020-02-08 03:24:39 +03:00
fox.cpp
56ffdff07f
storage/sql: Enable I18NLEVEL=1 IMAP extension
go-imap-sql is already Unicode-aware so no other changes are needed.
I18NLEVEL=2 is not generally worth the effort so it is ignored.
2020-02-08 03:23:00 +03:00
fox.cpp
4f12ec4c99
target/remote: Fix race condition in MTASTS test
https://builds.sr.ht/~emersion/job/147975
2020-02-07 23:00:28 +03:00
fox.cpp
102770d443
config/lexer: Do not panic on I/O errors 2020-02-04 20:00:20 +03:00
fox.cpp
93cd9525f4
Unbreak PAM/shadow authentication support
Implement minimal version of removed auth_perdomain directive
specifically for these modules.

Closes #172.
2020-02-04 19:03:24 +03:00
fox.cpp
14505f4de1
config: Reload TLS server certificates once in a minute
Use of inotify and possibly other mechanisms poses portability risks.
Notably, "cross-platform" abstractions such as fsnotify library remove
access to certain features that are important to use it correctly in
some cases e.g. it is preferable to listen only for IN_CLOSE_WRITE on
Linux instead of IN_MODIFY to prevent races and unexpected failures.

Pooling approach avoids such problems by either running reload code at a
different time than actual renewal or retrying later if parse fails.
With certificates being renewed before expiry (e.g. 1 week before) delay
is not a signficiant problem.

Closes #160.
2020-01-02 19:12:10 +03:00