Skip to content

Add Support for Custom Headers in SMTP Appender #3704

@ppkarwasz

Description

@ppkarwasz

Currently, the SMTP Appender does not support adding custom headers to outgoing email messages. In contrast, the HTTP Appender allows users to define custom headers using <Property> elements. Introducing similar support for the SMTP Appender would enhance feature parity across appenders and improve user experience and flexibility.

Proposed Solution

Both the HTTP and SMTP Appenders extend AbstractFilterable and already support <Property> configuration elements. In the HTTP Appender, these <Property> elements are interpreted as HTTP headers. Similarly, the SMTP Appender could treat <Property> entries as custom email headers.

Example:

<Appenders>
  <SMTP name="Email" ...>
    <Property name="X-Custom-ID" value="12345"/>
    <Property name="Reply-To" value="noreply@example.com"/>
  </SMTP>
</Appenders>

This change would preserve existing behavior while enabling greater customization for advanced email use cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions