Skip to content

SMTP Handler - Attachments empty #1664

Description

@m4admin

Bug: SMTP $SmtpEvent.Email.Attachments empty/zero bytes while raw $SmtpEvent.Email.Data contains attachments (MimeKit can extract)

Summary

When receiving emails via Pode SMTP, $SmtpEvent.Email.Attachments is empty or contains attachments with Bytes.Length = 0, even though the raw message in $SmtpEvent.Email.Data clearly contains the MIME attachment parts. If I parse $SmtpEvent.Email.Data using MimeKit, the attachments are present and can be extracted with correct sizes.

This makes attachment forwarding/processing unreliable unless I re-parse the raw MIME message myself.

Environment

  • Pode: 2.12.1
  • PowerShell: 7.4.13

Expected behavior

  • $SmtpEvent.Email.Attachments contains all attachments present in the email, with non-empty Bytes matching the actual attachment content.

Actual behavior

  • $SmtpEvent.Email.Attachments is empty

Reproduction steps

  1. Start a Pode SMTP server with a handler that logs attachment info and saves raw message data.
  2. Send an email with one or more attachments (e.g., PDF, DOCX, PNG) from Outlook/Exchange.
  3. Observe that $SmtpEvent.Email.Attachments is empty or has zero-length bytes.
  4. Parse $SmtpEvent.Email.Data with MimeKit and confirm attachments exist and can be extracted.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions