Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many recipients result in an unfolded To: header that is too long #109

Open
martinvonwittich opened this issue Feb 27, 2025 · 0 comments

Comments

@martinvonwittich
Copy link

martinvonwittich commented Feb 27, 2025

I'm using swaks to validate an Exim configuration that should reject outgoing mails with more than 50 recipients:

swaks --from [email protected]  --to $(print -l recipient+{1..50}@example.com | paste -sd,) --server my.local.exim.instance --tls-on-connect -a LOGIN -au [email protected] -ap nopass

In this case the email was supposed to pass because 50 recipients is below the limit, but Exim instead froze the message with the following error:

my.local.exim.instance ~ # exigrep 1tnejz-001VBJ-19 /var/log/exim4/mainlog
+++ 1tnejz-001VBJ-19 has not completed +++
2025-02-27 15:19:55 1tnejz-001VBJ-19 <= <> R=1tnejy-001VAF-1J U=Debian-exim P=local S=15054
2025-02-27 15:19:55 1tnejz-001VBJ-19 ** [email protected] R=local_user T=dovecot_lmtp: message has lines too long for transport
2025-02-27 15:19:55 1tnejz-001VBJ-19 Frozen (delivery error message)

The problem seems to be that the To: header that swaks generated from the list of the recipients isn't folded:

It therefore has a length of 1244 characters, which is longer than RFC5322 allows:

There are two limits that this specification places on the number of
characters in a line. Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.

I was able to work around the issue by manually overwriting the To: header with --header 'To: [email protected]'.

The swaks version I'm using is the one provided by Debian stable (bookworm):

my.local.exim.instance ~ # lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm
my.local.exim.instance ~ # swaks --version
swaks version 20201014.0
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant