Exim smarthost do not split emails

Al Gilson

Member
Oct 15, 2015
10
0
1
Canada
cPanel Access Level
Root Administrator
Howdy,

Running cPanel v68.0.36.

We pass all of our outbound Exim email to a smarthost for auditing reasons. The smarthost logs the from and to addresses for legal reasons and then delivers the email.

What we're seeing:
Example 1: If user Tim sends an email TO:[email protected] and CC:[email protected], the system works as it should. One email is sent with 2 recipients.

Example 2: If we change that up and user Tim sends an email TO:[email protected] as well as CC:[email protected], Exim is sending two emails two 1 recipient each.

Is it possible to have Exim simply pass the email Example 2 as one email as in Example 1? We do not want the multi-domain email split in to multiple emails. Office 365 relays multi-domain emails through our smarthost as one email. I could have a message with 60 different recipient email domains coming from O365 and our relay server sees 1 email with 60 recipients and handles it accordingly. With cPanel, using that same example, we'd have 60 emails show up with 1 recipient each. [Side note: gmail also handles this the same way as cPanel].

This is a big deal from the standpoint that Aunt Mabel sends 10x high-res pics of the grandkids to the extended family, and now we're receiving 60x the bandwidth that we should be. Outbound bandwidth is the same.

Help?

Thanks,

- Al
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,219
463
Hello @Al Gilson,

Here's an Exim document with some background information about how this works:

25. Address batching in local transports

In particular, note the following section:

The batch_max option specifies the maximum number of addresses that can be delivered together in a single run of the transport. Its default value is one (no batching). When more than one address is routed to a transport that has abatch_max value greater than one, the addresses are delivered in a batch (that is, in a single run of the transport with multiple recipients), subject to certain conditions:
  • If any of the transport’s options contain a reference to $local_part, no batching is possible.

  • If any of the transport’s options contain a reference to $domain, only addresses with the same domain are batched.

  • If batch_id is set, it is expanded for each address, and only those addresses with the same expanded value are batched. This allows you to specify customized batching conditions. Failure of the expansion for any reason, including forced failure, disables batching, but it does not stop the delivery from taking place.

  • Batched addresses must also have the same errors address (where to send delivery errors), the same header additions and removals, the same user and group for the transport, and if a host list is present, the first host must be the same.
Help with the specific modifications you'd need to make to the default Exim transport configuration is outside the scope of support we can offer, but you are welcome to look into customizing it by consulting with the Exim User's mailing list or a qualified system administrator:

Mailing lists for Exim
System Administration Services | cPanel Forums

Thank you.
 
  • Like
Reactions: Al Gilson

Al Gilson

Member
Oct 15, 2015
10
0
1
Canada
cPanel Access Level
Root Administrator
Hello @Al Gilson,

Here's an Exim document with some background information about how this works:

25. Address batching in local transports

[snip]
Thanks Michael.

A fantastic Exim expert gave me this nugget:
Code:
Have you tried different queue-runner options, e.g. setting queue_only

and running the queue in a two-stage process (-qq Option).
The -qq option gives me:
Code:
An option starting with -qq requests a two-stage queue run. In the first stage, the queue is scanned as if the queue_smtp_domains option matched every domain. Addresses are routed, local deliveries happen, but no remote transports are run.

The hints database that remembers which messages are waiting for specific hosts is updated, as if delivery to those hosts had been deferred. After this is complete, a second, normal queue scan happens, with routing and delivery taking place as normal. Messages that are routed to the same host should mostly be delivered down a single SMTP connection because of the hints that were set up during the first queue scan. This option may be useful for hosts that are connected to the Internet intermittently.
which sounds like it'll do what I need it to do. The question I now have is, how do I feed a command line option to Exim through WHM Exim config?

Thanks,

- Al
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,219
463
Hello @Al Gilson,

Generally, any supported advanced Exim configuration changes will be made through "WHM >> Exim Configuration Manager >> Advanced Editor". However, you can sometimes alter how the service starts or runs by altering the /etc/sysconfig/exim file (assuming you are using CentOS 7). Here's a third-party URL where the use of that file is referenced:

Setting up for Exim

Thank you.