On 2022-11-21, Laura Williamson via Exim-users <exim-users@exim.org> wrote:
> Have a bit of an issue. When sending out emails out exim select an 
> interface like this
>
> interface = ${lookup sqlite {SQLITE_Q_USERINTERFACE select ip from 
> interface where active='Y' order by random() limit 1}{$value}}
> helo_data = ${lookup 
> dnsdb{ptr=$sending_ip_address}{$value}{$primary_hostname}}
>
> Which works perfectly fine, however, if the server we send to has 
> greylisting it will try again but every time it will select a new 
> interface IP and therefore might get greylisted again (as the IP now is 
> different), is there a way around this?

don't use random, use somethign repeatable instead eg:

   ${listextract{${eval:1+(${base62d:${substr_14_2:$message_exim_id}}%5)}}{\
    10.0.0.1:10.0.0.2:10.0.0.3:10.0.0.4:10.0.0.5}{$value}{10.0.0.1}}

Here the feactional-seconds part of $message_exim_id is used as a
repeatable pseudo-random number. the range is (0..499)

you can possibly use the sha1 function to get repeatable pseudo-random
values by salting the ip-address with the exim-id of the message.

 interface = ${lookup sqlite {SQLITE_Q_USERINTERFACE select ip from \
     interface where active='Y' \
     order by sha1(ip || '${quote_sqlite:$message_exim_id}' ) \
     limit 1}{$value}}

-- 
  Jasen.

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to