Hi,
Under Exim 4.10, I have configured a transport_filter to chop messages
up into 1Kb lines. This is to work around a problem on one of our mail
servers dropping the connection if it receives a message with a line
greater than 1024 characters, which that causes Exim to delay delivery
to that host until the retry time is reached. Hotmail in particular
seems to be a good source of messages containing long lines.
The transport filter has decreased the average queue size from 2000
messages to 600-800 messages, however I have been getting the following
error in the logs (where whoever@??? is a valid
user) and messages being left in the queue:
2002-12-09 13:56:57 18LEUv-0007lr-00 == whoever@???
R=filtereddnslookup T=filtered_remote_smtp defer (88): Socket operation
on non-socket: send() to coolabah.services.adelaide.edu.au
[129.127.43.14] failed
A few messages get through before each error. There does not seem to be
anything special about the line lengths in the messages that are getting
through or the ones that are not.
Has anybody seen this behaviour before, or does anybody have a better
solution for dealing with line length limitations?
The filter is configured as:
filtereddnslookup:
driver = dnslookup
domains = +student_domains
transport = filtered_remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 10.0.0.0/8 :
172.16.0.0/12 : 192.168.0.0/16
no_more
...
filtered_remote_smtp:
transport_filter = /usr/local/bin/split-long-lines.pl
driver = smtp
And the script /usr/local/bin/split-long-lines.pl reads:
#!/usr/bin/perl -W
while(<>)
{
# Split header lines on commas and spaces if possible
while (s/^([a-z\-]+)\:
+([^\:]{900,1000}?[^\s\,\:])[\s\,]+([^:]*)$/$1: $2\n$1: $3/img)
{
}
# Forcefully split header lines if they are still long
while (s/^([a-z\-]+)\: +([^\:]{500,})([^\:]{500,})/$1: $2\n$1:
$3/img)
{
}
# Split other lines
while (s/(.{1000})(.+)/$1\n$2/g)
{
}
print;
}
--
Sean Burford
Systems Specialist
Adelaide University