Validate SMTP sender aliases and surface effective sender in outreach flows#562
Merged
Merged
Conversation
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.
Motivation
from_emailvalues from being used for SMTP sends and surface why a send was rejected.Description
SMTP_ALLOWED_FROM_EMAILSand implement sender authorization inbackend/services/backlink_outreach_sender.pywithvalidate_sender_alias,SenderAuthorizationResult, andSendEmailResult, normalizing aliases and including configuredSMTP_FROM_EMAIL/SMTP_USERNAMEas allowed aliases.send_emailto return aSendEmailResult, reject unauthorizedfrom_emailvalues, and include the effective sender and failure reason codes on failure.backend/routers/backlink_outreach.pyvalidatepayload.sender_emailbefore creating the outreach request, use the validated effective sender when creating the attempt, passfrom_email=payload.sender_emailtosend_emailonly after validation, and merge send-layer failure reasons into the response.effective_sender_emailtoSendOutreachResponse(backend/services/backlink_outreach_models.pyandbackend/services/backlink_outreach_service.py) and update the frontend API type (frontend/src/api/backlinkOutreachApi.ts).frontend/src/components/BacklinkOutreach/BacklinkOutreachDashboard.tsx) to display the effective sender in latest-attempt cards and the attempt history table header.Testing
python -m py_compile backend/services/backlink_outreach_sender.py backend/routers/backlink_outreach.py backend/services/backlink_outreach_models.py backend/services/backlink_outreach_service.py, which succeeded.PYTHONPATH=backend pythonto exerciseBacklinkOutreachSender.validate_sender_aliasand it passed local alias-normalization and rejection assertions.cd frontend && npx tsc --noEmit, which failed in this environment due to missing Node type definitions and a TypeScript configuration deprecation, so frontend build/type-check could not be fully validated here.Codex Task