Message has lines too long for transport

Some accounts are receiving this message when sending email.

Any configuration that solves it?

That message comes from Outlook? Maybe your users should configure the client to wrap the lines to avoid so long lines.

I wouldn’t do it but maybe you could try to define variable IGNORE_SMTP_LINE_LENGTH_LIMIT in your exim conf /etc/exim4/exim4.conf.template.

IGNORE_SMTP_LINE_LENGTH_LIMIT=1

ok
thanks I will follow your advice and tell the users to configure outlook

1 Like

I finally decided to implement IGNORE_SMTP_LINE_LENGTH_LIMIT=1 but it doesn’t work. the error keeps appearing.

/etc/exim4/exim4.conf.template

######################################################################
#                                                                    #
#          Exim configuration file for Hestia Control Panel          #
#                                                                    #
######################################################################

SPAMASSASSIN = yes
SPAM_SCORE = 50
SPAM_REJECT_SCORE = 100
CLAMD = yes
IGNORE_SMTP_LINE_LENGTH_LIMIT=1

Hello @GabrielPL,

Keep the line IGNORE_SMTP_LINE_LENGTH_LIMIT=1 in exim4 conf and in that config file /etc/exim4/exim4.conf.template, find remote_smtp: section inside TRANSPORTS.

######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################
begin transports

smtp_relay_smtp:
  driver = smtp
  hosts_require_auth = $host_address
  hosts_require_tls = $host_address

remote_smtp: <<--- this is the section we will modify
  driver = smtp
  helo_data = ${lookup dnsdb{>: defer_never,ptr=$sending_ip_address}{${listextract{1}{$value}}}{$primary_hostname}}
  dkim_domain = DKIM_DOMAIN
  dkim_selector = mail
  dkim_private_key = DKIM_PRIVATE_KEY
  dkim_canon = relaxed
  dkim_strict = 0
  hosts_try_fastopen = !*.l.google.com
  interface = ${if exists{OUTGOING_IP}{${readfile{OUTGOING_IP}}}}

And add this to the remote_smtp: section:

  .ifdef IGNORE_SMTP_LINE_LENGTH_LIMIT
    message_linelength_limit = 1G
  .endif

So remote_smtp: section will look like this:

remote_smtp:
  driver = smtp
  helo_data = ${lookup dnsdb{>: defer_never,ptr=$sending_ip_address}{${listextract{1}{$value}}}{$primary_hostname}}
  dkim_domain = DKIM_DOMAIN
  dkim_selector = mail
  dkim_private_key = DKIM_PRIVATE_KEY
  dkim_canon = relaxed
  dkim_strict = 0
  hosts_try_fastopen = !*.l.google.com
  interface = ${if exists{OUTGOING_IP}{${readfile{OUTGOING_IP}}}}
  .ifdef IGNORE_SMTP_LINE_LENGTH_LIMIT
    message_linelength_limit = 1G
  .endif

Restart exim4 and try again.

systemctl restart exim4

Cheers,
sahsanu

2 Likes

thanks, It works perfect

1 Like

Will this be fixed in the repo? I ran across this also, and it looks like it is ongoing.

I think nothing should be “fixed” because allowing those long lines you are breaking RFC5322 section 2.1.1.

If you as the admin of mail server want to modify exim to break the RFC go ahead :wink: but I don’t think Hestia should modify it.

Thanks for that info @sahsanu Super helpful!

Is line length limit something that mail clients usually take care of?

I think the message that wasn’t sending was generated by the system and one line was too long.

Is there a filter I can run my system emails through that limits the line length?

Thanks!

Yes, some clients like for example outlook, doesn’t care about the lines limit by default but it has an option to wrap long lines.

I don’t how your mails are sent so no tip here.

Thank you @sahsanu .

I just meant a way to filter linux/cron system generated emails that might produce a line that is too long. I created a quick filter on the command stdout that created the long line and did not use the exim cfg hack.

I really appreciate learning about this detail! Thanks for the info!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.