) My server PHP max_execution_time is set to 300, which is 5 minutes
What about your web server? Did you check the logs? You'll see there the answer.
2) I am verifying batches of 50 emails with a 5 second pause between
It does not matter, some of the batches will finish faster than others because the verification will take less time
3) I have spoken to emaillistverify.com and gave them all of the they say that their systems can handle much more than we are pushing through
Sure, but this is not about volume, but about response time.
I can get to 400 emails in batches of 100 very easily, and I can do batches of 50 again very easily, but on occasions the whole thing hangs and the import process aborts
Yes, see my answer for #2
5) This also does not explain, especially as it would appear that this timeout is expected / usual behaviour, why the verification script process does not make allowance for this and accommodate instead of just importing the import process.
This is why we give you the ability to set the number of people you import in a batch. It is also why we offer cli import.
There's not much you can do in this case since the web server will cut you no matter what.
6) It also does not make sense why this has now happened with two different providers.
As I said, it is a metter of how fast they are able to proces sthe emails you throw at them VS the server timeouts. There's no black magic here, it's just the requests won't get into trouble if they stay under a certain amount of time.
If these 503 / 504 errors are expected, the import routines should handle the timeout gracefully and then restart that batch after having waited for a short period of time especially as this is an ajax request anyway and you wont have to handle a page reload. In the verification settings, the user should be able to specify (a) if the external service timesout, how long to wait to try that batch again and (b) how many times to retry before eventually giving up and aborting. This at least would prevent a perpetual loop.
I am sure we can improve in this area. I am going to look into it and see some ways to do retries. Thanks for pointing out.
Maybe try the import from command line and see if you have better luck?
If not, maybe for the time being, clean them externally, and in the next release, when #6 is going to be taken care of, this issue will go away.
Best.