This project is mirrored from https://blitiri.com.ar/repos/chasquid. Updated .
  1. 06 Dec, 2019 2 commits
  2. 04 Dec, 2019 1 commit
    • Alberto Bertogli's avatar
      smtpsrv: Keep reading DATA input even if it's too large · 4edcd79a
      Alberto Bertogli authored
      When the DATA input is too large, we should keep on reading through it
      until we reach the end marker, otherwise there is a security problem:
      the remaining data will be interpreted as SMTP commands, so for example
      a forwarded message that is too long might end up executing SMTP
      commands under an authenticated user.
      
      This patch implements this behaviour, while being careful not to consume
      extra memory to avoid opening up the possibility of a DoS.
      
      Note the equivalent logic for single long lines is already implemented.
      4edcd79a
  3. 01 Dec, 2019 10 commits
    • Alberto Bertogli's avatar
      test: Add SPF integration test · 28cb9169
      Alberto Bertogli authored
      This patch adds a new integration test to cover SPF checks. The main
      goal is not to cover the SPF parsing, since that's handled by the
      library already, but the higher level aspects: that the mails are indeed
      rejected, that the DSN looks reasonable, etc.
      28cb9169
    • Alberto Bertogli's avatar
      test: Test multiline headers in hook output · 6000d07a
      Alberto Bertogli authored
      Hook output is checked to see if it looks like a header, which includes
      the possibility of multi-line headers.
      
      This patch extends the tests to include a multi-line header, to prevent
      accidental regressions.
      6000d07a
    • Alberto Bertogli's avatar
      test: Test permanent hook failure · 45a29440
      Alberto Bertogli authored
      This patch adds a test to make sure we handle correctly the case where a
      hook exits with a permanent failure.
      45a29440
    • Alberto Bertogli's avatar
      smtpsrv: Test too many recipients · a1287516
      Alberto Bertogli authored
      This patch adds a test to make sure we don't allow too many recipients.
      a1287516
    • Alberto Bertogli's avatar
      smtpsrv: Disable reloads during tests · 99c4ad5e
      Alberto Bertogli authored
      Reloading during tests will cause the testing aliases to be removed,
      which makes test runs that extend beyond 30s to be flaky.
      
      This patch fixes the bug by disabling reloads during these tests.
      99c4ad5e
    • Alberto Bertogli's avatar
      e8a6bf61
    • Alberto Bertogli's avatar
      test: Move testing couriers to testlib · a6a964ac
      Alberto Bertogli authored
      The testing couriers are currently only used in the queue tests, but we
      also want to use them in smtpsrv tests so we can make them more robusts
      by checking the emails got delivered.
      
      This patch moves the testing couriers to testlib, and makes both queue
      and smtpsrv use them.
      a6a964ac
    • Alberto Bertogli's avatar
      smtpsrv: Limit incoming line length and improve large message handling · 99df5e7b
      Alberto Bertogli authored
      Currently, there is no limit to incoming line length, so an evil client
      could cause a memory exhaustion DoS by issuing very long lines.
      
      This patch fixes the bug by limiting the size of the lines.
      
      To do that, we replace the textproto.Conn with a pair of buffered reader
      and writer, which simplify the code and allow for better and cleaner
      control.
      
      Thanks to Max Mazurov ([email protected]) for finding and reporting
      this issue.
      99df5e7b
    • Alberto Bertogli's avatar
      smtp: Limit incoming line length · d7006d0e
      Alberto Bertogli authored
      On the smtp client package, there is no limit to the length of the
      server's replies, so an evil server could cause a memory exhaustion DoS
      by issuing very long lines.
      
      This patch fixes the bug by limiting the total size of received data.
      Ideally this would be done per-line instead, but gets much more complex,
      so this is a compromise.
      
      The limit chosen is 2 MiB, which should be plenty for any the total size
      of server-side replies, considering we only send a single message per
      connection anyway.
      
      This is similar to 06d808c8 (smtpsrv: Limit incoming line length), which
      was found and reported by Max Mazurov ([email protected]).
      d7006d0e
    • Alberto Bertogli's avatar
      travis: Increase minimum supported version to 1.11 · bf01fab8
      Alberto Bertogli authored
      We want Travis CI to check against the Go version shipped in the latest
      Debian stable, to make sure chasquid can be built and run there.
      
      There was a new Debian release which has Go 1.11, so raise the CI config
      version accordingly.
      bf01fab8
  4. 30 Nov, 2019 4 commits
  5. 31 Oct, 2019 3 commits
  6. 26 Oct, 2019 1 commit
    • Alberto Bertogli's avatar
      test: Generate a prettier coverage report · a75eabbc
      Alberto Bertogli authored
      To make the coverage report a bit more accessible and easier to
      navigate, this patch makes the coverage tests generate a new HTML
      coverage report (in addition to the classic variant).
      a75eabbc
  7. 25 Oct, 2019 2 commits
    • Alberto Bertogli's avatar
      README: Update links and shields · 809578cb
      Alberto Bertogli authored
      This patch updates the README file, adjusting some of the existing
      references, as well as adding new ones (mainly pointing to new
      documentation).
      809578cb
    • Alberto Bertogli's avatar
      docs: Update install/build documentation · e8511e3f
      Alberto Bertogli authored
      This patch updates the installation guide to try to make the
      installation section more readable.
      
      It also assumes a modern Go environment is installed, which
      simplifies the process of building from source.
      e8511e3f
  8. 24 Oct, 2019 3 commits
    • Alberto Bertogli's avatar
      smtpsrv: Failures to enqueue are transient, not permanent · a47faf89
      Alberto Bertogli authored
      If we fail to put the message in the queue (e.g. because we're out of
      storage space, or the aliases-resolve hook errored out), it should be
      considered a transient failure.
      
      Currently we return a permanent error, which is misleading, as we want
      clients to retry in these situations.
      
      So this patch changes the error returned accordingly.
      a47faf89
    • Alberto Bertogli's avatar
      Update auto-generated code · 07187493
      Alberto Bertogli authored
      This patch updates the auto-generated code to match the latest tooling
      versions.
      
      In particular, the protobufs are regenerated, and the new version no
      longer supports unkeyed literals, so some minor changes are needed.
      
      Other than that, the cipher list is extended with the latest ciphers.
      07187493
    • Alberto Bertogli's avatar
      aliases: Implement aliases hooks · f399fe3e
      Alberto Bertogli authored
      This patch implements two new hooks: alias-resolve and alias-exists.
      
      They are called during the aliases resolution process, to allow for more
      complex integration with other systems, such as storing the aliases in a
      database.
      
      See the included documentation for more details.
      f399fe3e
  9. 22 Oct, 2019 2 commits
  10. 21 Oct, 2019 1 commit
  11. 19 Oct, 2019 6 commits
    • Alberto Bertogli's avatar
      smtp-check: Improve error reporting · 27227986
      Alberto Bertogli authored
      smtp-check exits on the first error, which is not ideal when
      troubleshooting, as seeing only one error can mask others, or make it
      more difficult to find the underlying cause.
      
      This patch improves how smtp-check reports errors by tweaking the
      presentation a bit, as well as perform almost all checks regardless of
      whether they pass or not.
      27227986
    • Alberto Bertogli's avatar
      docs: Add documentation about tests · 0bf8f72c
      Alberto Bertogli authored
      This patch replaces test/README, which was becoming a bit outdated, with
      a more general description of the different tests at a high level, and
      includes it in the documentation index.
      0bf8f72c
    • Alberto Bertogli's avatar
      605e39d0
    • Jonas Seydel's avatar
      Add aliases-add subcommand to chasquid-util · 8d910fc8
      Jonas Seydel authored
      8d910fc8
    • Alberto Bertogli's avatar
      gitlab-ci.yml: Run integration tests against submitted and latest deps · 9dea372d
      Alberto Bertogli authored
      It is useful to run the integration tests both against the submitted
      dependencies, based on Go module versions from the repository, as well
      as the latest ones, to catch integration problems early.
      
      This patch extends the .gitlab-ci.yml configuration to do that, by
      optionally passing a flag to "go get" to update the modules.
      9dea372d
    • Alberto Bertogli's avatar
      test: Adjust Dockerfile to support modules · 3aa7bb45
      Alberto Bertogli authored
      When modules are configured, go will now attempt to fetch them on build,
      using the proxy.
      
      That causes the integration tests run via Docker to fail, because go
      build attempts to contact the proxy within the test environment, which
      has the external DNS resolvers disabled.
      
      This patch fixes the problem by adjusting the pre-run fetch to use the
      new modules system. We fetch the dependencies to the cache so that when
      they're needed within the environment, they are present and there's no
      need to use the proxy.
      3aa7bb45
  12. 18 Oct, 2019 3 commits
  13. 14 Oct, 2019 1 commit
    • Alberto Bertogli's avatar
      smtpsrv: Use spf.CheckHostWithSender · 41d96059
      Alberto Bertogli authored
      The spf library has gained support for macros, but to process them
      properly, a new function needs to be called with the full sender
      address, spf.CheckHostWithSender.
      
      This patch updates chasquid's calls to the new API.
      41d96059
  14. 10 Sep, 2019 1 commit