feat(email): create SMTP send injector (#23)#289
Open
mariot wants to merge 11 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Email (SMTP) injector module to the OpenAEV injectors monorepo, including its runtime entrypoint, SMTP client, configuration schema, containerization, and initial tests/docs.
Changes:
- Added a new
email/injector package (email_injector) with contract definition, config loader, and SMTP send implementation. - Added Docker build/run assets (
Dockerfile,docker-compose.yml) plus sample configs (config.yml.sample,.env.sample). - Added initial tests and a README describing SMTP-specific configuration.
Reviewed changes
Copilot reviewed 16 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| email/test/test_email_helper.py | Adds a unit test for payload building. |
| email/test/test_email_client.py | Adds unit tests for SMTP send behavior (mocked). |
| email/test/init.py | Initializes the test package. |
| email/README.md | Documents injector purpose and SMTP config keys. |
| email/pyproject.toml | Defines the injector package + dependencies/dev tooling. |
| email/manifest-metadata.json | Adds catalog/manager metadata for the injector image. |
| email/email-injector-findings.md | Research/notes for future scope (signatures/headers/templates). |
| email/email_injector/openaev_email.py | Injector entrypoint wiring config/contracts to SMTP send execution. |
| email/email_injector/helpers/email_helper.py | Implements payload builder from inject content. |
| email/email_injector/helpers/init.py | Package init for helpers. |
| email/email_injector/contracts_email.py | Defines the Email inject contract (from/to/subject/body). |
| email/email_injector/configuration/injector_config_override.py | Declares injector config schema including SMTP settings. |
| email/email_injector/configuration/config_loader.py | Flattens OpenAEV/injector/SMTP config into daemon config. |
| email/email_injector/configuration/init.py | Package init for configuration. |
| email/email_injector/client/email_client.py | Implements SMTP send via smtplib. |
| email/email_injector/client/init.py | Package init for client. |
| email/email_injector/init.py | Package init for email injector. |
| email/Dockerfile | Builds a container image for the email injector via Poetry. |
| email/docker-compose.yml | Provides compose template to run the injector container. |
| email/config.yml.sample | Provides a sample YAML config for manual deployment. |
| email/.env.sample | Provides a sample env file for docker-compose deployment. |
Comment on lines
+35
to
+41
| server = smtplib.SMTP(smtp_hostname, smtp_port) | ||
| if smtp_use_tls: | ||
| server.starttls() | ||
| if smtp_username and smtp_password: | ||
| server.login(smtp_username, smtp_password) | ||
| server.send_message(msg) | ||
| server.quit() |
Comment on lines
+15
to
+18
| # OpenAEV configuration (flattened) | ||
| "openaev_url": {"data": str(self.openaev.url)}, | ||
| "openaev_token": {"data": self.openaev.token}, | ||
| # Injector configuration (flattened) |
Comment on lines
+5
to
+7
| - OPENAEV_URL=${OPENAEV_URL} | ||
| - OPENAEV_TOKEN=${OPENAEV_TOKEN} | ||
| - INJECTOR_ID=${INJECTOR_ID} |
Comment on lines
+5
to
+9
| OPENAEV_URL=ChangeMe | ||
| # admin account API token from the OpenAEV server | ||
| OPENAEV_TOKEN=ChangeMe | ||
|
|
||
| # INJECTOR Environment Variables |
Comment on lines
+1
to
+4
| openaev: | ||
| url: 'http://localhost:3001' | ||
| token: 'ChangeMe' | ||
|
|
Comment on lines
+7
to
+8
| SMTP settings are provided through the injector configuration (`config.yml`), | ||
| under the `injector` section, and are shared by every inject: |
| @@ -0,0 +1,48 @@ | |||
| [project] | |||
| name = "openaev-email-injector" | |||
| version = "2.260619.0" | |||
Comment on lines
+28
to
+29
| self.helper = OpenAEVInjectorHelper(self.config, icon_bytes) | ||
| pass |
Member
Author
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #289 +/- ##
==========================================
+ Coverage 67.52% 68.06% +0.53%
==========================================
Files 68 70 +2
Lines 3138 3191 +53
==========================================
+ Hits 2119 2172 +53
Misses 1019 1019
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
8818686 to
058b896
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Proposed changes
Testing Instructions
Related issues
Checklist
Further comments