0

Let me start by saying that I'm not an IT guy, but I've been pressed into it in my office.

Someone at my office sent an 86MB e-mail attachment to someone at aol.com, and aol.com is rejecting the e-mail probably because it's too big. When I look at the logs I see "closed connection in response to sending data block" every 10-20minutes, I guess because exim4 is trying to keep resending it. This has been happening for 3 days and as you can guess it has used a lot of bandwidth.

Why didn't exim4 stop sending this e-mail after so many fail attempts?

What configuration option do I need to change to set the number of fail attempts for giving up with this kind of failure?

2
  • You may try to login to the server and as root run: exim -bp (it will show the message-id) to find the message from queue and remove it with exim -Mrm <message-id>.
    – Diamond
    Nov 20, 2015 at 22:27
  • I don't want to just remove the message from the queue, I also want to understand the problem better and also prevent it from happening again.
    – da66en
    Nov 20, 2015 at 22:41

2 Answers 2

1

First for the given error. As this type of smtp to smtp failure can happen due to a a number of network connection issues

  • firewall doing packet filtering
  • Any other security appliance, or
  • Anti-virus software
  • Or some other policy configured at the mail server

Most of the time, this failure can happen while the reciepient email server is stalled while processing the mail with unacceptable attachment size. After that, the recipient system stops accepting new SMTP data and after a predetermined time, the SMTP connection then times out.

To prevent it you need to adjust the default retry-rules.

  1. Default retry rule

The retry section of the configuration file contains rules which affect the way Exim retries deliveries that cannot be completed at the first attempt. It is introduced by the line

The exim default retry rule looks like this:

begin retry

In the default configuration, there is just one rule, which applies to all errors:

    • F,2h,15m; G,16h,1h,1.5; F,4d,6h

This causes any temporarily failing address to be retried every 15 minutes for 2 hours, then at intervals starting at one hour and increasing by a factor of 1.5 until 16 hours have passed, then every 6 hours up to 4 days. If an address is not delivered after 4 days of temporary failure, it is bounced.

If the retry section is removed from the configuration, or is empty (that is, if no retry rules are defined), Exim will not retry deliveries. This turns temporary errors into permanent errors.

You can adjust the values accordingly. Here is the official reference: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_default_configuration_file.html#SECID57

Here is a very good explanation too.

1

The root problem is that you have accepted a message for relay, and the recipient server has a problem accepting it. Normally, the reciptient server would say "550 message size too large" or something like that, and exim would not try again, but turn around and try to inform the sender that there was a problem with his 86-MB message by sending him a bounce message.

Here, that is not happening, there is an ill-defined problem handling the message, probably because it is so big. Usually the receiving server will use the ESMTP protocol which permits refusing messages above a certain size before they actually go over the wire, but AOL's servers do not seem to support that, so they try to accept it and fail badly for some reason that AOL server administrators may or may not understand.

Because Exim does not know what to do with this ill-defined problem, it will keep on trying to send the message for five days (default configuration). You have two options for stopping the nuisance before that: use exim -Mg $messageid which will send back a bounce to the sender, or exim -Mrm $messageid which will simply delete the message from your queue. I prefer the first one, except that the error message seems to read "cancelled by administrator", while I would prefer the "closed connection in response to sending data block" plus maybe "default timeout shortened by administrator".

To avoid it happening again, you should probably define a size limit on your server so that you don't accept messages that are so big that the recipient is likely to refuse. The parameter is called message_size_limit and may already be present in your configuration. Using exim's very complete configuration possibilities, you could probably define a limit only for mails to AOL, if you wish to. In the general case, 10 or 20 MB is usual.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .