Re: [exim] Need help with hold messages send to specified e-…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Chris Siebenmann
Date:  
À: Jord van der Wielen
CC: Exim-users, cks
Sujet: Re: [exim] Need help with hold messages send to specified e-mail address in queue for XX minutes
| I am looking for a solution to check when there is a mail send to a
| specific email recipient (example test@???) in the mail queue and
| holds all these messages for a XX minutes before it sends the messages
| and also sends a copy of the email to an other email address.
|
| Is this possible? And is it also possible to set up a kind of schedule for
| only these messages?
|
| Like:
|
| >From Monday € Friday € between 17:30 and 07:00 hour hold messages from this
| recipient in this time window and after that send them all.


You can do both of these with routers that defer the messages if
certain conditions are met, for example they are to specific addresses
and it's within a certain time. The one thing you should be very careful
about is message timeouts and retry timing; you don't want a message to
expire while you're defering it this way.

Writing out the specific conditions you need will take some exploring
in the Exim documentation about string expansions, ${if} conditions, and
so on. Alternately you can do the brute force solution: simply have a
file of addresses that are unconditionally deferred, then have a cron
job that puts specific addresses in the file at 17:30 and then removes
them at 07:00 (and probably starts a queue run on the spot).

A general defer-addresses-in-file router is:

defer_any:
        debug_print = "R: defer_any for $local_part@$domain"
        driver = redirect
        allow_defer
        data = :defer:delivery temporarily stalled.
        no_verify
        no_expn
        condition = ${if match_address{$local_part@$domain}{/etc/exim4/exim-defer-addrs}}


(Note that this deliberately allows wildcards, so that we can for example
list '*@*' to defer *all* email.)

This router should be before any real router that can actually deliver
to things.

    - cks