https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43340

--- Comment #18 from Brendan Lawlor <[email protected]> ---
This is rad!

Works as described in the test plans. All tests pass. Also tested that the
tests fail without the patches.

Helpful testing notes:

1. ktd --smtp up -d
2. Mailpit web interface will be available at http://localhost:8025
3. In Admin > SMTP servers add a bogus server with port 9999
4. Add an email address to a patron and make sure they have message preferences
for email
5. Run perl misc/cronjobs/process_message_queue.pl -v
   - you should see a connection failure
6. check the message status in ktd --dbshell
   - SELECT message_id, status, send_attempts, retry_after, failure_code FROM
message_queue ORDER BY message_id DESC
   - you should see status pending, and retry_after is set in 10 minutes
7. Update the retry_after so you sojn't have to wait
   - UPDATE message_queue SET retry_after=NOW() WHERE status='pending'
8. Repeat steps 5-7 to similuate reseding the failed messages
   - you should see the backoff go up 30, 60, then 120 minutes
9. After the 5th attempt the message status will be failed and in the patron's
notice tab you'll see "Unhandled email failure"
7. From the notice on the patron record click Resend
8. Check the message status and confirm send_attempt was reset to 0
9. Change the SMTP server to port 1025 
10. Send some notices and see that they reach Mailpit at localhost:8025

You can simulate a run through of multiple attempts with 30 seconds between
each try like this. Try fixing the SMTP port while it's running to see a retry
attempt succeed.

for i in 1 2 3 4; do
  koha-mysql kohadev -e "UPDATE message_queue SET retry_after=NOW() WHERE
status='pending'"
  perl misc/cronjobs/process_message_queue.pl -v
  koha-mysql kohadev -e "SELECT message_id,status,send_attempts,retry_after
FROM message_queue"
  echo "--- run $i done, waiting 90s ---"
  sleep 30
done

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to