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 b26e5db..dc2e577 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 89ac87f..f54124c 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);