Skip to content

Horde_Mail_Rfc822 validator rejects valid email domains starting with digits (e.g. 180grad-kiel.de) causing "Error when parsing angle address" #12992

@Phillipxh

Description

@Phillipxh

Bug description

Nextcloud Mail cannot send any emails when the mail domain starts with a digit (e.g. 180grad-kiel.de). The Horde RFC822 validator rejects these domains as invalid when validate => true is set in Transport.php, even though RFC 1123 explicitly allows domain labels to start with digits.

Steps to reproduce

  1. Configure a Nextcloud Mail account with an email address on a domain whose first label starts with a digit (e.g. user@180grad-kiel.de)
  2. Attempt to send any email
  3. The message stays in the outbox and the following error appears in the log

Error message

Horde_Mime_Exception: Error when parsing angle address.
Horde_Mail_Exception: Error when parsing angle address.
at Horde_Mail_Rfc822->_parseAngleAddr()

Root cause

In vendor/bytestream/horde-mail/lib/Horde/Mail/Transport.php line ~137:

'validate' => $this->eai ? 'eai' : true

The Horde RFC822 parser with validate => true rejects domain labels starting with digits, despite RFC 1123 Section 2.1 explicitly relaxing the RFC 1034 restriction.

Workaround

Change true to false in Transport.php line ~137.

Environment

  • Nextcloud: 33.0.3.2
  • Mail app: 5.8.1
  • PHP: 8.4
  • OS: Debian 12

Metadata

Metadata

Assignees

No one assigned

    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