This is a logic error in the code.
It basically means that as long as the time since last e-mail is at least the configurable amount of time between two e-mails, it will try to send again.
This is incorrect behavior. It needs another conditional via && to represent whether or not the $timeDiffSinceLastMail is at least an hour, since we are in throttle mode by this point.
Hmmm. Whether the hosting provider resets at the top of the hour or on a rolling 60-minutes will vary. Always waiting 60-minutes would be the safest posture for all hosting providers, even though it may result in slower sending for some providers (if they reset at top of hour).
My hosting provider appears to operate on a rolling 60-minute window.
if(($timeDiffSinceLastMail >= $waitBetweenTwoMails) || ($timeDiffSinceLastMail < 0) || ($lastMailSentAt < 0)){
$log->debug('"Wait between Two Mails" Throttling -> Time diff since last mail is '.$timeDiffSinceLastMail.' seconds, enough, therefore proceed...');
One thing I cannot explain after working around the null $lastMailSentAt is how would setting $lastMailSentAt to time() and then subtracting time() from time() yield such a high number? Should be 0 or close to 0. :-/
Referring to these logs:
2020-12-01 17:36:08 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844168 seconds, enough, therefore proceed...
2020-12-01 17:36:08 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:08 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844168 seconds, enough, therefore proceed...
2020-12-01 17:36:09 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:09 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844169 seconds, enough, therefore proceed...
2020-12-01 17:36:09 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:09 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844169 seconds, enough, therefore proceed...
2020-12-01 17:36:10 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:10 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844170 seconds, enough, therefore proceed...
2020-12-01 17:36:10 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:10 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844170 seconds, enough, therefore proceed...
2020-12-01 17:36:11 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:11 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844171 seconds, enough, therefore proceed...
2020-12-01 17:36:11 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:11 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844171 seconds, enough, therefore proceed...
2020-12-01 17:36:11 DEBU "Wait between Two Mails" Throttling Active, setting: 10 seconds
2020-12-01 17:36:11 DEBU "Wait between Two Mails" Throttling -> Time diff since last mail is 1606844171 seconds, enough, therefore proceed...
Also, notice that it isn’t really waiting 10 seconds. FAKE NEWS. ??