Page 1 of 1

Infinite Loop?

PostPosted: Tue Sep 14, 2021 1:21 pm
by HFTobeason
I'm not 100% sure what's going on here, but it seems that, if Email+ is configured to send "Informational Messages", and an error occurs so that an email is sent via Email+, if there's an error in the email itself, I get an infinite loop where Email+'s attempt to send an email generates an error which in turn triggers Email+ to send an error email, ad infinitum... At least I think this is what's happening... This is a snippet of the last few iterations as I disabled the plugin:

Code: Select all
   Email+ Error                    Email+ Fastmail SMTP: SMTP server connection error: (554, '5.5.1 Error: no valid recipients')
   Trigger                         Indigo Error
   Email+                          sending email '[Indigo] Error' to 'HFTobeason@icloud.com' using Email+ Fastmail SMTP
   Email+                          sending email '[Indigo]' to '' using Email+ Fastmail SMTP
   Email+ Error                    Email+ Fastmail SMTP: SMTP server connection error: (554, '5.5.1 Error: no valid recipients')
   Trigger                         Indigo Error
   Email+                          sending email '[Indigo] Error' to 'HFTobeason@icloud.com' using Email+ Fastmail SMTP
   Email+                          sending email '[Indigo]' to '' using Email+ Fastmail SMTP
   Email+ Error                    Email+ Fastmail SMTP: SMTP server connection error: (554, '5.5.1 Error: no valid recipients')
   Trigger                         Indigo Error
   Email+                          sending email '[Indigo] Error' to 'HFTobeason@icloud.com' using Email+ Fastmail SMTP
   Email+                          sending email '[Indigo]' to '' using Email+ Fastmail SMTP
   Email+ Error                    Email+ Fastmail SMTP: SMTP server connection error: (554, '5.5.1 Error: no valid recipients')
   Trigger                         Indigo Error
   Email+                          sending email '[Indigo] Error' to 'HFTobeason@icloud.com' using Email+ Fastmail SMTP
   Email+                          sending email '[Indigo]' to '' using Email+ Fastmail SMTP
   Email+ Error                    Email+ Fastmail SMTP: SMTP server connection error: (554, '5.5.1 Error: no valid recipients')
   Trigger                         Indigo Error
   Email+                          sending email '[Indigo] Error' to 'HFTobeason@icloud.com' using Email+ Fastmail SMTP
   Email+                          sending email '[Indigo]' to '' using Email+ Fastmail SMTP
   Email+ Error                    Email+ Fastmail SMTP: SMTP server connection error: (554, '5.5.1 Error: no valid recipients')
   Trigger                         Indigo Error
   Email+                          sending email '[Indigo] Error' to 'HFTobeason@icloud.com' using Email+ Fastmail SMTP
   Warning                         process (pid 98306) failed to quit after polite request -- forcing it to quit now
   Stopped plugin "Email+ 2021.1.1"

Indigo 2021.1.1

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 1:36 pm
by FlyingDiver
Yeah, that's certainly possible. You need to put a condition in that Trigger that doesn't send email if it's an email error. ;)

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 1:44 pm
by HFTobeason
Thank you for your reply. Any suggestions as to how one might accomplish that? I don't see anything obvious to a non-programmer type...

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 1:44 pm
by FlyingDiver
How is that trigger defined in the first place?

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 2:46 pm
by HFTobeason
See attached screenshots.

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 3:11 pm
by matt (support)
The easiest technique, but not 100% guaranteed to work, would be to add an additional Action to that Trigger of type Server Actions->Enable/Disable/Reload Actions->Disable Trigger then select the Trigger itself as the target to be disabled. Lastly, turn on the Auto-enable after checkbox with a value of around 10 seconds.

The last part is where it is a bit fuzzy. If you disable the Trigger for too long it might miss other valid errors, and if you set it too short it might get re-enabled before the action has had time to send out the email and you'll hit the infinite loop again.

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 3:31 pm
by jay (support)
The root problem seems to be that somehow a send action was created without any recipients. We should validate that not only when the action is saved in the UI but also before the message is added to the queue (which would cover the case of scripting the email send). I've added a todo to look into these issues to see if we can better deal with situations like this.

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 3:46 pm
by FlyingDiver
First thing to do is get that out of the queue. Restarting the Email+ plugin should do it. Then make sure all your actions have valid email recipients in them.

Re: Infinite Loop?

PostPosted: Tue Sep 14, 2021 4:22 pm
by HFTobeason
I traced the root of the problem to a spurious "send email" action in a trigger. Somehow that action must have had nothing filled in re recipient, etc. I just tried to create a send email action with absolutely nothing entered in the email form, and Indigo allowed it - which seems kinda dangerous...per Jay's comment above. Anyway, I traced back all the times the infinite error loop started over the last few weeks, and they were all launched by the same action trigger - which I've now fixed.