Duplicate alerts from IMAP email trigger

I have IMAP integration configured to trigger a sensor whenever specific text is detected in the subject of a new email. This has been working for a while, but following a recent HA update it now sends duplicate alerts for each matching email. The alerts happen several minutes apart, and there can be 2 or 3 of them. Any idea why this might be? I’m running HA Core 2023.8.0
This is how I have the trigger defined:

template:
  - trigger:
      - platform: event
        event_type: "imap_content"
        event_data:
          sender: "[email protected]"
      - platform: event
        event_type: "imap_content"
        event_data:
          sender: "[email protected]"
      - platform: event
        event_type: "imap_content"
        event_data:
          sender: "[email protected]"
      - platform: event
        event_type: "imap_content"
        event_data:
          sender: "[email protected]"
    binary_sensor:
      - name: Parking Booking
        auto_off: "00:02:00"
        state: >
          {% set current = this.state|default('off', 1) %}
          {% if trigger.event.data['subject'] is match
          "You have a new booking|Booking received|JustPark booking|Booking request for My Road"
          %}
            true
          {% else %}
            {{ current }}
          {% endif %}