Re: [exim] Send mail to specific domains via smart host

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jasen Betts
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Send mail to specific domains via smart host
On 2019-03-06, Rory Campbell-Lange via Exim-users <exim-users@???> wrote:
> Hi
>
> Apologies for the naive question, but my Exim skills are now very rusty.
>
> We've been unexpectedly jumped onto a new ip address for our domain and
> we have a problem with the address being cold. Consequently we've got
> about 1000 yahoo and aol emails backed up over the last day or so.
>
> Our service provider has provided us with a backup relay which we can
> use, but we'd prefer to only send aol and yahoo emails through them.


> We're using a simple setup using Debian's packaged configurations which
> I guess we will need to tweak.


What you do is select split configuration, then you can insert
configuration without debian's config management messing with
it.

>     dns_yahoo_aol:
>       debug_print = "R: dnslookup_yahoo_aol for $local_part@$domain"
>       driver = dnslookup
>       domains = aol.com : yahoo.com
>       transport = remote_smtp_smarthost
>       route_list = mx.localrelay.com byname
>       same_domain_copy_routing = yes


yahoo are tricky, they cover many domains, but I guess if you
redirect the bulk theough your provider the remainder can pass viar
direct smtp and be under the rate-limit.

If I wanted to gatch more yahoo traffic I'd leave the domains restriction
off and used an inverted ignore_target_hosts list with the IP addresses
of the yahoo and aol MXs

I's create a file called

/etc/exim4/conf.d/routers/175_local_yahoo_warmup

with

NOT_YAHOO_MXEN= !98.137.159.0/24 : !66.218.85/24 : !67.195.229.0/24 : !74.6.137/24

       dns_yahoo_aol:
         debug_print = "R: dnslookup_yahoo_aol for $local_part@$domain"
         driver = dnslookup
     ignore_target_hosts = NOT_YAHOO_MXEN
         transport = remote_smtp_smarthost
         route_list = * mx.localrelay.com byname
         same_domain_copy_routing =


then re-run sudo dpkg exim4-config and choose "split configuration" (into
many small files)

> The normal Debian exim4 config has
>
>     route_list = * DCsmarthost byname
>     and
>     host_find_failed = ignore

>
> but I don't know if those are worth retaining.


"DCsmarthost" only works if you chose smarthost in the first
exim4-config setup menu, but you chose internet site (which seems the
correct setting) so it'd be harmful here.

> Comments gratefully received.


adding this to the router

    conditon = ${if or{{<{67}{${randint:100}}}\
     {!first_delivery}}}


Will leak 33% of the first delivery attempts though to the direct smtp
delivery router, allowing you to warm up with yahoo, but if yahoo then
rejcts them the retries will go through the smarthost router.

That will produce some traffic from your IP address allowing warm-up

If you want to get tricky you could make an expressiogn using
$tod_epoch that tapers off the percentage over time.

this will taper it off over 40 days

   conditon = ${if or{{>{$tod_epoch}\
      {${eval:1555539108+${randint:${eval:24*60*60*40}}}
      \}}{!first_delivery}}}

    
I computed the constant "1555539108" by

/usr/sbin/exim -be '${eval:24*3600*40+$tod_epoch}'

--
When I tried casting out nines I made a hash of it.