Closed merlinschumacher closed 4 months ago
Thanks for submitting this. This feature is really interesting.
Rather than having a separate expression for these use cases, I wondered if we could expose a general function in the scripting engine that would apply to all the existing expressions. I guess this function would be called delay()
and would accept the delay in seconds. Result would be true
so the existing logic will accept the recipient/message or so it can be chained with another condition.
Then it could be used in the existing recient expression as such:
recipient == "rob@rnwood.co.uk" && delay(1000)
What do you think?
Thanks for the inspiration to add this feature. I've taken a different approach of exposing various functions in all the existing expresssion. See #1483.
Hi,
this PR adds two new options to smtp4dev: RecipientDelayExpression and MessageDelayExpression. These expressions can be used to create an artificial delay when adding a recipient or adding a message. We want to use this feature to create failure situations for mail related software. This way, we can simulate a slow or misbehaving mail server better and check if our handling of delays and timeouts is proper and reliable. If you want any changes or have a different idea how to implement this, just let me know.