Re: [exim] autoreply once on multiple systems

Góra strony
Delete this message
Reply to this message
Autor: Cyborg
Data:  
Dla: exim-users
Temat: Re: [exim] autoreply once on multiple systems
Am 28.01.21 um 17:30 schrieb Kai Bojens via Exim-users:
> Hello everybody,
> is there an easy solution to share the autoreply "once" data between
> multiple hosts? The documenation mentions a file or a DBM database in
> which these can be stored. I'd like to set up multiple Exim hosts in
> order to spread the load with an identical configuration and don't
> want host B to also autoreply when host A has already sent the autoreply.
>
> Kai
>

In this case, you will need a central sql database that stores the
sender and receiver with a timestamp and if your acl finds an entry
within your given timeframe,
will need redirect the message to :blackhole:

To reduce the stress inside exim, I put that part in my autoresponder
script. But that's just a suggestion, exim will do fine on it's own.

First  you check if you have an old entry: I.E.

   drop     condition = ${if eq{${lookup mysql {SELECT '1' FROM
mail_responders WHERE sender=... and receiver=... and  ( date+86400 <
unix_timestamp(NOW()) )  LIMIT 1 }}}{1} {1}{0}}
               log_message = Responder database said, we should drop
this mail.

If the mail passes, you put it into the database, so the next message
will be dropped until ( in this example ) 24h have passed.

   warn    log_message   = logging "${quote_mysql:$authenticated_id}"
in with ip "$sender_host_address" ${lookup mysql {INSERT IGNORE INTO
mail_responders SET [[enter here what you need to identify sender and
receiver]],date=unix_timestamp(NOW())}}  ***

***) you can have an additional lockup to clean the database of old
entries. But you can also use a cronjob to clean the db periodically.

This is not an example you just copy & paste, as you need to make
modifications on the who sends to whom part and if it shall be droppend
at all, becaue it'a responder address. Means: you will need an
additional condition in each block to run it only if the receiver is an
autoresponder. ok?

And: This examples drops the incoming email, instead of redirecting it
to :blackhole: which "should" to the job too.

best regards,
Marius