Re: [exim] reusing existing smtp connections

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: Patrick Cernko
CC: exim-users
Subject: Re: [exim] reusing existing smtp connections
On 2017-01-20 at 16:52 +0100, Patrick Cernko wrote:
> When a mail is sent over this list, exim creates a new smtp connection
> for every mail it gets from mailman.


What you want to do is have Exim "queue" the file instead of attempt an
immediate delivery, and do a two-stage routing pass where in the first
stage it goes over every message figuring out what should go where.
This populates the wait hints databases, so on the second pass the Exim
delivery process can check for "what other mails need to go here" and
grab those.

Easiest way to use two-stage queue runners is to use "-qq" instead of
"-q" on the command-line. Eg, `exim -bd -qq2m` (what I run with).

Myself, on my personal server, my main section has:

    queue_smtp_domains = lsearch;RUNCONFDIR/smtp_queue


where that file contains a list of domains which are always queued; you
might just put the big domains in that; with -qq2m you'll delay all
mails to those domains by up to two minutes. That gets you out of
immediate trouble and lets you figure out which way to go next.

Simpler but less effective would be to use the queueing options; if
you're not comfortable writing ACLs yet then this might be for you.

There are a whole bunch of queuing options in The Exim Specification;
you should be able to find some tuning options to help you find a better
balance.

* 14.10 Resource control
* Search for "queue" under
https://www.exim.org/exim-html-current/doc/html/spec_html/ch-main_configuration.html#SECTalomo
+ 14.21 Routing and delivery


More effective: change one of the ACLs (acl_smtp_mail or somesuch) to
have a step which:

 1. Checks if the mail is sent from the local host (whichever IP applies
    for mailman).
 2. Checks via `senders` if the address looks like a mailman message,
    pattern-matching on -bounces- or whatever it is that appears.
 3. Apply `control = queue_only` to matching messages.


This is the most effective, since it's an exact match, but takes a
little more experience.

-Phil