Repository navigation
feat: transform smtp-action into mail-action with IMAP receive (#82) - #92
Open
raphael-goetz wants to merge 1 commit into
Open
raphael-goetz wants to merge 1 commit into
raphael-goetz wants to merge 1 commit into
Conversation
Rename the SMTP action to a general-purpose mail action that can both send mail (SMTP, as before) and receive it via a new IMAP trigger. - rename actions/smtp-action -> actions/mail-action (package, action id) - add per-project IMAP server config (imap_host/port/secure/username/ password/mailbox) alongside the existing SMTP config - rename SMTP_SEND_RESULT -> MAIL_SEND_RESULT; send functions unchanged - add RECEIVED_MAIL data type and the MAIL_RECEIVED RuntimeEvent trigger with an `addresses` flow setting (string array; empty matches all) - add imapListener: a reconciling ImapFlow connection manager (one per project with a bound flow) that parses incoming mail and executes each flow whose configured addresses match the message recipients - update CI matrix and READMEs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/centaurus/-/pipelines/3015118587 Status: Passed Job summariesdocs:previewDocumentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/17646673089/artifacts/out/index.html |
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.
Closes #82.
Transforms the
smtp-actioninto a general-purposemail-actionthat both sends mail (SMTP, as before) and receives it via a new IMAP trigger. Multiple servers are supported the same way as today — one IMAP/SMTP server per project configuration.Changes
actions/smtp-action→actions/mail-action(git history preserved; package@code0-tech/mail-action, action id/auth-token defaults, CI matrix, root README).imap_host,imap_port(993),imap_secure(true),imap_username,imap_password,imap_mailbox(INBOX).SMTP_SEND_RESULT→MAIL_SEND_RESULT, functionssendEmail/sendEmailWithAttachmentskept.RECEIVED_MAILdata type (messageId, from, to[], cc[], subject, text, html, date).MAIL_RECEIVEDRuntimeEvent trigger with anaddressesflow setting (string array; empty = match all). Matching is done in the action against the message's To/Cc recipients.imapListener.ts: a reconcilingImapFlowconnection manager — one connection per project that has a boundMAIL_RECEIVEDflow, using that project's config. On new mail it parses withmailparser, then callsaction.executeFlowfor every matching flow.smtp-actionentry from.rust-actionsin CI (it was always a node action).Design notes
RuntimeEventmodel (registerRuntimeEventClass+executeFlow) in the TS actions — existing triggers are all REST webhooks. The Rustcron-actionuses the same model.mailboxOpen()(not a held mailbox lock) so ImapFlow's automatic IDLE stays active andexistsevents fire;existsprocessing is serialized against a UID high-watermark to avoid duplicate dispatch.Testing
npm run typecheck— clean.npm run test— 5/5 pass (send-result + received-mail schemas, address matching).🤖 Generated with Claude Code