Commit graph

43 commits

Author SHA1 Message Date
Gusted
8f30f559a1 refactor(errors): return errors where possible 2021-08-10 19:33:54 +03:00
Gusted
53cb4c06c2 refactor(errors): use errors.is to account wrapped errors 2021-08-10 19:33:54 +03:00
fox.cpp
ff584bb5a3
storage/blob/s3: Add missing didSync check 2021-08-09 13:02:21 +03:00
fox.cpp
ce896c7036
storage/imapsql: Implement delivery_map in addition to auth_map 2021-08-09 11:43:17 +03:00
fox.cpp
ef63383248
storage/blob: Implement S3-compatible storage support
Closes #304.
2021-07-15 20:34:15 +03:00
fox.cpp
02924d8d4b
storage/blob: Implement usability test using go-imap-backend-tests and go-imap-sql
Blob storage would also benefit from stress
testing and concurrency consistency tests.

But these are things that are probably also
worth adding to go-imap-backend-tests instead.
2021-07-15 20:34:07 +03:00
fox.cpp
956e9ed65f
Remove deprecated 0.3 module name aliases 2021-07-15 16:27:15 +03:00
fox.cpp
09393aed8f
Refactor imapsql ExternalStore to use modules
Closes #303
2021-07-11 21:42:38 +03:00
fox.cpp
6d44617840
Use context.Context in module.Table
Closes #366.
2021-07-10 14:56:43 +03:00
fox.cpp
a774674650
storage/imapsql: Use same normalization functions as authorize_sender 2021-07-09 22:49:38 +03:00
fox.cpp
7c2afde847
check/authorize_sender: Implement MAIL FROM, From header authorization for local senders
Closes #268.
2021-07-09 22:49:21 +03:00
fox.cpp
a2e781ab3a
storage/imapsql: Implement auth_map 2020-09-19 18:05:01 +03:00
fox.cpp
a99e6f7c5b
storage/imapsql: Move delivery logic to a separate file 2020-09-19 18:05:00 +03:00
fox.cpp
ec02cca6f8
Add more recover() at goroutine start points
This is a double-edged sword though as blind panic recovery
can lead to consistency issues in program state.

In particular, halting imapsql update push due to panic can lead
to a deadlock in IMAP code.

Panic in MTA-STS cache maintenance routine can lead to degraded
security.
2020-09-10 20:45:57 +03:00
fox.cpp
1da80d9ac5
storage/imapsql: Fix nil pointer reference when no IMAP filters are set 2020-08-21 23:07:04 +03:00
fox.cpp
665c443de6
Enable THREAD=ORDEREDSUBJECT and SORT extensions for go-imap-sql
Closes #252.
2020-07-27 16:46:50 +03:00
fox.cpp
f8caf1d188
storage/imapsql: Fix incorrect module name in log messages related to delivery errors 2020-07-24 18:21:52 +03:00
fox.cpp
2d18ff5a30
MIT => GPLv3; Add license/copyright notices everywhere 2020-07-22 16:12:26 +03:00
fox.cpp
e27574a9e5
storage/imapsql: Register module in delivery target namespace
Allows it to be used as "deliver_to imapsql".
2020-07-17 23:36:11 +03:00
fox.cpp
18bc68a7ac
Implement "IMAP filters"
Closes #202.
2020-07-17 23:33:59 +03:00
fox.cpp
bcceec4fe4
Extract several packages to form a public API 2020-07-15 01:31:06 +03:00
fox.cpp
03d9e52627
Rename modules and introduce namespace-aware module name lookups
See #248.
2020-07-15 01:31:05 +03:00
fox.cpp
7645daa886
Update dependencies, tidy go.mod, format files, fix minor linter warnings 2020-05-31 19:18:48 +03:00
fox.cpp
bf612cb865
storage/imapsql: Implement module.Table interface 2020-05-23 02:55:45 +03:00
fox.cpp
50bf3e6b33
storage/imapsql: Fix SPECIAL-USE support being accidentally disabled 2020-05-18 23:16:48 +03:00
fox.cpp
f395db25a6
storage/imapsql: Fix Close deadlock in case of EnableUpdatePipe fail 2020-04-26 21:31:12 +03:00
fox.cpp
e19d21dfcb
Fully separate authentication from IMAP access
Now imapsql module does not handle authentication. (it was not doing it so well
anyway)

sql_table module was introduced and used in the default configuration as
a replacement for functionality that was implemented by imapsql before.

Parts of maddyctl code were rewritten to make it work transparently with
any IMAP backend or credentials store.

Closes #212.
2020-04-14 00:06:47 +03:00
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
1579ea10b2
Use config.Node instead of *config.Node everywhere
Closes #197.
2020-03-05 02:26:29 +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
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
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
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
4ca9cc2d59
storage/sql: Fix the race between Close and EnableUpdatePipe goroutine 2019-12-28 18:41:55 +03:00
fox.cpp
7be7556b69
storage/sql: Make the update pipe socket path shorter
On *nix systems, the length of Unix socket path is limited to 104-108
characters.
2019-12-13 17:31:35 +03:00
fox.cpp
c4ea9a730f
Instrument the SMTP code using runtime/trace
runtime/trace together with 'go tool trace' provides extremely powerful
tooling for performance (latency) analysis. Since maddy prides itself on
being "optimized for concurrency", it is a good idea to actually live up
to this promise.

Closes #144. No need to reinvent the wheel. The original issue
proposed a solution to use in production to detect "performance
anomalies", it is possible to use runtime/trace in production too, but
the corresponding flag to enable profiler endpoint is hidden behind the
'debugflags' build tag at the moment.

For SMTP code, the basic latency information can be obtained from
regular logs since they include timestamps with millisecond granularity.
After the issue is apparent, it is possible to deploy the server
executable compiled with tracing support and obtain more information

... Also add missing context.Context arguments to smtpconn.C.
2019-12-13 17:31:35 +03:00
fox.cpp
305fdddf24
Use context.Context all over the place
It is useful to define background tasks lifetimes more precisely,
especially involving timeouts and other cancellation methods.

On top of that, several tracing facilities are context-based (e.g.
runtime/trace), so it is possible to use them now.
2019-12-13 17:31:35 +03:00
fox.cpp
48e21f566e
Extend .debug.* flags and hide them by default
Allow to override DNS resolver address via the -debug.dnsoverride flag
and SMTP port via -debug.smtpport.

All flags are not available unless maddy is built using the 'debugflags'
tag.
2019-12-13 17:31:35 +03:00
fox.cpp
a574b9fbb2
Use Unix socket to pass IMAP updates from maddyctl to daemon
There is abstraction 'updates pipe' defined for future use with
configuration involving IMAP data replication (e.g. multiple nodes with
maddy instances + PostgreSQL replicas + S3 bucket for messages).

However, for the case of local SQLite3 DB, limited UDS-based
implementation is provided. It solves the problem of maddyctl not being
able to tell the server about modifications it makes. Alternative to
this approach would be to have server actually perform operations and
maddyctl being a dumb API client, but this requires a lot more complex
IPC interface and will not work when the server is down.
2019-12-13 17:31:35 +03:00
fox.cpp
bf188e454f
Move most code from the repo root into subdirectories
The intention is to keep to repo root clean while the list of packages
is slowly growing.

Additionally, a bunch of small (~30 LoC) files in the repo root is
merged into a single maddy.go file, for the same reason.

Most of the internal code is moved into the internal/ directory. Go
toolchain will make it impossible to import these packages from external
applications.

Some packages are renamed and moved into the pkg/ directory in the root.
According to https://github.com/golang-standards/project-layout this is
the de-facto standard to place "library code that's ok to use by
external applications" in.

To clearly define the purpose of top-level directories, README.md files
are added to each.
2019-12-06 01:35:12 +03:00