mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
- test_rewrite_subject() is prone to failure when it checks for the delivered message, because fetch_all_messages() raises "ValueError: no messages in imap folder". The check has the potential to happen before the server has had a chance to deliver the message to the user's inbox. - Added a function try_n_times() that attempts to call a function the specified number of times, with a 1-second sleep between calls. The call is retried until it doesn't raise an exception. The last call is made without a 'try' block, so that the final exception passes through to the caller if it does not return. - Wrapped call to fetch_all_messages() in try_n_times(), with 5 attempts specified. This should usually allow enough time for the message to get moved from the postfix queue to the user's inbox.