feat: add string attachments, SMTP keep-alive, and command timelimit#112
feat: add string attachments, SMTP keep-alive, and command timelimit#112ChiragAgg5k merged 2 commits intomainfrom
Conversation
Add support for three new SMTP adapter features needed by the mail worker: - String-based attachments: Attachment class accepts optional raw string content, used directly via addStringAttachment() instead of file path - SMTPKeepAlive: reuse PHPMailer instance across process() calls, clearing recipients/attachments between sends - SMTP command timelimit: configurable per-command timeout via Timelimit All new constructor parameters have backwards-compatible defaults.
Greptile SummaryThis PR extends
Confidence Score: 5/5Safe to merge — all changes are additive, defaults preserve existing behavior, and prior review concerns are resolved. No P0 or P1 issues found. All three new features default to current behavior, the keepAlive state reset is correct, and the encoding parity between the two attachment branches (raised in an earlier review) has been applied. The unit tests cover the new code paths, and integration tests are present for when the maildev environment is available. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix: address PR review comments" | Re-trigger Greptile |
- Remove redundant clearAddresses/clearBCCs/clearCCs calls since clearAllRecipients() already covers them - Add explicit ENCODING_BASE64 to file-path attachment branch for consistency with the string-content branch
Summary
Attachmentclass now accepts optional?string $contentfor raw content, bypassing file path reads in the SMTP adapterkeepAliveconstructor param reuses the PHPMailer instance acrossprocess()calls, clearing recipients/attachments between sendstimelimitconstructor param configures per-command timeout via$mail->getSMTPInstance()->TimelimitAll new parameters default to current behavior — no breaking changes.
Test plan
Attachmentstring content getter and null default pass locally