Commit graph

10 commits

Author SHA1 Message Date
Gusted
32b75262ad refactor(ifelse): shorten logic where possible 2021-08-10 19:33:54 +03:00
fox.cpp
2d18ff5a30
MIT => GPLv3; Add license/copyright notices everywhere 2020-07-22 16:12:26 +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
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
eb8a974b8f
target/remote: Attempt TLS without authentication instead of plaintext
TLS without authentication is still better than no TLS at all.

To save latency in transactions with a misconfigured recipient server
that cannot use TLS at all but still advertises STARTTLS support,
downgrade to non-authenticated TLS is attempted only on verification
errors (x509.UnknownAuthorityError or x509.HostnameError) and malformed
certificate errors (x509.ConstraintViolationError and
x509.CertificateInvalidError). In all other cases 'remote' module
fallbacks to plaintext directly.

While rearranging code to support this, some additional changes were
made to allow simplier implementation of security levels idea from #178.

See https://tools.ietf.org/html/rfc7435.
See #178.
2019-12-13 17:31:36 +03:00
fox.cpp
26452dd8dd
target/remote: Rewrite connection part to allow more concurrency
As revealed by latency tracing using runtime/trace, MTA-STS cache miss
essentially doubles the connection time for outbound delivery. This is
mostly because MTA-STS lookup have to estabilish a TCP+TLS connection to
obtain the policy text (shame on Google for pushing that terribly
misdesigned protocol, but, well, it is better than nothing so we adopt
it).

Additionally, there is a number of additional DNS lookups needed (e.g.
TLSA record for DANE).  This commit rearranges connection code so it is
possible to run all "additional" queries in parallel with the connection
estabilishment. However, this changes the behavior of TLS requirement
checks (including MTA-STS). The connection to the candidate MX is
already estabilished and STARTTLS is always attempted if it is
available. Only after that the policy check is done, using the result of
TLS handshake attempt (if any). If for whatever reason, the candidate MX
cannot be used, the connection is then closed. This might bring
additional overhead in case of configuration errors on the recipient
side, but it is believed to not be a major problem since this should not
happen often.
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
9e5bb288b3
Fix a bunch of grammar errors in messages around the code base 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
Renamed from target/smtpconn/smtputf8_test.go (Browse further)