Support Mailroom postback retry attempt

Extracted from gitlab-org/gitlab!76724 (comment 776646492)

In #1457 (closed), we are moving away from pushing mail content directly into Redis to using webhooks. Underlying, the mailroom subsystem uses mailroom gem and its postback strategy. This strategy triggers post requests to the configured endpoints. If the endpoints reject the email for any reason, the emails are dropped. This behavior is not reliable in long run. Unlike other strategies - like Redis, the HTTP stack is way complicated, with a lot of hops and potential issues.

One good way to improve the reliability of this postback strategy is to add retrying mechanism. Retrying seems to be a reasonable solution. The supported email actions at GitLab, such as new note, new issue, unsubscribe, etc., are not affected seriously due to duplication. It may create some annoyances to the user, but absolutely not the end of the world. We can add retry support to mail_room delivery options, something like:

    :delivery_options:
      :delivery_url: "http://localhost:3000/inbox"
      :retry_attempt: 3

We could also apply exponential backoff retry.

Edited by Quang-Minh Nguyen (Ex-GitLab)