Steven Brown wrote:

It appears as though the local server waits for the SMTP commands to finish
before it returns a result to CURL, whereas directly accessing my bootstrap
allows the SMTP commands to run in the background almost as a separate
thread.

i doubt there are any separate threads here. the basic issue is that smtp commands finishing != message delivered to intended recipients mailbox.

usually, smtp commands finishing in php code just means the mail server has accepted the message into its queue. so:

time a: smtp commands finish in php code
time a + n: pop commands run
time a + N: message gets to user mailbox

if n is greater than N, then your tests will run ok. if not, then they wont.

N is not dependent on your scripts or tests, but on an external process - the mail server.

so, the simplest thing to do is to make n larger by putting a sleep call in before you run the pop checks.

another less simple approach is to use mock objects to represents the mail process.

make sense?

Cheers,
Steven

cheers
justin

Reply via email to