Commit graph

515 commits

Author SHA1 Message Date
fox.cpp
10e173fdb6
check/dkim: Use reason="" instead of comment to provide details 2019-10-21 20:01:21 +03:00
fox.cpp
ac7f4d5bc1
check/dkim: Don't replace reason with "body limit used" on error
Additional checks were executed on broken signatures too.
2019-10-21 20:01:21 +03:00
fox.cpp
21d842ba3e
check/dmarc: Relaxed alignment is the default 2019-10-21 20:01:21 +03:00
fox.cpp
a87c3de3f2
check/dkim: Always include a Authentcation-Results header field
So DMARC can always see that we actually attempted to verify
the signature.
2019-10-21 20:01:21 +03:00
fox.cpp
ad4c04452a
Minimal DMARC checking implementation 2019-10-21 20:01:21 +03:00
fox.cpp
7352fc312f
Update go-msgauth 2019-10-21 20:01:21 +03:00
fox.cpp
23e06d3df2
Update README.md
Add link to rendered pages

Closes #92.
2019-10-21 00:57:32 +00:00
fox.cpp
f9cd1e1c9a
cmd/maddy, cmd/maddyctl: Make Version a variable
Constants can't be modified by linker flags.
2019-10-20 16:56:01 +03:00
fox.cpp
0fd89a376a
cmd/maddyctl: Make version constants handling consistent with main executable
In particular, allow to set Version constant for use when module build
info is not available (executable is built using 'go build' instead
of 'go get').
2019-10-20 13:46:52 +03:00
fox.cpp
ae6decd876
Redesign imapsql-ctl utility (now named maddyctl)
Now it is not tied go-imap-sql details (with the exception of special
features), allowing it to be used with other storage backends that will
be added in the future.

--unsafe flag is removed and now maddyctl explicitly asks for
confirmation in cases where transaction may be unsafe for connected
clients. --yes flag disables that. In the future, maddy can be
extended with IPC interface to push updates so it this restriction
can be lifted altogether.
2019-10-20 01:50:07 +03:00
fox.cpp
547f35d41f
check/dkim: Use dkim=permerror instead of dkim=policy. 2019-10-19 19:14:17 +03:00
fox.cpp
ab1fdac45d
Remove check scoring system
It fits poorly with limited amount of checks that are (and will be)
implemented in maddy.

Advanced filtering that requires "spam score" logic should be performed
by external software such as rspamd. At this point duplicating that
logic in maddy makes no sense, since it is highly problematic to
integrate it with external software.
2019-10-19 19:12:44 +03:00
fox.cpp
9a6b0e6e31
check/dkim: Apply broken_sig_actions only if all signatures are invalid
Mailing lists break DKIM signatures by modifing Subject and other header
fields. They are supposed to either include their own DKIM signature
and/or ARC (RFC 8617) seal.
2019-10-19 16:25:12 +03:00
fox.cpp
130f390544
check/dkim: Improve error logs
Don't repeat that signature is broken three times.
2019-10-19 16:01:34 +03:00
fox.cpp
793446678a
check/dkim: Consider signatures with "body limit" tag invalid by default
This DKIM feature have dangerous interactions with MIME multipart
messages and so should never be used.
2019-10-19 00:17:00 +03:00
fox.cpp
826f0b6426
check/dkim: Allow requiring certain header fields to be signed 2019-10-18 23:55:03 +03:00
fox.cpp
4de309c65d
check/dkim: Report permerror/temperror in AuthResult instead of generic 'fail' 2019-10-18 23:35:24 +03:00
fox.cpp
fd52601513
remote: Implement common_domain method for authenticate_mx
See #151.
2019-10-18 22:18:35 +03:00
fox.cpp
5fd1b98104
remote: Fix assignment to a nil map in Body 2019-10-18 21:50:45 +03:00
fox.cpp
8970ed3f4e
remote: Implement authenticate_mx directive
See #151.
2019-10-18 21:50:34 +03:00
fox.cpp
e58648f68a
config: Implement Map.EnumList matcher 2019-10-18 19:12:50 +03:00
fox.cpp
379fd60fe8
dns: Add minimal security-aware stub resolver
Now it is a wrapper around miekg/dns library that reports
whether AD flag is set in the response. It does not perform
any verification on its own. This is not going to be implemented due
to complexity of code required to make it work reasonably fast.
2019-10-18 18:41:04 +03:00
fox.cpp
3ebe0f43c8
check/dkim: Fix log message including wrong error 2019-10-18 17:06:45 +03:00
fox.cpp
1942e68598
check/dns: Make logs slightly more compact
Don't repeat IP/domain twice when logging errors.
2019-10-17 00:33:34 +03:00
fox.cpp
ea765b8b6a
Fix tls_client initialization
*tls.Config should be used instead of tls.Config.
2019-10-16 23:19:40 +03:00
fox.cpp
5247e50e64
Add missing smtp_upstream import 2019-10-16 23:19:40 +03:00
fox.cpp
ae8fe2b14e
Fork imapsql-ctl utility from go-imap-sql repo
1. There is only one version for maddy and imapsql-ctl utility.
This prevents confusion about compatibility.

2. Modified imapsql-ctl understands maddy config format, this allows
it to read needed values from it without the need for lengthy commmand
line arguments.

