Skip to content

test helpers: add functionality for sending emails#3026

Merged
georglauterbach merged 7 commits intomasterfrom
rspamd/3
Jan 29, 2023
Merged

test helpers: add functionality for sending emails#3026
georglauterbach merged 7 commits intomasterfrom
rspamd/3

Conversation

@georglauterbach
Copy link
Copy Markdown
Member

@georglauterbach georglauterbach commented Jan 25, 2023

Description

A small follow-up for things I noticed while getting Rspamd to work today. I should have thought about the permissions issue before, sorry. The disasbled modules were adjusted as well.

I can report though that Rspamd works nicely on my setup now :D

UPDATE: Correction; it works like a charm! It handles DKIM signing now (RSA+ED25519) & DNSBLs properly.

This PR was a Rspamd PR, now it is a test functions PR needed for continueing with Rspamd and other PRs (such as #3033).

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@georglauterbach georglauterbach added area/security kind/improvement Improve an existing feature, configuration file or the documentation service/security/rspamd labels Jan 25, 2023
@georglauterbach georglauterbach added this to the v12.0.0 milestone Jan 25, 2023
@georglauterbach georglauterbach self-assigned this Jan 25, 2023
polarathene
polarathene previously approved these changes Jan 25, 2023
@georglauterbach georglauterbach changed the title rspamd: follow-up of #3016 test helpers: add functionality for sending emails Jan 28, 2023
This was not planned, but as @polarthene mentioned in
#3033 (comment)
, filtering the mail log by email ID would be (the only) correct
approach for the Rspamd test (to eliminate race conditions).

I asserted the currect state, and came to the conclusion that this might
(or actually is) something we want in more than one place. So I went
ahead and implemented a solution.

The solution for acquiring the ID is a bit slower because it ensures the
mail queue is empty _before_ and _after_ the mail is sent. This is the
tradeoff one has to make if they want to send multiple emails in one
test file and get their IDs.

I hope you like this approach. I will provide another PR that adjusts
our current tests to use these new functions.
I think our work for our custom test framework should be noted in the
docs for newcomers to better understand what they should do.
@georglauterbach georglauterbach added kind/new feature A new feature is requested in this issue or implemeted with this PR area/tests and removed area/security kind/improvement Improve an existing feature, configuration file or the documentation service/security/rspamd labels Jan 28, 2023
Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Nice new helpers btw; thanks for the commit messages as added context and of course the documentation! 😀

@github-actions
Copy link
Copy Markdown
Contributor

Documentation preview for this PR is ready! 🎉

Built with commit: cfca305

@georglauterbach georglauterbach merged commit f496897 into master Jan 29, 2023
@georglauterbach georglauterbach deleted the rspamd/3 branch January 29, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tests kind/new feature A new feature is requested in this issue or implemeted with this PR priority/high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants