Skip to content

Email adapter auto-replies to all inbound email including noreply/automated senders #3453

@ItsMorePaul

Description

@ItsMorePaul

Bug Description

The email (IMAP/SMTP) gateway adapter auto-replies to every incoming email with no sender filtering. This includes:

  • noreply@, no-reply@, donotreply@ addresses
  • mailer-daemon@, postmaster@ bounce notifications
  • Newsletters, marketing emails, automated alerts
  • GitHub notifications, bank alerts, Substack digests

Unauthorized senders get pairing code replies

Emails from senders not in EMAIL_ALLOWED_USERS trigger the unauthorized DM handler in _handle_message(), which sends back:

Hi~ I don't recognize you yet!
Here's your pairing code: QBLYPM34
Ask the bot owner to run:
hermes pairing approve email QBLYPM34

This means every noreply address that emails you receives a reply containing a pairing code.

Authorized senders get full AI responses

Emails from whitelisted senders trigger the full agent loop, generating AI responses sent back via SMTP — even to automated notification emails.

Real-world impact

In my case, enabling the email adapter resulted in 64 auto-replies sent to noreply addresses, bounce notifications, newsletters, bank alerts, and more — before I caught it and disabled the adapter. Some of those replies bounced, generating further bounce-reply loops.

Root cause

email.py has zero pre-dispatch filtering:

  • No inspection of Precedence: bulk/list headers
  • No inspection of Auto-Submitted: auto-* headers
  • No inspection of List-Unsubscribe headers
  • No address pattern matching for noreply/no-reply/donotreply/mailer-daemon
  • No read-only / ingest-only mode
  • The only filter is self-message skipping (line ~348)

Precedent from other adapters

Other platform adapters have already solved this class of problem:

The email adapter has no equivalent mechanism.

Proposed fix

  1. Noreply address filtering — silently drop emails from common noreply patterns before dispatching
  2. Header-based filtering — inspect Precedence, Auto-Submitted, List-Unsubscribe, X-Auto-Response-Suppress to detect bulk/automated mail
  3. Read-only / ingest mode — config option to process inbound email without sending any SMTP replies
  4. Never send pairing codes via email — the unauthorized handler should ignore on email by default, not pair

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions