Solved message has lines too long for transport

Digital Essence

Verified User
Joined
Jan 9, 2023
Messages
21
Hi,

I'm seeing emails bounced back with the error: "message has lines too long for transport".

I've looked through this thread: https://forum.directadmin.com/threads/exim-4-95.64666/page-3 and the fix appears to be to edit the /etc/exim/conf and up the limit from 998.

But my message_linelength_limit is already set to 52428800.
I am running Config Server MailScanner Front End if that has any bearing on this.

Thanks.


Bash:
#COMMENT#61:
remote_smtp:
  driver = smtp
  message_linelength_limit = 52428800
  headers_add = "${if def:authenticated_id{X-Authenticated-Id: ${authenticated_id}}}"
  interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}}
  helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
  hosts_try_chunking =
  hosts_try_fastopen =
.include_if_exists /etc/exim.dkim.conf

remote_smtp_forward_transport:
  driver = smtp
  message_linelength_limit = 52428800
  headers_add = "${if def:authenticated_id{X-Authenticated-Id: ${authenticated_id}}}"
  interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$original_domain}lsearch*{/etc/virtual/domainips}}}}
  helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
  hosts_try_chunking =
  hosts_try_fastopen =
  max_rcpt = 1
  return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}
.include_if_exists /etc/exim.dkim.conf
 
Hi Digital Essence,

i never see this issue whit Config Server MailScanner Front End

ther is some setting (rule) for message size (I never used it)

pls chececk this file /usr/mailscanner/etc/Mailscanner.conf

defaul setting should be this Maximum Message size = %rules-dir%/max.message.size.rules

and the rule setting in /usr/mailscanner/etc/rules/max.message.size.rules

if you dont want use rule just


Code:
Maximum Message size = %rules-dir%/max.message.size.rules

replace

Maximum Message size = 0     "0 = no limit of the the massage size"


restart mailscanner

Regards.
 
I think this is Exim not MailScanner.
Not by default imho because (as you already discovered) this is alreaty fixed in the exim.conf file and you're the only one with the issue right now it seems.
But you could test by temporarily disable mailscanner maybe.

Do you by any chance created an /etc/exim.variables.conf.custom or /etc/exim.strings.conf.custom file by any chance?
 
look like you have custom exim route


try put config in "/etc/exim.routers.pre.conf", if exists

be like this
Code:
smart_route:
    driver = manualroute
     message_linelength_limit = 52428800
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8
    condition = "${perl{check_limits}}"
 
Not by default imho because (as you already discovered) this is alreaty fixed in the exim.conf file and you're the only one with the issue right now it seems.
But you could test by temporarily disable mailscanner maybe.

Do you by any chance created an /etc/exim.variables.conf.custom or /etc/exim.strings.conf.custom file by any chance?

Hi Richard,

I've tested by disabling MailScanner and having mail managed by Exim and the issue occured again so [I think] that rules out MailScanner.

I don't have an /etc/exim.variables.conf.custom but do have a /etc/exim.strings.conf.custom and this contains:

Code:
cat exim.strings.conf.custom
RBL_DNS_LIST==cbl.abuseat.org : bl.spamcop.net : b.barracudacentral.org


look like you have custom exim route


try put config in "/etc/exim.routers.pre.conf", if exists

be like this
Code:
smart_route:
    driver = manualroute
     message_linelength_limit = 52428800
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8
    condition = "${perl{check_limits}}"


Hi jamgames.
I added message_linelength_limit = 52428800 to my /etc/exim.routers.pre.conf file and restarted Exim but it stopped accepting mail and my Outlook client received a certificate error when trying to send email.

My file looked like this:

Code:
smart_route:
  driver = manualroute
  message_linelength_limit = 52428800
  domains = ! +local_domains
  ignore_target_hosts = 127.0.0.0/8
  condition = "${perl{check_limits}}"
  #use auth_relay if you do need to set the remote smtpauth
  transport = auth_relay
  route_list = * smtp.mailchannels.net::25
  no_more

thanks for the assistance.
 
@Digital Essence
try put it into "/etc/exim.transports.pre.conf"


Code:
auth_relay:
  driver = smtp
  message_linelength_limit = 52428800

I custom in my server too, but somehow I misconfig due it long time ago to config this setting.

Thanks, I will give this a go.
As I'm a bit noddy at this. Will I have to custom rebuild Exim after making the change?
 
very good tutorial i hope this will help have the same problems put this into trasnports.pre.conf :)
 
Back
Top