0

What am I missing...

Given: Linux-stack based email server system (hosted) with webmail component. Various email clients and other webmail systems involved and tested with this.

We are distributing emails via distribution lists using the webmail client. The mail system sends emails similar to the following example (copy from source email header). Where organisation is the name of a distribution list:

Date: Sat, 20 Apr 2024 18:35:45 +0200
Message-ID: <[email protected]>
From: [email protected]
To: organisation: [email protected], [email protected];
Subject: here goes the subject

So far so good, emails are delivered OK (even to GMX mailboxes) and no "undeliverable email" message is received.

Issue

Next replying "to all" from certain email clients or webmail systems (e. g. GMX webmail) are resulting in obviously misformed headers (while using e. g. Thunderbird produces a correct format). Those replies are rejected by certain systems; example message:

Your e-mails have been rejected by our mail system because the information provided in the e-mail header does not comply with the specifications in RFC 5322 and RFC 2047. The header field "To" is syntactically not correct.

The email header in question looks like this (pls. pay particular attention to To: line):

Received: from ...
Reply-To: ...
From: <[email protected]>
To: <[email protected]>, <organisation: [email protected]>;
References: <[email protected]>
In-Reply-To: <[email protected]>
Subject: AW: here goes the subject

Obviously certain mail clients are interpreting the supplied name of the distribution list as part of the email address of the first addressee.

The questions at hand are: (1) Who is the culprit? (2) What is the correct format? (3) Is the server distributing the original message not following certain RFC's or is this a failure in a mail client or mail system?

===== final edit =====

This apparently is a bug in Horde. Ticket raised.

5
  • i think some of the clients are not following the RFC 5322 -> ietf.org/rfc/rfc5322.txt -> 3.4. Address Specification. look at group group = display-name ":" [group-list] ";" [CFWS] , group-list=mailbox-list a mailbox can consist of a name-addr which is ǹame <addr spec> or simply the addr-spec .. which consist of a localpart and "@" and domain. the localpart can be a quoted string or an dot-atom.... a dot-atom consist of an atext .. but colon is not allowed for atext. so the first address must start after colon. I'm no expert. Commented Apr 22 at 10:20
  • i think you should try to deliver To: organisation: <[email protected]>, <[email protected]>;CRLF Commented Apr 22 at 10:21
  • Are you using sendmail? If so, msmtp could help significantly.
    – JayCravens
    Commented Apr 23 at 22:53
  • @Schmaehgrunza - I do have no influence on the format going out, which would point to the service provider's setup.
    – mgw
    Commented Apr 24 at 15:40
  • @JayCravens ...same here: can't influence "mail machinery".
    – mgw
    Commented Apr 24 at 15:41

2 Answers 2

1

(this is probably wrong but left as-is since there's some useful discussion below)

Where organisation is the name of a distribution list:

Whatever is generating the original email is at fault here. Mailbox names (the bit before @domain) can contain spaces, @ characters and all sorts of other weird stuff. So the forwarding is correctly interpreting the first entry from the To: header as "organisation: [email protected]".

I'd need to do a lot of reading to determine if a space explicit requires quoting or escaping (the '@' character in a mailbox name does). So I can't tell you if the error claiming this is not RFC compliant is accurate - however this point is moot since even if it were not required, this is not the behaviour you intend.

10
  • 2
    ietf.org/rfc/rfc5322.txt -> 3.4. Address Specification -> group = display-name ":" [group-list] ";" [CFWS] , group-list=mailbox-list and a mailbox list is a comma separated list of mailboxes mailbox=name <addr-spec> or mailbox=<addr-spec>, so i think it must be To: organisation: <[email protected]>, <[email protected]>; .. but an addr-spec consist of an atext or a dotatom, -> look at Standards Track dotAtom - atext Page 12... a colon is not allowed for atext, so i dont know why organisation is bounded to the first addr-spec. Commented Apr 22 at 9:56
  • Thank you - I stand corrected.
    – symcbean
    Commented Apr 22 at 16:29
  • So the issue is the missing <> around the addresses
    – mgw
    Commented Apr 24 at 15:43
  • 1
    @ChrisDavies - weird - since we are not talking small companies' software stuff, one of them being MS... I've raised a ticket with the provider - let's see what they get back with... In the meantime: a manual fix is to manually put the first recipient's address (from the distribution list) enclosed in angle brackets. Apparently that solves the issue.
    – mgw
    Commented May 9 at 12:36
  • 1
    @ChrisDavies because it's a larger distribution list, avoiding it would be a real nuisance...
    – mgw
    Commented May 10 at 14:03
1

RFC 5322 is the current specification for Group Addresses. They are explained in Appendix A.1.3, where it writes,

From: Pete <[email protected]>
To: A Group:Ed Jones <[email protected]>,[email protected],John <[email protected]>;
[…]

In this message, the To: field has a single group recipient named "A Group", which contains 3 addresses […]

The address specification is formally defined in section 3.4, and from here I'm going to pick out only the relevant parts:

3.4. Address Specification

An address may either be an individual mailbox, or a group of mailboxes.

group           =   display-name ":" [group-list] ";" [CFWS]
group-list      =   mailbox-list / CFWS
mailbox-list    =   (mailbox *("," mailbox))
mailbox         =   name-addr / addr-spec
name-addr       =   [display-name] angle-addr
angle-addr      =   [CFWS] "<" addr-spec ">" [CFWS]

and

3.4.1. Addr-Spec Specification

An addr-spec is a specific Internet identifier that contains a locally interpreted string followed by the at-sign character ("@", ASCII value 64) followed by an Internet domain. […] Comments and folding white space SHOULD NOT be used around the "@" in the addr-spec.

addr-spec       =   local-part "@" domain
local-part      =   dot-atom / quoted-string
domain          =   dot-atom / domain-literal

and

3.2.3. Atom

dot-atom        =   [CFWS] dot-atom-text [CFWS]

I have omitted the obs-* entries here that exist in RFC 5322's formal specification as they reference obsolete patterns. CFWS indicates that comments and/or folding white-space are permitted.

Accordingly, both of these formats should be accepted by the definition of group-list:

A Group:Ed Jones <[email protected]>,[email protected],John <[email protected]>;
A Bare Group:[email protected],[email protected],[email protected];

Applying this interpretation to your own group list, I would say that what you have is valid:

To: organisation: [email protected], [email protected];

and, therefore, it is the recipient systems that are at fault. (Or an intermediate system with aggressive header rewriting. If you send your emails through firewall appliance or your clients receive them through one I'd be checking that.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .