E-mail group addresses such as undisclosed-recipients:;
or a group:<[email protected]>,<[email protected]>;
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: <[email protected]>
To: a group:<[email protected]>,<[email protected]>;
" | 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: <[email protected]>
To: undisclosed-recipients:;
Bcc: [email protected]
" | sendmail -t
returns
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
?
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 likeTo: (foo)
orTo:
or''
(i.e. nothing). By debugging I found that this is not an issue withsubmit.cf
. Cf rules are never applied to empty addresses. Inparseaddr.c
,parseaddr->prescan
returns NULL for empty addresses, but not for:;
. This can be shown by submitting messages tosendmail -t -d20.1
.Workarounds are:
(foo)
instead offoo:;
(*) quoting the original author