[exim] Re: event_action and "retry timeout exceeded"

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Viktor Ustiuhov
Dátum:  
Címzett: Jasen Betts via Exim-users
Tárgy: [exim] Re: event_action and "retry timeout exceeded"
Jasen Betts via Exim-users wrote on 16.06.2024 0:59:
> On 2024-06-15, Viktor Ustiuhov via Exim-users <exim-users@???> wrote:
>> Hello.
>>
>> Please tell me how can I log "retry timeout exceeded" using event_action?
>>
>> I don't see any difference in the event for successful delivery of
>> messages and for "retry timeout exceeded". In both cases, the value of
>> $event_name is msg:complete and the value of $event_data is undefined.
>
> msg complete is the wrong place to check for that, because messages
> can have multiple recipients.


I don't see any other suitable places.


> unfortunatley stock exim doesn't
> provide an event for this.


I have already done everything using stock features.

I save info about all successful, failed and deferred deliveries into
DB. When the msg:complete event fires, I check which events fired for
each recipient. If only msg:rcpt:host:defer or msg:rcpt:defer events
were fired for the recipient and no msg:delivery or msg:fail:delivery
events were fired, I consider it to be "retry timeout exceeded".


> I modify retry.c to get that capability.
>
>
> $  diff -C10   original/retry.c  patched/retry.c 
> *** original/retry.c    2023-11-05 01:55:49.000000000 +1300
> --- patched/retry.c    2024-06-16 09:51:15.934608692 +1200
> ***************
> *** 894,913 ****
> --- 894,917 ----
>           : US"retry timeout exceeded";
>             addr->user_message = addr->user_message
>           ? string_sprintf("%s: retry timeout exceeded", addr->user_message)
>           : US"retry timeout exceeded";
>             log_write(0, LOG_MAIN, "** %s%s%s%s: retry timeout exceeded",
>               addr->address,
>               addr->parent ? US" <" : US"",
>               addr->parent ? addr->parent->address : US"",
>               addr->parent ? US">" : US"");

>
> + #ifndef DISABLE_EVENT     
> +           msg_event_raise(US"msg:rcpt:retry:timeout",addr);
> + #endif
> + 
>             if (addr == endaddr) break;
>             }

>
>           continue;                       /* Restart from changed *paddr */
>           }

>
>         /* This address is to remain on the defer chain. If it has a "first"
>         pointer, save the pointer to it in case we want to fail the set of
>         addresses when we get to the first one. */


Thank you.


> If you choose to open a bug request for this feature you can attach
> the above as a patch.


I haven't decided yet what other events I'm missing. Judging by your
patch, it's not difficult to add new events yourself. This is enough for
me for now.

Thanks again.


--
Best wishes Viktor Ustiuhov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/