E-mail group addresses such as undisclosed-recipients:; or a group:<u1@example.net>,<u@x.example.net>; are valid forms of addressing according to RFC 5322, see for instance the illustrative example in Appendix A.1.3. In Sendmail, this is called "list syntax". Minimal working example (for Bash):

echo "Date: $(date --rfc-2822)
From: <someone@example.net>
To: a group:<r1@example.net>,<r2@example.net>;
" | sendmail -t

However, trying to submit messages with empty groups leads to error List:; syntax illegal for recipient addresses. Minimal example:

echo "Date: $(date --rfc-2822)
From: <someone@example.net>
To: undisclosed-recipients:;
Bcc: someone-else@example.net
" | sendmail -t


undisclosed-recipients:;... List:; syntax illegal for recipient addresses

How can Sendmail be configured to support empty RFC 5322 group addresses when submitting messages via sendmail -t?

  • Why can't you specify recipients via command line?
    – AnFi
    Dec 16, 2015 at 21:41
  • @AndrzejA.Filip I could, it's just not the question here. Moreover, sendmail -t is the default for PHP mail() e.g. on *nix systems.
    – xebeche
    Dec 16, 2015 at 22:28
  • How would you like sendmail -t ... to process such addresses? a) ignore b) expand LOCAL mailing lists/aliases
    – AnFi
    Dec 18, 2015 at 11:12
  • If I am not mistaken foo:; is an empty group. It should be ignored just like (foo) or " ".
    – xebeche
    Dec 18, 2015 at 12:26

1 Answer 1


After looking at Sendmail's source code my conclusion is that in order to have Sendmail support (or rather ignore) empty groups properly a change of the source code is required.

Empty group addresses such as To: foo:; should simply be ignored just like To: (foo) or To: or '' (i.e. nothing). By debugging I found that this is not an issue with submit.cf. Cf rules are never applied to empty addresses. In parseaddr.c, parseaddr->prescan returns NULL for empty addresses, but not for :;. This can be shown by submitting messages to sendmail -t -d20.1.

Workarounds are:

(*) quoting the original author

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.