Closes #148.
2019-10-16 23:19:40 +03:00
fox.cpp
d227fe269e
Update README.md
Update Documentation section to point to new manual pages directory.
2019-10-16 17:06:56 +00:00
fox.cpp
d33d7c5994
verify_dkim: Implement ok_score directive
Apparently, it was missing
2019-10-16 02:05:08 +03:00
fox.cpp
a0cd7c4e73
docs: Split and slightly extend man pages
Now modules are documented in separate man pages depending on their
main purpose. This generally keeps things more organised than with
one huge maddy.conf(5) page to document everything.
2019-10-16 02:05:08 +03:00
fox.cpp
5f8f447a36
config: Move parser code into config/parser
To keep it separate from other code in 'config' package that now
contains many shared configuration matchers.
2019-10-16 02:05:06 +03:00
fox.cpp
322ea230e3
remote: Add support for tls_client directive for advanced configuration 2019-10-16 00:40:04 +03:00
fox.cpp
7929e593a3
docs: Document smtp_upstream 2019-10-16 00:39:48 +03:00
fox.cpp
f048c96e13
smtp_upstream: Implement support for advanced TLS client configuration
Allows configuring TLS versions, cipher suites, client certificates,
etc.
2019-10-16 00:22:49 +03:00
fox.cpp
8d13260780
smtp_upstream: Implement authentication support
Supported modes:
- off
  No authentication with upstream server.
- forward
  Forward username:password pair used by client.
- plain
  Authenticate using username:password pair.
- external
  Authenticate using SASL EXTERNAL mechanism. Usually this is used for
  TLS client certificate auth.
2019-10-15 22:55:09 +03:00
fox.cpp
32d1580a01
Implement smtp_upstream
Closes #33.
2019-10-15 22:26:55 +03:00
fox.cpp
636a5765e5
config: Rename Address to Endpoint
To avoid confusion with email address.
2019-10-15 20:09:17 +03:00
fox.cpp
86e0e5d849
config: Implement Map.Enum helper
Closes #128.
2019-10-15 19:34:29 +03:00
fox.cpp
55d5d03c9a
check/dkim: Log bad signatures and other errors 2019-10-13 23:40:27 +03:00
fox.cpp
be8567bacd
Bump go-imap-sql version 2019-10-13 23:40:27 +03:00
fox.cpp
028d8b914c
Rename dispatcher to "msgpipeline"
New name more precisely describes what it is doing now. It was initally
meant to be more generic and usable for other purposes, but I don't
think we will need that flexibility.
2019-10-13 18:42:51 +03:00
fox.cpp
9d3b7f15a4
Update go-imap-sql
* f93c4bc Reduce amount of allocations in message processing code
2019-10-13 16:56:24 +03:00
fox.cpp
ad2b510e7a
storage/sql: Allow to enable compression support 2019-10-12 03:14:12 +03:00
fox.cpp
c265c7339e
Update go-imap-sql
- fsstore is now required, this is reflected by documentation updates.

Upstream commits:
* 8ee5c96 Fix handling of "null" compression
* d6bc61c Add support for zstd compression
* aa76135 Implement support for LZ4 compression support
* cde9a24 Update VersionStr constant
* 2008a7b Remove schema upgrade operations for older versions
* b6668d0 Remove section about Internal/External BLOBs from README
* e91826c cmd/imapsql-ctl: Remove support for reading driver/DSN from text file
* 0dca68f Rename imapsql.Store -> imapsql.FSStore
* 4071c69 Remove support for handling messages in table rows
* 4c8996e Remove most of the code for storing messages in table rows
* b682ac1 Skip header in openBody if needHeader = false
* 2a263c3 Require fsstore to be used
* 45b437d Remove CI job for testing with MariaDB
* 8d30346 Add 'go 1.12' to go.mod
2019-10-12 03:14:06 +03:00
fox.cpp
1e906dda7a
Enable fsstore for sql in default config
Storing message contents in table rows (default behavior) creates big
serialization delays for SQLite. With fsstore, message is written
to the disk outside of SQL transaction, thus transaction becomes
small enough to make SQLite synchronization delays non-signficant.

That is, SQLite, while staying strictly serial, processes transactions
fast enough. Though, that highly depends on disk speed. Here are my
measurements so far:
a) Using HDD on my PC, SQLite starts to fail with synchronization
timeouts with two parallel SMTP connections already.
b) Using SSD on my test server, 90 parallel connections flooding server
with total rate of around 550 messages per second (35 KiB each), no
synchronization timeouts.

It should be noted that throughput does not equal latency.
Server-based RDBMS can still provide much smaller write latencies since
they actually perform work in parallel. Though, it is believed that
latency is not critical for email exchange.

Conclusion is: SQLite-based storage works good enough for
moderately-sized email servers. Also, storage of big blobs in table rows
turned out to be much less practical than assumed initially, it may be
worth removing its support from go-imap-sql to simplify code.
2019-10-11 17:54:20 +03:00
fox.cpp
e8c6740b49
Update go-imap-sql
* 1679626 Fix wrong order of arguments for setInboxId query
* da0b12c Remove dangling External Store key when message is not added to DB
* c706691 Use Bytes() method on Reader passed to Delivery.Body
* 3d2b5b0 Fix User.inboxId = 0 for newly created users
* 45cd989 Remove schema upgrade restriction
2019-10-11 16:19:35 +03:00
fox.cpp
a936dd1fa2
Revert "address: Rewrite Split function"
This reverts commit 2fbe066ae5.
2019-10-10 18:36:19 +03:00
fox.cpp
08e6219013
Fix panic on startup with 'log off' 2019-10-09 20:43:04 +03:00
fox.cpp
b6e5ba7876
Update go-imap
See emersion/go-imap#302.
Closes #143.
2019-10-09 20:39:25 +03:00
fox.cpp
da79953c22
testutils: Use more realistic message for BenchDelivery
Set of common headers.
text/plain and text/html with a text attachment.
2019-10-09 14:55:35 +03:00