Events: avoid evaluating intermediates for unneeded events
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 4 Jun 2019 13:18:59 +0000 (14:18 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 4 Jun 2019 13:18:59 +0000 (14:18 +0100)
src/src/deliver.c
src/src/queue.c

index b26e5dbd407a778ac0e57595e04bb70b12e0aef3..dc2e577dd33ca34b9e0b55b00999cdc5c67b1e64 100644 (file)
@@ -6244,7 +6244,7 @@ if (process_recipients != RECIP_IGNORE)
         }
 
 #ifndef DISABLE_EVENT
-      if (process_recipients != RECIP_ACCEPT)
+      if (process_recipients != RECIP_ACCEPT && event_action)
        {
        uschar * save_local =  deliver_localpart;
        const uschar * save_domain = deliver_domain;
index 89ac87f94f02ba710868f157c6be9d4f2ef53598..f54124c5e901c46d6c9f88549728946fbe8b7e37 100644 (file)
@@ -1252,7 +1252,7 @@ switch(action)
     if (removed)
       {
 #ifndef DISABLE_EVENT
-      for (int i = 0; i < recipients_count; i++)
+      if (event_action) for (int i = 0; i < recipients_count; i++)
        {
        tree_node *delivered =
          tree_search(tree_nonrecipients, recipients_list[i].address);